dcrwallet
dcrwallet copied to clipboard
Pay to Contract Protocol
Sequence to implement BIP175, pay to contract protocol as well as other utilities that will allow recipients and conferees to interact with the protocol under different circumstances.
See https://github.com/bitcoin/bips/blob/master/bip-0175.mediawiki & https://arxiv.org/pdf/1212.3257v1.pdf for more details.
-
[x] Create
CoinTypeKeyfunction to grab coin type key (or basepayment hash) within the wallets clients local database. This is to be used withingetPayToContractAddress. -
[x] Required additions to
dcrd/dcrjsonto allow RPCs from client to dcrd server. -
[x] Create
hashContracts,createContractArray,lexiSortfunctions for future use in functions withinlegacyrpc/methods.go. -
[x] Create
getContractsHashandgetPayToContractAddressmethods within legacyrpc/methods.go -
[x] Refactor
hashContractsto use blake256 -
[ ] Refactor
lexiSortto use golang standard library - sort -
[x] Refactor
getContractHashandgetPayToContractAddressto utilize less of the heap -
[x] Implement required help messages in
dcrwallet/internalfor newly created RPC calls. Go Generate will also need to be ran in onlegacyrpc/methods.go -
[ ] Implement
getContractHash&getPayToContractAddressas grpc -
[ ] Create functions
verifyContractHashandverifyContractHashAddressthat allows the conferrer to verify the contract and P2PKH contract hash of the recipient. -
[ ] Add
createContractmethod withinlegacyrpc/methods.go. This will add ability to create "simple" contracts from the dcrwallet cli itself. And implement required help messages withindcrwallet/internal. -
[ ] Refactor
createContracyArray,hashContracts,getContractHash,getPayToContractAddressto include thecreateContractoptionality. -
[ ] Include P2PKH contract hashes in the wallets database. Work will have to be done in
wallet.goi.e get:getaddressbycontract: registers addresses in the database not by account by by contracts.getaddressbyconferee: registers addressees with their respected conferees.
Other:
This leads me to the thought of registering addresses to conferrees.
i.e registeraddreswithconferree takes in a address and a conferree and links them together.
Got this going
Wallet function, CoinTypeKey created here: 276f0af
RPCs getcontracthash && getpaytocontracthash #1595