Skip to content

Commit 8c78781

Browse files
author
Matt David
committed
- Remove Acronyms section
- Update InvoiceRequest notification_url definition to use SHOULD instead of MAY - Capitalize MUST, SHOULD, etc. - Update InvoiceRequest Message Creation steps to specifically define behavior for empty amount or amount out of bounds - Add implementation section with references to Addressimo reference Store & Forward server and a client implementation in functest_ir.py - Add flow diagrams for BIP70 extension and moble-to-mobile example with store and forward service
1 parent 32e8210 commit 8c78781

3 files changed

Lines changed: 25 additions & 19 deletions

File tree

bip-invoicerequest-extension.mediawiki

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,6 @@ In short we wanted to make bitcoin more human, while at the same time improving
4646
| Receiver || Entity receiving a value transfer
4747
|}
4848

49-
==Acronyms==
50-
{| class="wikitable"
51-
! Acronym !! Expanded !! Description
52-
|-
53-
| IR || InvoiceRequest || A request to create and return an encrypted PaymentRequest
54-
|-
55-
| RPR || ReturnPaymentRequest || A message returned based on a submitted InvoiceRequest containing an encrypted PaymentRequest
56-
|}
57-
5849
==New Messages==
5950

6051
===InvoiceRequest===
@@ -85,7 +76,7 @@ message InvoiceRequest {
8576
|-
8677
| pki_data || Depends on pki_type
8778
|-
88-
| notification_url || Secure (usually HTTPS) location where a ReturnPaymentRequest (see below) may be sent when ready
79+
| notification_url || Secure (usually HTTPS) location where a ReturnPaymentRequest (see below) SHOULD be sent when ready
8980
|-
9081
| signature || PKI-dependent signature
9182
|}
@@ -127,29 +118,29 @@ message ReturnPaymentRequest {
127118
128119
This overview flow is illustrated below:
129120

130-
<img src=bip-ir/overview_flow.png></img>
121+
<img src="bip-ir/overview_flow.png"></img>
131122

132123
===Message Interaction Details===
133124

134125
====InvoiceRequest====
135-
Sender must transmit InvoiceRequest to Receiver (or Receiver's agent) via TLS-protected HTTP. Sender transmitting InvoiceRequest
136-
messages must set appropriate Content-Type headers as specified here:
126+
Sender MUST transmit InvoiceRequest to Receiver (or Receiver's agent) via TLS-protected HTTP. Sender transmitting InvoiceRequest
127+
messages MUST set appropriate Content-Type headers as specified here:
137128
<pre>Content-Type: application/bitcoin-invoicerequest</pre>
138129

139130
====ReturnPaymentRequest====
140-
Receiver must transmit ReturnPaymentRequest to Sender (or Sender's agent) via TLS-protected HTTP. Receiver transmitting
141-
ReturnPaymentRequest messages must set appropriate Content-Type headers as specified here:
131+
Receiver MUST transmit ReturnPaymentRequest to Sender (or Sender's agent) via TLS-protected HTTP. Receiver transmitting
132+
ReturnPaymentRequest messages MUST set appropriate Content-Type headers as specified here:
142133
<pre>Content-Type: application/bitcoin-returnpaymentrequest</pre>
143134

144135
====Message or Communication Errors====
145-
An invalid or unparsable message or communications error must be communicated to the party that initiated the communication. This
146-
should be done through standard HTTP Status Code messaging ([https://tools.ietf.org/html/rfc7231 RFC 7231 Section 6]).
136+
An invalid or unparsable message or communications error MUST be communicated to the party that initiated the communication. This
137+
SHOULD be done through standard HTTP Status Code messaging ([https://tools.ietf.org/html/rfc7231 RFC 7231 Section 6]).
147138

148139
===InvoiceRequest Message Creation===
149140
* Create an InvoiceRequest message
150141
* sender_public_key MUST be set to the public key of an EC keypair
151142
* nonce MUST be set to a non-repeating number. The current epoch time in microseconds SHOULD be used, unless the creating device doesn't have access to a RTC (in the case of a smart card, for example)
152-
* Amount is optional
143+
* Amount is optional. If the amount is not specified by the InvoiceRequest, the Receiver MAY specify the amount in the returned PaymentRequest. If an amount is specified by the InvoiceRequest and a PaymentRequest cannot be generated for that amount, the InvoiceRequest SHOULD be rejected with HTTP status code 406.
153144
* Set notification_url to URL that the Receiver will submit completed ReturnPaymentRequest to
154145
* If NOT including certificate, set pki_type to "none"
155146
* If including certificate:
@@ -160,7 +151,7 @@ should be done through standard HTTP Status Code messaging ([https://tools.ietf.
160151
161152
===InvoiceRequest Validation===
162153
* Validate sender_public_key is a valid EC public key
163-
* The nonce must not be repeated. The service receiving the InvoiceRequest may use whatever method to make sure that the nonce is never repeated.
154+
* The nonce MUST not be repeated. The service receiving the InvoiceRequest MAY use whatever method to make sure that the nonce is never repeated.
164155
* Validate notification_url if set, contains characters deemed valid for a URL (avoiding XSS related characters, etc).
165156
* If pki_type is None, InvoiceRequest is VALID
166157
* If pki_type is x509+sha256 and signature is valid for the serialized InvoiceRequest where signature is set to "", InvoiceRequest is VALID
@@ -186,6 +177,21 @@ should be done through standard HTTP Status Code messaging ([https://tools.ietf.
186177
** Use HMAC_DRBG.GENERATE(32) as the Encryption Key (256 bits)
187178
** Use HMAC_DRBG.GENERATE(16) as the Initialization Vector (IV) (128 bits)
188179
180+
==Implementation==
181+
A reference implementation for a Store & Forward server supporting this proposal can be found here: [https://github.com/netkicorp/addressimo Addressimo]
182+
A reference client implementation can be found in the InvoiceRequest functional testing for Addressimo here: [https://github.com/netkicorp/addressimo/blob/master/functest/functest_ir.py InvoiceRequest Client Reference Implementation]
183+
184+
==BIP70 Extension==
185+
The following flowchart is borrowed from BIP70 and expanded upon in order to visually describe how this BIP is an extension to BIP70.
186+
187+
<img src="bip-ir/bip70-extension.png"></img>
188+
189+
==Mobile to Mobile Example==
190+
The following diagram shows a sample flow in which one mobile client is sending value to a second mobile client with the use
191+
of an InvoiceRequest, a Store & Forward server, and a ReturnPaymentRequest.
192+
193+
<img src="bip-ir/mobile-sf-bip70-extension.png"></img>
194+
189195
==Reference==
190196

191197
* [[bip-0070.mediawiki|BIP70 - Payment Protocol]]

bip-ir/bip70-extension.png

68.9 KB
Loading
87.3 KB
Loading

0 commit comments

Comments
 (0)