Skip to content

Commit b2db2eb

Browse files
author
Matt David
committed
- Add flow overview image
- Make Abstract more readable - Update Sender definition and acronym descriptions - Added comments to ReturnPaymentRequest definition - Bold ECDH and AES Setup notes and added "(see below)" for reference
1 parent e71e572 commit b2db2eb

2 files changed

Lines changed: 20 additions & 16 deletions

File tree

bip-invoicerequest-extension.mediawiki

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
==Abstract==
1313

14-
This BIP is an extension to BIP70 the extends the payment protocol to prevent PaymentRequet interception / modification
15-
during transmission using ephemeral key encryption, allow permissioned release of PaymentRequests to PaymentRequest requestors
16-
and, allow a requestor to supply a certificate and signature to the PaymentRequest creator.
14+
This BIP is an extension to BIP70 that extends the payment protocol to prevent PaymentRequet interception / modification
15+
during transmission using ephemeral key encryption. This also allows permissioned release of a PaymentRequest to a requestor
16+
and allows a requestor to supply a certificate and signature to the PaymentRequest creator.
1717

1818
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
1919
"OPTIONAL" in this document are to be interpreted as described in RFC 2119.
@@ -27,7 +27,7 @@ to facilitate identification for address release.
2727

2828
==Definitions==
2929
{| class="wikitable"
30-
| Sender || Entity wishes to transfer value that they control
30+
| Sender || Entity wishing to transfer value that they control
3131
|-
3232
| Receiver || Entity receiving a value transfer
3333
|}
@@ -36,15 +36,15 @@ to facilitate identification for address release.
3636
{| class="wikitable"
3737
! Acronym !! Expanded !! Description
3838
|-
39-
| IR || InvoiceRequest || A request to create a PaymentRequest
39+
| IR || InvoiceRequest || A request to create and return an encrypted PaymentRequest
4040
|-
41-
| RPR || ReturnPaymentRequest || A ReturnPaymentRequest returned based on a submitted InvoiceRequest
41+
| RPR || ReturnPaymentRequest || A message returned based on a submitted InvoiceRequest containing an encrypted PaymentRequest
4242
|}
4343

4444
==New Messages==
4545

4646
===InvoiceRequest===
47-
The new InvoiceRequest message allows a requestor to send information to the responder such that they can return a ReturnPaymentRequest.
47+
The InvoiceRequest message allows a Sender to send information to the Receiver such that they can create and return a ReturnPaymentRequest.
4848

4949
<pre>
5050
message InvoiceRequest {
@@ -75,15 +75,15 @@ message InvoiceRequest {
7575

7676
===ReturnPaymentRequest===
7777

78-
The new ReturnPaymentRequest message is an encapsulating message that allows the transmission of an encrypted, serialized PaymentRequest.
78+
The ReturnPaymentRequest message is an encapsulating message that allows the transmission of an encrypted, serialized PaymentRequest.
7979

8080
<pre>
81-
message ReturnPaymentRequest {
82-
required bytes encrypted_payment_request = 1;
83-
required bytes receiver_public_key = 2;
84-
required bytes ephemeral_public_key = 3;
85-
required bytes payment_request_hash = 4;
86-
}
81+
message ReturnPaymentRequest {
82+
required bytes encrypted_payment_request = 1; // Encrypted, Serialized PaymentRequest
83+
required bytes receiver_public_key = 2; // Receiver's EC Public Key
84+
required bytes ephemeral_public_key = 3; // Public Key of keypair created with ECDH-derived secret point
85+
required bytes payment_request_hash = 4; // SHA256 of Serialized PaymentRequest
86+
}
8787
</pre>
8888
{| class="wikitable"
8989
! Field Name</b> !! Description
@@ -111,6 +111,10 @@ The new ReturnPaymentRequest message is an encapsulating message that allows the
111111
# Sender validates ReturnPaymentRequest
112112
# Sender decrypts and validates encrypted PaymentRequest
113113
114+
This overview flow is illustrated below:
115+
116+
<img src=bip-ir/overview_flow.png></img>
117+
114118
===Message Interaction Details===
115119

116120
====InvoiceRequest====
@@ -146,7 +150,7 @@ should be done through standard HTTP Status Code messaging ([https://tools.ietf.
146150
* If pki_type is x509+sha256 and signature is valid for the serialized InvoiceRequest where signature is set to "", InvoiceRequest is VALID
147151
148152
===ReturnPaymentRequest Message Creation and PaymentRequest Encryption===
149-
* Encrypt the serialized PaymentRequest using AES-256-CBC setup as described in ECDH Point Generation and AES-256 (CBC Mode) Setup
153+
* Encrypt the serialized PaymentRequest using AES-256-CBC setup as described in <b>ECDH Point Generation and AES-256 (CBC Mode) Setup (see below)</b>
150154
* Create ReturnPaymentRequest message
151155
* Set encrypted_payment_request to be the encrypted value of the PaymentRequest
152156
* Set receiver_public_key to the Receiver's EC public key (of which the private key was previously used in ECDH secret point calculation)
@@ -155,7 +159,7 @@ should be done through standard HTTP Status Code messaging ([https://tools.ietf.
155159
156160
===ReturnPaymentRequest Validation and Decryption===
157161
* Validate ephemeral_public_key matches public key of an EC keypair created using the secret point's X value.
158-
* Decrypt the serialized PaymentRequest using AES-256-CBC setup as described in ECDH Point Generation and AES-256 (CBC Mode) Setup
162+
* Decrypt the serialized PaymentRequest using AES-256-CBC setup as described in <b>ECDH Point Generation and AES-256 (CBC Mode) Setup (see below)</b>
159163
* Validate payment_request_hash matches SHA256 of the decrypted, serialized PaymentRequest
160164
* Deserialize the serialized PaymentRequest
161165

bip-ir/overview_flow.png

65.8 KB
Loading

0 commit comments

Comments
 (0)