Submitting Received Payments to a Wallet
Last updated
Was this helpful?
Last updated
Was this helpful?
Brayden Langley (brayden@projectbabbage.com)
To ensure a seamless process for submitting payments to a wallet, there must be a standardized method by which this process takes place. Wallets that implement this standard will be able to support the direct submission of transactions from applications to a user's wallet along with the associated SPV information as defined by . The required message structure and fields are defined below in the section, and the expected response to provide is defined in the section. Wallets that choose to implement this specification will allow applications that facilitate the exchange of payments to be built in a way that is interoperable, extensible, and SPV compliant.
BRC-50 standardizes payment submission to a wallet, improving the user experience for incoming Bitcoin payments. This enables higher-layer applications to add funds to a user's wallet without needing to maintain their own external balance. By standardizing payment submission, developers can create interoperable, extensible, and SPV compliant applications. This ensures a seamless and secure payment process, benefiting both wallet providers and end-users.
For this specification, we assume that there exists a wallet that facilitates a channel by which communication can occur with an application, such as over HTTP as defined in . Based on this premise, we specify a standard by which payments can be submitted from an application to a wallet which then receives and processes the payment.
We define an extension to the abstract messaging layer as the Payment Submission Message which comprises a JSON object with the following fields:
Several of the same fields as defined in are present in this message. This standard essentially facilitates an implementation of over an abstract, wallet-to-application interface.
protocol
(string, required)
transaction
(object, required)
senderIdentityKey
(string, required)
The recipient will need to know the public identity key of the sender in order to validate the incoming payment. This field's value should be the 33-byte, compressed, hex-encoded secp256k1 public key of the sender
derivationPrefix
(string, required)
This field denotes the payment-wide derivation prefix used by the sender when the keys for the payment UTXOs were derived
note
(string, required)
Human-readable description for the transaction.
amount
(number, optional)
Amount of satoshis associated with the transaction. If provided, it is used to verify that the amount returned from processing the transaction matches the payment amount.
This provides the wallet with enough information to verify and receive payments from an application.
Here is an example of a simple Payment Submission Message:
The Payment Acknowledgment Message is the response that should be returned from the wallet to the calling application with the status of the request, and a reference number for the transaction submitted.
Here is an example response from a successful payment submission:
If an error occurs during submission, an internal error should be thrown which can be caught and handled by the application code.
This field denotes that the JSON object comprises a payment message according to the given protocol (such as 3241645161d8
for ).
The transaction envelope to submit, including key derivation information (the "Outputs Extension" as defined in )
The transaction field is a JSON object that conforms to the , with the Outputs Extension. Only one transaction can be submitted per request.
Wallets can implement this specification by providing access to a submitDirectTransaction
route over a given communications substrate, such as , or .
A specific implementation of this BRC can be seen in the Babbage architecture.