New port numbers
[electrum-nvc.git] / lib / paymentrequest.proto
1 //
2 // Simple Bitcoin Payment Protocol messages
3 //
4 // Use fields 1000+ for extensions;
5 // to avoid conflicts, register extensions via pull-req at
6 // https://github.com/bitcoin/bips/bip-0070/extensions.mediawiki
7 //
8
9 package payments;
10 option java_package = "org.bitcoin.protocols.payments";
11 option java_outer_classname = "Protos";
12
13 // Generalized form of "send payment to this/these bitcoin addresses"
14 message Output {
15         optional uint64 amount = 1 [default = 0]; // amount is integer-number-of-satoshis
16         required bytes script = 2; // usually one of the standard Script forms
17 }
18 message PaymentDetails {
19         optional string network = 1 [default = "main"]; // "main" or "test"
20         repeated Output outputs = 2;        // Where payment should be sent
21         required uint64 time = 3;           // Timestamp; when payment request created
22         optional uint64 expires = 4;        // Timestamp; when this request should be considered invalid
23         optional string memo = 5;           // Human-readable description of request for the customer
24         optional string payment_url = 6;    // URL to send Payment and get PaymentACK
25         optional bytes merchant_data = 7;   // Arbitrary data to include in the Payment message
26 }
27 message PaymentRequest {
28         optional uint32 payment_details_version = 1 [default = 1];
29         optional string pki_type = 2 [default = "none"];  // none / x509+sha256 / x509+sha1
30         optional bytes pki_data = 3;                      // depends on pki_type
31         required bytes serialized_payment_details = 4;    // PaymentDetails
32         optional bytes signature = 5;                     // pki-dependent signature
33 }
34 message X509Certificates {
35         repeated bytes certificate = 1;    // DER-encoded X.509 certificate chain
36 }
37 message Payment {
38         optional bytes merchant_data = 1;  // From PaymentDetails.merchant_data
39         repeated bytes transactions = 2;   // Signed transactions that satisfy PaymentDetails.outputs
40         repeated Output refund_to = 3;     // Where to send refunds, if a refund is necessary
41         optional string memo = 4;          // Human-readable message for the merchant
42 }
43 message PaymentACK {
44         required Payment payment = 1;      // Payment message that triggered this ACK
45         optional string memo = 2;          // human-readable message for customer
46 }