Hybrid Payment Mode for DPP
Abstract
The core DPP (Direct Payment Protocol) has been defined by BRC-27, but it is non-functional without at least one mode to facilitate payments. We extend the core DPP by introducing the Hybrid Payment Mode. This flexible and open-ended payment mode facilitates payments with BSV as well as various token types, such as loyalty points and stable coins. The Hybrid Payment Mode allows a payment host to stipulate payment from a set of funding types created with AND and OR connections, enabling a wallet to choose the most suitable option based on user resources.
Motivation
The motivation behind the Hybrid Payment Mode is to provide a flexible and versatile payment mode within the Direct Payment Protocol. This mode aims to accommodate various payment scenarios and combinations by enabling payment hosts to define multiple payment options with different funding types. The Hybrid Payment Mode can address the growing demand for handling diverse payment scenarios in the evolving digital currency landscape.
Specification
HybridPaymentMode (BRFCID: ef63d9775da5
) will be described together with related Payment and PaymentACK objects. It is the first defined payment mode capable of fulfilling numerous requirements due to its flexible nature.
HybridPaymentMode Structure
The Hybrid Payment Mode contains a dictionary of various options (options are OR relation, so they are alternative sets of outputs, and the customer or their wallet will pick one).
Options (In PaymentTerms)
Every option contains a set of transactions (AND relation, if the customer chooses the option, they must provide all the required funds to satisfy the transaction). The interface for transaction object and transaction’s internal objects are described below.
Transaction
A transaction object is a set that contains 3 parts:
Outputs: A way of specifying a Bitcoin transaction output, including the value and script for various token standards.
Inputs: A way of declaring which specific inputs should be used (useful for multisig, payment_channels, etc).
Policies: A way of requesting specific TX policies like fees, SPV, nLockTime, etc.
Outputs
List of outputs – payment destinations.
Native output
This is a regular native BSV output which specifies the amount and recipient in bitcoin script form (usually p2pkh).
STAS output
This output is used for getting tokens using the STAS protocol. It is required to define tokenId (with symbol), amount, and recipient.
TokenXYZ
The structure for this object is specific to each particular token standard. It may be based on the BRFC reference if the token standard hasn't published a name yet, or otherwise based upon a particular token's name.
Inputs
A list of input objects contains data needed to specify the required inputs which should be used.
Policies
An object containing some policy information like fees or SPV envelope.
Mode (In Payment)
This object defines fields required by HybridPaymentMode. In this mode, important data are the chosen payment option (paymentId) and a list of transactions which fulfill this option:
Mode (In PaymentACK)
This object defines fields required by HybridPaymentMode:
Example
An example of a Hybrid Payment Mode implementation is provided below:
Payment
PaymentACK
The BRC-54 Hybrid Payment Mode specification provides a comprehensive structure for enabling diverse payment scenarios within the Direct Payment Protocol. By carefully following the structures, processes, and context described in this document, a developer can create a compatible implementation within the BRC-54 specification.
Last updated