From c0c7d7f0a101a84523a581bff6edb922b44d560b Mon Sep 17 00:00:00 2001 From: jmacwhyte Date: Mon, 7 Mar 2016 18:18:58 -0800 Subject: Renamed to BIP75, added extensions to BIP70 payment details --- bip-0075/bip70-extension.png | Bin 0 -> 88989 bytes bip-0075/encrypted-invoice-request-process.png | Bin 0 -> 164633 bytes bip-0075/invoice-request-process.png | Bin 0 -> 107506 bytes .../mobile-sf-encrypted-ir-without-payment.png | Bin 0 -> 106744 bytes bip-0075/mobile-sf-ir-with-payment.png | Bin 0 -> 113169 bytes bip-0075/mobile-sf-ir-without-payment.png | Bin 0 -> 92902 bytes bip-0075/paymentrequest.proto | 99 +++++++++++++++++++++ 7 files changed, 99 insertions(+) create mode 100644 bip-0075/bip70-extension.png create mode 100644 bip-0075/encrypted-invoice-request-process.png create mode 100644 bip-0075/invoice-request-process.png create mode 100755 bip-0075/mobile-sf-encrypted-ir-without-payment.png create mode 100755 bip-0075/mobile-sf-ir-with-payment.png create mode 100755 bip-0075/mobile-sf-ir-without-payment.png create mode 100644 bip-0075/paymentrequest.proto (limited to 'bip-0075') diff --git a/bip-0075/bip70-extension.png b/bip-0075/bip70-extension.png new file mode 100644 index 0000000..d235992 Binary files /dev/null and b/bip-0075/bip70-extension.png differ diff --git a/bip-0075/encrypted-invoice-request-process.png b/bip-0075/encrypted-invoice-request-process.png new file mode 100644 index 0000000..beb5df1 Binary files /dev/null and b/bip-0075/encrypted-invoice-request-process.png differ diff --git a/bip-0075/invoice-request-process.png b/bip-0075/invoice-request-process.png new file mode 100644 index 0000000..47a4fac Binary files /dev/null and b/bip-0075/invoice-request-process.png differ diff --git a/bip-0075/mobile-sf-encrypted-ir-without-payment.png b/bip-0075/mobile-sf-encrypted-ir-without-payment.png new file mode 100755 index 0000000..af66a4d Binary files /dev/null and b/bip-0075/mobile-sf-encrypted-ir-without-payment.png differ diff --git a/bip-0075/mobile-sf-ir-with-payment.png b/bip-0075/mobile-sf-ir-with-payment.png new file mode 100755 index 0000000..c668eac Binary files /dev/null and b/bip-0075/mobile-sf-ir-with-payment.png differ diff --git a/bip-0075/mobile-sf-ir-without-payment.png b/bip-0075/mobile-sf-ir-without-payment.png new file mode 100755 index 0000000..ab18d0f Binary files /dev/null and b/bip-0075/mobile-sf-ir-without-payment.png differ diff --git a/bip-0075/paymentrequest.proto b/bip-0075/paymentrequest.proto new file mode 100644 index 0000000..8f39c6d --- /dev/null +++ b/bip-0075/paymentrequest.proto @@ -0,0 +1,99 @@ +// +// Simple Bitcoin Payment Protocol messages +// +// Use fields 1000+ for extensions; +// to avoid conflicts, register extensions via pull-req at +// https://github.com/bitcoin/bips/bip-0070/extensions.mediawiki +// + +package payments; +option java_package = "org.bitcoin.protocols.payments"; +option java_outer_classname = "Protos"; + +// Generalized form of "send payment to this/these bitcoin addresses" +message Output { + optional uint64 amount = 1 [default = 0]; // amount is integer-number-of-satoshis + required bytes script = 2; // usually one of the standard Script forms +} +message PaymentDetails { + optional string network = 1 [default = "main"]; // "main" or "test" + repeated Output outputs = 2; // Where payment should be sent + required uint64 time = 3; // Timestamp; when payment request created + optional uint64 expires = 4; // Timestamp; when this request should be considered invalid + optional string memo = 5; // Human-readable description of request for the customer + optional string payment_url = 6; // URL to send Payment and get PaymentACK + optional bytes merchant_data = 7; // Arbitrary data to include in the Payment message +} +message PaymentRequest { + optional uint32 payment_details_version = 1 [default = 1]; + optional string pki_type = 2 [default = "none"]; // none / x509+sha256 / x509+sha1 + optional bytes pki_data = 3; // depends on pki_type + required bytes serialized_payment_details = 4; // PaymentDetails + optional bytes signature = 5; // pki-dependent signature +} +message X509Certificates { + repeated bytes certificate = 1; // DER-encoded X.509 certificate chain +} +message Payment { + optional bytes merchant_data = 1; // From PaymentDetails.merchant_data + repeated bytes transactions = 2; // Signed transactions that satisfy PaymentDetails.outputs + repeated Output refund_to = 3; // Where to send refunds, if a refund is necessary + optional string memo = 4; // Human-readable message for the merchant +} +message PaymentACK { + required Payment payment = 1; // Payment message that triggered this ACK + optional string memo = 2; // human-readable message for customer +} + +// BIP-IR Extensions + +message InvoiceRequest { + required bytes sender_public_key = 1; // Sender's EC Public Key + optional uint64 amount = 3 [default = 0]; // amount is integer-number-of-satoshis + optional string pki_type = 4 [default = "none"]; // none / x509+sha256 + optional bytes pki_data = 5; // Depends on pki_type + optional string memo = 6; // Human-readable description of invoice request for the receiver + optional string notification_url = 7; // URL to notify on EncryptedPaymentRequest ready + optional bytes signature = 8; // PKI-dependent signature +} + +message EncryptedInvoiceRequest { + required bytes encrypted_invoice_request = 1; // AES-256-CBC Encrypted InvoiceRequest as defined in InvoiceRequest Spec + required bytes invoice_request_hash = 2; // SHA256 Hash of Non-Encrypted, Serialized InvoiceRequest (used for authentication) + required bytes sender_public_key = 3; // Sender's EC Public Key + required bytes receiver_public_key = 4; // Receiver's EC Public Key + required uint64 nonce = 5; // Microseconds since epoch + optional bytes identifier = 6; // Unique key to identify this entire exchange on the server. invoice_request_hash SHOULD be used by default + optional bytes signature = 7; // Signature of this message using Sender's EC key +} + +message EncryptedPaymentRequest { + required bytes encrypted_payment_request = 1; // AES-256-CBC Encrypted PaymentRequest as defined in InvoiceRequest Spec + required bytes payment_request_hash = 2; // SHA256 Hash of Non-Encrypted, Serialized PaymentRequest (used for authentication) + required bytes receiver_public_key = 3; // Receiver's EC Public Key + required bytes sender_public_key = 4; // Sender's EC Public Key + required uint64 nonce = 5; // Microseconds since epoch + optional bool requires_payment_message = 6 [default = false]; // Requires Payment/PaymentACK message exchange + optional bytes signature = 7; // Signature of this message using Receiver's EC key + optional bytes identifier = 8; // MUST use the identifier specified with the InvoiceRequest if the PaymentRequest is in response to an InvoiceRequest. Otherwise, use payment_request_hash or other unique value. +} + +message EncryptedPayment { + required bytes encrypted_payment = 1; // AES-256-CBC Encrypted BIP70 Payment as defined in InvoiceRequest Spec + required bytes payment_hash = 2; // SHA256 Hash of Non-Encrypted, Serialized BIP70 Payment + required bytes sender_public_key = 3; // Sender's EC Public Key + required bytes receiver_public_key = 4; // Receiver's EC Public Key + required uint64 nonce = 5; // Microseconds since epoch + required bytes signature = 6; // Signature over EncryptedPayment with Sender's EC Key + optional bytes identifier = 7; // Use the identifier specified with the EncryptedPaymentRequest, if any. +} + +message EncryptedPaymentACK { + required bytes encrypted_payment_ack = 1; // AES-256-CBC Encrypted BIP70 PaymentACK as defined in InvoiceRequest Spec + required bytes payment_ack_hash = 2; // SHA256 Hash of Non-Encrypted, Serialized BIP70 PaymentACK + required bytes receiver_public_key = 3; // Receiver's EC Public Key + required bytes sender_public_key = 4; // Sender's EC Public Key + required uint64 nonce = 5; // Microseconds since epoch + required bytes signature = 6; // Signature over EncryptedPaymentACK with Receiver's EC Key + optional bytes identifier = 7; // Use the identifier specified with the EncryptedPaymentRequest, if any. +} -- cgit v1.2.3 From f753dd73723ce9e280190788326c672e2df1f0d2 Mon Sep 17 00:00:00 2001 From: Matt David Date: Tue, 8 Mar 2016 09:43:17 -0800 Subject: - Add subtract_fee and replace_by_fee flags to PaymentDetails. replace_by_fee is commented out as it's only available in version 2 of the message --- bip-0075/paymentrequest.proto | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'bip-0075') diff --git a/bip-0075/paymentrequest.proto b/bip-0075/paymentrequest.proto index 8f39c6d..149dc97 100644 --- a/bip-0075/paymentrequest.proto +++ b/bip-0075/paymentrequest.proto @@ -17,12 +17,14 @@ message Output { } message PaymentDetails { optional string network = 1 [default = "main"]; // "main" or "test" - repeated Output outputs = 2; // Where payment should be sent - required uint64 time = 3; // Timestamp; when payment request created - optional uint64 expires = 4; // Timestamp; when this request should be considered invalid - optional string memo = 5; // Human-readable description of request for the customer - optional string payment_url = 6; // URL to send Payment and get PaymentACK - optional bytes merchant_data = 7; // Arbitrary data to include in the Payment message + repeated Output outputs = 2; // Where payment should be sent + required uint64 time = 3; // Timestamp; when payment request created + optional uint64 expires = 4; // Timestamp; when this request should be considered invalid + optional string memo = 5; // Human-readable description of request for the customer + optional string payment_url = 6; // URL to send Payment and get PaymentACK + optional bytes merchant_data = 7; // Arbitrary data to include in the Payment message + optional bool subtract_fee = 1000; // Allow SubtractableFee + //optional bool replace_by_fee = 1001; // Force RBF true or false (version: 2) } message PaymentRequest { optional uint32 payment_details_version = 1 [default = 1]; -- cgit v1.2.3 From a8c02462951ebbe0c52248aa64a63c7ed547778e Mon Sep 17 00:00:00 2001 From: Matt David Date: Wed, 9 Mar 2016 18:57:48 -0800 Subject: - Update optional flags to PaymentDetails definition in paymentrequest.proto - Add DER encoding requirement for EC public keys and ECC signatures - Add SHA-256 hashing requirement for ECC signatures - Add FIPS 180-4 SHS link --- bip-0075/paymentrequest.proto | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'bip-0075') diff --git a/bip-0075/paymentrequest.proto b/bip-0075/paymentrequest.proto index 149dc97..d1c9e4f 100644 --- a/bip-0075/paymentrequest.proto +++ b/bip-0075/paymentrequest.proto @@ -17,14 +17,15 @@ message Output { } message PaymentDetails { optional string network = 1 [default = "main"]; // "main" or "test" - repeated Output outputs = 2; // Where payment should be sent - required uint64 time = 3; // Timestamp; when payment request created - optional uint64 expires = 4; // Timestamp; when this request should be considered invalid - optional string memo = 5; // Human-readable description of request for the customer - optional string payment_url = 6; // URL to send Payment and get PaymentACK - optional bytes merchant_data = 7; // Arbitrary data to include in the Payment message - optional bool subtract_fee = 1000; // Allow SubtractableFee - //optional bool replace_by_fee = 1001; // Force RBF true or false (version: 2) + repeated Output outputs = 2; // Where payment should be sent + required uint64 time = 3; // Timestamp; when payment request created + optional uint64 expires = 4; // Timestamp; when this request should be considered invalid + optional string memo = 5; // Human-readable description of request for the customer + optional string payment_url = 6; // URL to send Payment and get PaymentACK + optional bytes merchant_data = 7; // Arbitrary data to include in the Payment message + optional uint64 subtractable_fee = 1000; // How many Satoshis can be subtracted from the requested amount and instead applied towards the fee + optional uint64 fee_per_kb = 1001; // Minimum transaction fee that must be included with the transaction in order for it to be accepted with zero confirmations. + optional bool replace_by_fee = 1002; // Indicates the sender can enable the Replace By Fee flag for this transaction and the receiver will still consider it accepted with zero confirmations. Otherwise, RBF transactions will not be accepted by the receiver until they are confirmed. } message PaymentRequest { optional uint32 payment_details_version = 1 [default = 1]; -- cgit v1.2.3 From 05740a7dbea46623d82e12c992527b6e6ab7a9e9 Mon Sep 17 00:00:00 2001 From: Marshall Long Date: Fri, 11 Mar 2016 15:01:25 -0500 Subject: Format Comment Format comment to fit style of previous comments --- bip-0075/paymentrequest.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bip-0075') diff --git a/bip-0075/paymentrequest.proto b/bip-0075/paymentrequest.proto index d1c9e4f..1c9cc8e 100644 --- a/bip-0075/paymentrequest.proto +++ b/bip-0075/paymentrequest.proto @@ -45,7 +45,7 @@ message Payment { } message PaymentACK { required Payment payment = 1; // Payment message that triggered this ACK - optional string memo = 2; // human-readable message for customer + optional string memo = 2; // Human-readable message for customer } // BIP-IR Extensions -- cgit v1.2.3