Skip to content

Commit 3425940

Browse files
authored
Merge pull request bitcoin#476 from techguy613/master
BIP75 Update for SEC Formatted Public Keys and Unique Identifier
2 parents 1dedbfa + 99614fc commit 3425940

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

bip-0075.mediawiki

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ message InvoiceRequest {
105105
{| class="wikitable"
106106
! Field Name !! Description
107107
|-
108-
| sender_public_key || Sender's EC public key
108+
| sender_public_key || Sender's SEC-encoded EC public key
109109
|-
110110
| amount || amount is integer-number-of-satoshis (default: 0)
111111
|-
@@ -141,7 +141,7 @@ message ProtocolMessage {
141141
required ProtocolMessageType message_type = 3;
142142
required bytes serialized_message = 4;
143143
optional string status_message = 5;
144-
optional bytes identifier = 6;
144+
required bytes identifier = 6;
145145
}
146146
</pre>
147147

@@ -158,7 +158,7 @@ message ProtocolMessage {
158158
|-
159159
|status_message || Human-readable Payment Protocol status message
160160
|-
161-
|identifier || Unique key to identify this entire exchange on the server. SHA256 of initial serialized InvoiceRequest SHOULD be used by default
161+
|identifier || Unique key to identify this entire exchange on the server. Default value SHOULD be SHA256(Serialized Initial InvoiceRequest + Current Epoch Time in Seconds as a String)
162162
|}
163163

164164
===Versioning===
@@ -177,7 +177,7 @@ message EncryptedProtocolMessage {
177177
required bytes receiver_public_key = 5;
178178
required bytes sender_public_key = 6;
179179
required uint64 nonce = 7;
180-
optional bytes identifier = 8;
180+
required bytes identifier = 8;
181181
optional string status_message = 9;
182182
optional bytes signature = 10;
183183
}
@@ -193,13 +193,13 @@ message EncryptedProtocolMessage {
193193
|-
194194
| encrypted_message || AES-256-GCM Encrypted (as defined in BIP75) Payment Protocol Message
195195
|-
196-
| receiver_public_key || Receiver's DER-encoded EC Public Key
196+
| receiver_public_key || Receiver's SEC-encoded EC Public Key
197197
|-
198-
| sender_public_key || Sender's DER-encoded EC Public Key
198+
| sender_public_key || Sender's SEC-encoded EC Public Key
199199
|-
200200
| nonce || Microseconds since epoch
201201
|-
202-
| identifier || Unique key to identify this entire exchange on the server. SHA256 of initial serialized InvoiceRequest SHOULD be used by default
202+
| identifier || Unique key to identify this entire exchange on the server. Default value SHOULD be SHA256(Serialized Initial InvoiceRequest + Current Epoch Time in Seconds as a String)
203203
|-
204204
| status_message || Human-readable Payment Protocol status message
205205
|-
@@ -362,7 +362,7 @@ When either '''status_code''' OR '''status_message''' are present, the AES-256 G
362362
Initial public key retrieval for [[#InvoiceRequest|InvoiceRequest]] encryption via [[#EncryptedProtocolMessage|EncryptedProtocolMessage]] encapsulation can be done in a number of ways including, but not limited to, the following:
363363
# Wallet Name public key asset type resolution - DNSSEC-validated name resolution returns Base64 encoded DER-formatted EC public key via TXT Record [https://www.ietf.org/rfc/rfc5480.txt RFC 5480]
364364
# Key Server lookup - Key Server lookup (similar to PGP's pgp.mit.edu) based on key server identifier (i.e., e-mail address) returns Base64 encoded DER-formatted EC public key [https://www.ietf.org/rfc/rfc5480.txt RFC 5480]
365-
# QR Code - Use of QR-code to encode DER-formatted EC public key [https://www.ietf.org/rfc/rfc5480.txt RFC 5480]
365+
# QR Code - Use of QR-code to encode SEC-formatted EC public key [https://www.ietf.org/rfc/rfc5480.txt RFC 5480]
366366
# Address Service Public Key Exposure
367367
368368
==Payment / PaymentACK Messages with a HTTP Store & Forward Server==
@@ -376,7 +376,8 @@ If a Store & Forward server wishes to protect themselves from spam or abuse, the
376376
Clients SHOULD keep in mind Receivers can broadcast a transaction without returning an ACK. If a Payment message needs to be updated, it SHOULD include at least one input referenced in the original transaction to prevent the Receiver from broadcasting both transactions and getting paid twice.
377377

378378
==Public Key & Signature Encoding==
379-
* All EC public keys ('''sender_public_key''', '''receiver_public_key''') or x.509 certificates included in any message defined in this BIP MUST be DER [ITU.X690.1994] encoded.
379+
* All x.509 certificates included in any message defined in this BIP MUST be DER [ITU.X690.1994] encoded.
380+
* All EC public keys ('''sender_public_key''', '''receiver_public_key''') in any message defined in this BIP MUST be [[SECP256k1|http://www.secg.org/sec2-v2.pdf]] ECDSA Public Key ECPoints encoded using [[SEC 2.3.3 Encoding|http://www.secg.org/sec1-v2.pdf]]. Encoding MAY be compressed.
380381
* All ECC signatures included in any message defined in this BIP MUST use the SHA-256 hashing algorithm and MUST be DER [ITU.X690.1994] encoded.
381382
* All OpenPGP certificates must follow [[https://tools.ietf.org/html/rfc4880|RFC4880]], sections 5.5 and 12.1.
382383

bip-0075/paymentrequest.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ message ProtocolMessage {
7070
required ProtocolMessageType message_type = 3; // Message Type of serialized_message
7171
required bytes serialized_message = 4; // Serialized Payment Protocol Message
7272
optional string status_message = 5; // Human-readable Payment Protocol status message
73-
optional bytes identifier = 6; // Unique key to identify this entire exchange on the server. SHA256 of initial serialized InvoiceRequest SHOULD be used by default
73+
required bytes identifier = 6; // Unique key to identify this entire exchange on the server. Default value SHOULD be SHA256(Serialized Initial InvoiceRequest + Current Epoch Time in Seconds as a String)
7474
}
7575

7676
message EncryptedProtocolMessage {
@@ -81,7 +81,7 @@ message EncryptedProtocolMessage {
8181
required bytes receiver_public_key = 5; // Receiver's DER-encoded EC Public Key
8282
required bytes sender_public_key = 6; // Sender's DER-encoded EC Public Key
8383
required uint64 nonce = 7; // Microseconds since epoch
84-
optional bytes identifier = 8; // Unique key to identify this entire exchange on the server. SHA256 of initial serialized InvoiceRequest SHOULD be used by default
84+
required bytes identifier = 8; // Unique key to identify this entire exchange on the server. Default value SHOULD be SHA256(Serialized Initial InvoiceRequest + Current Epoch Time in Seconds as a String)
8585
optional string status_message = 9; // Human-readable Payment Protocol status message
8686
optional bytes signature = 10; // Signature over the full EncryptedProtocolMessage with EC Key Belonging to Sender / Receiver, respectively
8787
}

0 commit comments

Comments
 (0)