1
0
mirror of https://github.com/bitcoin/bips.git synced 2026-03-23 16:05:41 +00:00

- Make message public key sharing mandatory for messages that are encrypted and where both keys are known. For EncryptedInvoiceRequest, only the sender_public_key is required

- Add nonce to EncryptedPaymentRequest, EncryptedPayment and EncryptedPaymentACK
- Update ECDH instruction to allow for the current message instead of an InvoiceRequest to contain the nonce
- Updated paymentrequest.proto with BIP definition changes
This commit is contained in:
Matt David
2016-02-22 12:04:54 -08:00
parent 6a08dae8c4
commit 10e6f46569
2 changed files with 92 additions and 41 deletions

View File

@@ -46,11 +46,6 @@ message PaymentACK {
}
// BIP-IR Extensions
message EncryptedInvoiceRequest {
required bytes encrypted_invoice_request = 1; // AES-256-CBC Encrypted InvoiceRequest as defined in InvoiceRequest Spec
required bytes sender_public_key = 2; // Sender's EC Public Key
required bytes invoice_request_hash = 3; // SHA256 Hash of Non-Encrypted, Serialized InvoiceRequest (used for authentication)
}
message InvoiceRequest {
required bytes sender_public_key = 1; // Sender's EC Public Key
@@ -63,22 +58,42 @@ message InvoiceRequest {
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
optional 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
}
message EncryptedPaymentRequest {
required bytes encrypted_payment_request = 1; // AES-256-CBC Encrypted PaymentRequest as defined in InvoiceRequest Spec
required bytes receiver_public_key = 2; // Receiver's EC Public Key
required bytes ephemeral_public_key = 3; // Public Key of ECDH-derived keypair
required bytes payment_request_hash = 4; // SHA256 Hash of Non-Encrypted, Serialized PaymentRequest (used for authentication)
required bool requires_payment_message = 5 [default = false]; // Requires Payment/PaymentACK message exchange
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 Payment as defined in InvoiceRequest Spec
required bytes payment_request_hash = 2; // SHA256 Hash of Non-Encrypted, Serialized PaymentRequest returned in the transaction's EncryptedPaymentRequest message
required bytes signature = 3; // Signature over EncryptedPayment with original Sender's EC Private Key
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 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 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 Payment as defined in InvoiceRequest Spec
required bytes payment_request_hash = 2; // SHA256 Hash of Non-Encrypted, Serialized PaymentRequest returned in the transaction's EncryptedPaymentRequest message
required bytes signature = 3; // Signature over EncryptedPaymentACK with the Receiver's EC Private key.
}
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.
}