TBD54566975 / tbdex

56 stars 25 forks source link

Introduce `OrderInstructions` Message #335

Closed mistermoe closed 3 weeks ago

mistermoe commented 1 month ago

Context

Currently, a Quote contains both payin and payout instructions which Alice can use to facilitate a payin or receive a payout. This introduces non-deterministic outcomes because Alice can actually facilitate a pay in prior to sending an Order message.

Proposal

We should consider moving payment instructions from the Quote message to a new message kind, OrderInstructions, which is sent by the PFI after Alice submits an Order message.

Message Contents

Data

field data type required description
payin PaymentInstruction Y the amount of payin currency that the PFI will receive
payout PaymentInstruction Y the amount of payout currency that Alice will receive

PaymentInstruction

field data type required description
link String N Link to allow Alice to pay PFI, or be paid by the PFI
instruction String N Instruction on how Alice can pay PFI, or how Alice can be paid by the PFI

Example

{
  "metadata": {...},
  "data": {
    "payin": {
      "link": "some_payment_link",
      "instruction": "plain_text"
    },
    "payout": {
      "link": "some_payment_link",
      "instruction": "plain_text"
    }
  }
}