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-alfredhodler-privatepayments.mediawiki
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,11 +106,11 @@ While payment codes use 2-byte bitflag arrays, notifications use ordinal values
106
106
107
107
===Notifications===
108
108
109
-
Notifications are performed by publishing transactions that contain a 44-byte <code>OP_RETURN</code> output. The value of the <code>OP_RETURN</code> is constructed using the following formula:
109
+
Notifications are performed by publishing transactions that contain a 40-byte <code>OP_RETURN</code> output. The value of the <code>OP_RETURN</code> is constructed using the following formula:
* ''search_key'' equals "BIP999" and is a static ASCII-encoded string (6 bytes)
113
+
* ''search_key'' equals "PP" and is a static ASCII-encoded string (2 bytes)
114
114
* ''notification_code'' is ''H(n<sub>x</sub> * P)[0..4]'' (4 bytes)
115
115
* ''N<sub>x</sub>'' is the unique public key a sender is using for a particular recipient (33 bytes)
116
116
* ''address_type'' is the '''ordinal''' value of a single address type that a sender wants to send to (1 byte). This must be selected from the recepient's accepted address types.
@@ -124,7 +124,7 @@ When Alice wants to notify Bob that he will receive future payments from her, sh
124
124
# Selects any UTXO in her wallet, preferably not associated with her.
125
125
# Sends a transaction including an <code>OP_RETURN</code> output whose value is set to the constructed payload.
126
126
127
-
When Bob notices an <code>OP_RETURN</code> starting with the search key, he performs the following procedure:
127
+
When Bob notices a 40-byte <code>OP_RETURN</code> starting with ''search key'', he performs the following procedure:
128
128
129
129
# Breaks down the payload into its four constituent parts.
130
130
# Discards the ''search_key'' (item #0).
@@ -142,6 +142,8 @@ Since ''notification_code'' is a 4-byte truncation of the full value, Bob has a
142
142
143
143
There is a scanning requirement on the recipient side in that the recipient must have access to full blocks in order to be able to search them for OP_RETURN outputs containing notifications. For more information on how light clients can get around this limitation and still use the standard, see Appendix B.
144
144
145
+
Recipients that do not want to decode raw block data can quickly search for notifications in a block by looking for the following byte array: <code>[106, 40, 80, 80]</code>. The first two bytes represent ''OP_RETURN'' and ''OP_PUSHBYTES_40'', followed by the ASCII value of ''search_key''.
146
+
145
147
===Transacting===
146
148
147
149
Alice initializes counter ''c'' which is unique to Bob and increments with each transaction. ''c'' is a 64-bit integer and must be inputted into a hasher as a big-endian encoded array of 8 bytes.
@@ -208,7 +210,7 @@ When Bob wants to spend from such addresses, he calculates his private keys in t
0 commit comments