|
1 | 1 | RECENT CHANGES:
|
| 2 | +* (19 Apr 2016) Define version 2 payment codes |
2 | 3 | * (17 Apr 2016) Clarify usage of outpoints in notification transactions
|
3 | 4 | * (18 Dec 2015) Update explanations to resolve FAQs
|
4 |
| -* (12 Oct 2015) Revise blinding method for notification transactions |
5 | 5 |
|
6 | 6 | <pre>
|
7 | 7 | BIP: 47
|
@@ -84,7 +84,27 @@ Hardened derivation is used at this level.
|
84 | 84 |
|
85 | 85 | Except where noted, all keys derived from a payment code use the public derivation method.
|
86 | 86 |
|
87 |
| -==Standard Payment Codes (v1)== |
| 87 | +==Versions== |
| 88 | + |
| 89 | +Payment codes contain a version byte which identifies a specific set of behavior. |
| 90 | + |
| 91 | +Unless otherwise specified, payment codes of different versions are interoperable. If Alice uses a version x payment code, and Bob uses a version y payment code, they can still send and receive transactions between each other. |
| 92 | + |
| 93 | +Currently specified versions: |
| 94 | + |
| 95 | +* Version 1 |
| 96 | +** Address type: P2PKH |
| 97 | +** Notification type: address |
| 98 | +* Version 2 |
| 99 | +** Address type: P2PKH |
| 100 | +** Notification type: bloom-multisig |
| 101 | +
|
| 102 | +===Recommended Versions=== |
| 103 | + |
| 104 | +* Wallets which have bloom filtering capabilities SHOULD create version 2 payment codes instead of version 1 payment codes. |
| 105 | +* Version 1 payment codes are only recommended for wallets which lack access to bloom filtering capability. |
| 106 | +
|
| 107 | +==Version 1== |
88 | 108 |
|
89 | 109 | ===Representation===
|
90 | 110 |
|
@@ -127,6 +147,8 @@ It is assumed that Alice can easily obtain Bob's payment code via a suitable met
|
127 | 147 |
|
128 | 148 | Prior to the first time Alice initiates a transaction to Bob, Alice MUST inform Bob of her payment code via the following procedure:
|
129 | 149 |
|
| 150 | +Note: this procedure is used if Bob uses a version 1 payment code (regardless of the the version of Alice's payment code). If Bob's payment code is not version 1, see the appropriate section in this specification. |
| 151 | + |
130 | 152 | # Alice constructs a transaction which sends a small quantity of bitcoins to Bob's notification address (notification transaction)
|
131 | 153 | ## The inputs selected for this transaction MUST NOT be easily associated with Alice's notification address
|
132 | 154 | # Alice derives a unique shared secret using ECDH:
|
@@ -180,6 +202,17 @@ Alice SHOULD use an input script in one of the following standard forms to expos
|
180 | 202 |
|
181 | 203 | Compatible wallets MAY provide a method for a user to manually specify the public key associated with a notification transaction in order to recover payment codes sent via non-standard notification transactions.
|
182 | 204 |
|
| 205 | +=====Post-Notification Privacy Considerations===== |
| 206 | + |
| 207 | +Incautious handling of change outputs from notification transactions may cause unintended loss of privacy. |
| 208 | + |
| 209 | +The recipient of a transaction which spends a change output from a prior notification transaction will learn about the potential connection between the sender and the recipient of the notification transaction. |
| 210 | + |
| 211 | +The following actions are recommended to reduce this risk: |
| 212 | + |
| 213 | +* Wallets which support mixing SHOULD mix change outputs from notification transactions prior to spending them |
| 214 | +* Wallets which do not support mixing MAY simulate mixing by creating a transaction which spends the change output to the next external BIP44 address |
| 215 | +
|
183 | 216 | ====Sending====
|
184 | 217 |
|
185 | 218 | # Each time Alice wants to initiate a transaction to Bob, Alice derives a unique P2PKH address for the transaction using ECDH follows:
|
@@ -294,6 +327,41 @@ The sender transmits their payment code in base58 form to the calculated Bitmess
|
294 | 327 |
|
295 | 328 | In order to use Bitmessage notification, the recipient must have a Bitmessage client which listens at the address which the senders will derive and is capable of relaying received payment codes to the Bitcoin wallet.
|
296 | 329 |
|
| 330 | +==Version 2== |
| 331 | + |
| 332 | +Version 2 payment codes behave identifically to version 1 payment codes, except as modified below. |
| 333 | + |
| 334 | +===Representation=== |
| 335 | + |
| 336 | +====Binary Serialization==== |
| 337 | + |
| 338 | +* Byte 0: version. required value: 0x02 |
| 339 | +
|
| 340 | +===Protocol=== |
| 341 | + |
| 342 | +====Definitions==== |
| 343 | + |
| 344 | +* Notification change output: the change output from a notification transaction which which resides in the sender's wallet, but can be automatically located by the intended recipient |
| 345 | +* Payment code identifier: a 33 byte representation of a payment code constructed by prepending 0x02 to the SHA256 hash of the binary serialization of the payment code |
| 346 | +
|
| 347 | +====Notification Transaction==== |
| 348 | + |
| 349 | +Note: this procedure is used if Bob uses a version 2 payment code (regardless of the the version of Alice's payment code). If Bob's payment code is not version 2, see the appropriate section in this specification. |
| 350 | + |
| 351 | +# Construct a notification transaction as per the version 1 instructions, except do not create the output to Bob's notification address |
| 352 | +# Create a notification change address as follows: |
| 353 | +## Obtain the pubkey corresponding to the next change address |
| 354 | +## Construct a multisig output in the form: |
| 355 | +<pre>OP_1 <Bob's payment code identifier> <change address pubkey> OP_2 OP_CHECKMULTISIG</pre> |
| 356 | + |
| 357 | +The relative ordering of the payment code identifier and change address pubkey in the above script MAY be randomized |
| 358 | + |
| 359 | +Bob detects notification transactions by adding his payment code identifier to his bloom filter. |
| 360 | + |
| 361 | +# When the filter returns a notification transaction, the sender's payment code is unblinded using the same procedure as for version 1 notification transactions. |
| 362 | +
|
| 363 | +Alice's wallet should spend the notification change output at the next appropriate opportunity. |
| 364 | + |
297 | 365 | ==Test Vectors==
|
298 | 366 |
|
299 | 367 | * [[https://gist.github.com/SamouraiDev/6aad669604c5930864bd|BIP47 Reusable Payment Codes Test Vectors]]
|
|
0 commit comments