Skip to content

Commit dde2742

Browse files
authored
Merge pull request bitcoin#593 from jonathancross/bip-175
BIP 175 Improvements
2 parents dce3cc5 + d8d5a0d commit dde2742

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

bip-0175.mediawiki

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "S
2020

2121
==Motivation==
2222

23-
A Bitcoin transaction represents a "real world" contract between two parties transferring value. Counterparties in a business interaction traditionally keep track of a payment with bills (invoices) and receipts. Delivery of a good is made by the payee once the payor has signed the receipt, agreeing to pay for the items on the invoice. Gerhardt and Hanke [0] formulate this interaction within the confines of the Bitcoin protocol using homomorphic payment addresses and the multiparty pay-to-contract protocol.
23+
A Bitcoin transaction represents a "real world" contract between two parties transferring value. Counterparties in a business interaction traditionally keep track of a payment with bills (invoices) and receipts. Delivery of a good is made by the payee once the payer has signed the receipt, agreeing to pay for the items on the invoice. Gerhardt and Hanke [0] formulate this interaction within the confines of the Bitcoin protocol using homomorphic payment addresses and the multiparty pay-to-contract protocol.
2424

2525
The protocol is constructed in such a way that all parties have cryptographic proof of both who is being paid and for what. Using the technique described in this BIP, an address can be provably derived from the terms of a contract and the payee's public key. This derivation scheme does not bloat the UTXO and is completely hidden to network participants; the derived address looks like any other P2(W)PKH or P2(W)SH address. Redemption of the funds requires knowledge of the contract and the payee's private key.
2626

@@ -30,15 +30,15 @@ This scheme utilizes the foundations of BIP-0032, providing a consistent way for
3030

3131
This key derivation scheme requires two parties: a payer (customer) and a payee (merchant).
3232
The customer submits to the merchant a purchase request, specifying what goods/services they would like to buy. From the purchase request the merchant constructs an invoice (contract), specifying the billable items and total amount to be paid.
33-
The merchant must give this contract alongside a “payment base” extended public key to the customer. Given this information, the customer will be able to fulfill the contract by generating the public key of the payment address associated with the contract and the payment base and sending the funds there.
33+
The merchant must give this contract alongside a “payment base” extended public key to the customer. Given this information, the customer will be able to fulfill the contract by generating the public key of the payment address associated with the contract and the payment base, then sending the funds there.
3434

3535
We define the following levels in BIP32 path:
3636

3737
<code>
3838
m / purpose' / coin_type' / contract_hash
3939
</code>
4040

41-
<code>contract_hash</code> consists of mulitple levels.
41+
<code>contract_hash</code> consists of multiple levels.
4242

4343
Apostrophe in the path indicates that BIP32 hardened derivation is used.
4444

@@ -145,13 +145,16 @@ we can compute payment base as follows:
145145
146146
In the below examples, we are going to use SHA256 as a cryptographic hash function, and the above contract base public key.
147147

148-
payment address generation:
148+
====Payment address generation:====
149149

150150
As an input, we have a contract that consists of two documents, below are contents:
151151

152-
document 1:
152+
document 1:
153+
153154
bar
154-
document 2:
155+
156+
document 2:
157+
155158
foo
156159
157160
1. Apply the hash function:
@@ -161,7 +164,6 @@ As an input, we have a contract that consists of two documents, below are conten
161164
document 2:
162165
2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae
163166
164-
165167
2. Sort all hashes lexicographically:
166168

167169
2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae
@@ -193,18 +195,19 @@ As an input, we have a contract that consists of two documents, below are conten
193195
1HYjhPTtMmpBJBd5tVepZDAVdvPA7o8KHJ
194196
195197

196-
verification example 1 (negative test):
198+
====Verification example 1 (negative test):====
197199

198-
Similarliy to the input above, except this time we have a contract that consists of one document, below is content:
200+
Similar to the input above, except this time we have a contract that consists of one document, below is the content:
201+
202+
document 1:
199203

200-
document 1:
201204
baz
202205
203206
1. Apply the hash function.
204207

205208
baa5a0964d3320fbc0c6a922140453c8513ea24ab8fd0577034804a967248096
206209
207-
2. Apply the hash function second time (list of one item).
210+
2. Apply the hash function a second time (list of one item).
208211

209212
3a08605829413ce0bf551b08d21e4a28dbda6e407f90eff1c448e839050c73a1
210213
@@ -232,13 +235,13 @@ Verification operation will succeed only if we use identical documents to ones t
232235

233236
==Compatibility==
234237

235-
This specification is not backward compatibile with BIP32 specification, the proposed derivation scheme in this BIP is a BIP32 compliant.
236-
Communication between payor and payee as well as hashing the contract and generating the path requires significant modification to the wallet.
238+
This specification is not backward compatible with BIP32 specification, the proposed derivation scheme in this BIP is a BIP32 compliant.
239+
Communication between payer and payee as well as hashing the contract and generating the path requires significant modification to the wallet.
237240

238241
==Reference implementations==
239242

240243
* Reference wallet implementation, based on Copay project : https://github.com/commerceblock/copay ([[https://github.com/commerceblock/copay/pull/1|pull_request]])
241-
* Reference implementaion to Hash to Partial Derivation Path Mapping in javascript ([[https://github.com/commerceblock/pay-to-contract-lib/blob/master/lib/contract.js|https://github.com/commerceblock/pay-to-contract-lib]])
244+
* Reference implementation to Hash to Partial Derivation Path Mapping in javascript ([[https://github.com/commerceblock/pay-to-contract-lib/blob/master/lib/contract.js|https://github.com/commerceblock/pay-to-contract-lib]])
242245
243246
==Reference==
244247

0 commit comments

Comments
 (0)