dogecoin/src/qt/paymentrequest.proto
Ross Nicoll 5618d8497a Update payment protocol to match Dogecoin (#1433)
* Revised payment request handling to use genesis block hash instead of network name, enabling
support for more networks that just Bitcoin main and test net.
* Disable payment protocol certificate unit tests; we don't modify this code, and regenerating the test data is likely to be significantly time consuming. Will re-enable once discussion on spec is concluded.
2018-09-19 22:11:47 +01:00

50 lines
2.4 KiB
Protocol Buffer

//
// Simple Dogecoin Payment Protocol messages
// Derived from the Bitcoin Payment Protocol
//
// Use fields 100+ for extensions;
// to avoid conflicts, register extensions via pull-req at:
// https://github.com/dogecoin/dips
//
syntax = "proto2";
package payments;
option java_package = "com.dogecoin.protocols.payments";
option java_outer_classname = "Protos";
// Generalized form of "send payment to this/these dogecoin 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 genesis = 1 [default = "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"]; // Hash of the network genesis block
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
}