You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bip-0175.mediawiki
+17-14Lines changed: 17 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "S
20
20
21
21
==Motivation==
22
22
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.
24
24
25
25
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.
26
26
@@ -30,15 +30,15 @@ This scheme utilizes the foundations of BIP-0032, providing a consistent way for
30
30
31
31
This key derivation scheme requires two parties: a payer (customer) and a payee (merchant).
32
32
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.
34
34
35
35
We define the following levels in BIP32 path:
36
36
37
37
<code>
38
38
m / purpose' / coin_type' / contract_hash
39
39
</code>
40
40
41
-
<code>contract_hash</code> consists of mulitple levels.
41
+
<code>contract_hash</code> consists of multiple levels.
42
42
43
43
Apostrophe in the path indicates that BIP32 hardened derivation is used.
44
44
@@ -145,13 +145,16 @@ we can compute payment base as follows:
145
145
146
146
In the below examples, we are going to use SHA256 as a cryptographic hash function, and the above contract base public key.
147
147
148
-
payment address generation:
148
+
====Payment address generation:====
149
149
150
150
As an input, we have a contract that consists of two documents, below are contents:
151
151
152
-
document 1:
152
+
document 1:
153
+
153
154
bar
154
-
document 2:
155
+
156
+
document 2:
157
+
155
158
foo
156
159
157
160
1. Apply the hash function:
@@ -161,7 +164,6 @@ As an input, we have a contract that consists of two documents, below are conten
@@ -232,13 +235,13 @@ Verification operation will succeed only if we use identical documents to ones t
232
235
233
236
==Compatibility==
234
237
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.
237
240
238
241
==Reference implementations==
239
242
240
243
* 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]])
0 commit comments