dcrwallet icon indicating copy to clipboard operation
dcrwallet copied to clipboard

Pay to Contract Protocol

Open githubsands opened this issue 7 years ago • 3 comments

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 CoinTypeKey function to grab coin type key (or basepayment hash) within the wallets clients local database. This is to be used within getPayToContractAddress.

  • [x] Required additions to dcrd/dcrjson to allow RPCs from client to dcrd server.

  • [x] CreatehashContracts, createContractArray, lexiSort functions for future use in functions within legacyrpc/methods.go.

  • [x] Create getContractsHash and getPayToContractAddress methods within legacyrpc/methods.go

  • [x] Refactor hashContracts to use blake256

  • [ ] Refactor lexiSort to use golang standard library - sort

  • [x] Refactor getContractHash and getPayToContractAddress to utilize less of the heap

  • [x] Implement required help messages in dcrwallet/internal for newly created RPC calls. Go Generate will also need to be ran in on legacyrpc/methods.go

  • [ ] Implement getContractHash & getPayToContractAddress as grpc

  • [ ] Create functions verifyContractHash and verifyContractHashAddress that allows the conferrer to verify the contract and P2PKH contract hash of the recipient.

  • [ ] Add createContract method within legacyrpc/methods.go. This will add ability to create "simple" contracts from the dcrwallet cli itself. And implement required help messages within dcrwallet/internal.

  • [ ] Refactor createContracyArray, hashContracts, getContractHash, getPayToContractAddress to include the createContract optionality.

  • [ ] Include P2PKH contract hashes in the wallets database. Work will have to be done in wallet.go i.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.

githubsands avatar May 07 '18 22:05 githubsands

Got this going

githubsands avatar May 07 '18 22:05 githubsands

Wallet function, CoinTypeKey created here: 276f0af

githubsands avatar Jun 04 '18 19:06 githubsands

RPCs getcontracthash && getpaytocontracthash #1595

githubsands avatar Oct 27 '19 02:10 githubsands