0085 XLS-85d: Token Escrow — Token-Enabled Escrows #248
Replies: 3 comments 8 replies
-
@dangell7 well done Denis, this is a highly requested feature - as well as Ed and Richard ❤️ Quick question, the transfer fee you mention and carry over to the escrow is the issuer transfer fee we know from IOUs and not a new fee, correct? |
Beta Was this translation helpful? Give feedback.
-
Like it ! Would prefer to add more programmability/functionality to the Escrow protocol though by enabling direct services such as "Escrow to AMM" and "Escrow to Listed Accounts". The former would be useful for things like programmed token release/distribution to AMM and timed airdrop/incentives/rewards to AMM LP'ers and the latter for scheduled push payments to individuals/multiple accounts to accommodate things like Direct Debit and Loan/Mortgage repayments etc. |
Beta Was this translation helpful? Give feedback.
-
I don't know much about MPToken, but could this support MPToken as well? |
Beta Was this translation helpful? Give feedback.
-
XLS-85d Token Escrow — Token-Enabled Escrows
Token-Enabled Escrows
The proposed amendment to the XRPL protocol,
TokenEscrow
, introduces changes to the ledger objects, transactions, and RPC methods to enableEscrows
to use Trustline balances.1. Problem Statement
The XRPL supports several types of on-ledger negotiable instruments, namely:
Escrows
andChecks
. While each of these instruments is implemented as a first-class on-ledger object, only theCheck
object supports the use of Trustline balances.Escrows
support only the native asset XRP. This limitation is a barrier to wider-spread use of these instruments for reasons including:2. Constraints
The amendment has the following constraints:
Escrows
to use Trustline balances.3. Implementation
An Instrument can only be created over a Trustline balance if both parties (source and destination):
The destination may not have a Trustline yet. This is not a barrier to creating the Instrument provided that a hypothetical Trustline created at the same time the Instrument is created, from the destination account to the Issuer, for the relevant currency, would meet the above requirements.
3.1. One-Way Account Flag for Issuers
Introduce a new one-way account flag named
lsfAllowTokenLocking
that issuers can set to opt-in to the Token-Enabled Locking feature. This flag ensures that only issuers who have explicitly enabled this feature can have their issued tokens used within Escrows, enhancing security and compliance.3.2. New Field:
sfTransferRate
The
TransferRate
field on anEscrow
ledger object indicates the currentTransferRate
at which the funds are escrowed.TransferRate
is better than the current transfer rate for the asset, settlement occurs at the better rate, and vice versa.3.3. New Field:
sfIssuerNode
Add an optional
sfIssuerNode
field to theEscrow
ledger object, similar to the existingsfOwnerNode
andsfDestinationNode
fields. This field specifies the Issuer node associated with the issued tokens used in the Escrow, enabling better tracking and management of token flows within Escrows.3.4. Updated
sfAmount
LogicThe
sfAmount
field is already the correct type to support Tokens. The only restrictions on it being a Token are within the ledger's logic. Update the logic to allowsfAmount
to represent any valid issued token without unnecessary restrictions, thereby facilitating broader use cases for Escrows involving different tokens.3.5. Escrow Creation and Settlement Logic
Creation:
Settlement:
Cancellation:
3.6. Impact on Trustlines
Issuers can freeze their side of a Trustline with either of the parties involved in the Instrument, preventing the Escrow from being resolved or canceled until the freeze is lifted.
Escrows
in any state are a barrier to account deletion. Trustlines associated with active Escrows prevent the deletion of accounts holding those Trustlines.Issuers can create an
Escrow
using their own token. The settlement of the Instrument follows the same guidelines as above.Note: If an Issuer escrows their own token, the
sfIssuerNode
field will be left empty and the Escrow Object will only be added to the Issuers directory once.4. Final Documentation & SDK Changes
The proposed changes would include modifications to the following ledger objects:
RippleState
Escrow
The proposed changes would include modifications to the following transactions:
EscrowCreate
The proposed changes would include modifications to the following RPC methods:
account_lines
account_objects
4.1. Ledger Object Changes
4.1.2.
Escrow
Ledger ObjectThe following fields would be modified or added to the
Escrow
Ledger Object:Amount
TransferRate
sfIssuerNode
4.2. Transaction Changes
4.2.1.
EscrowCreate
TransactionThe following fields would be modified on the
EscrowCreate
transaction:Amount
4.3. RPC Method Changes
4.3.2.
account_objects
MethodEach
Escrow
Object has the following fields updated on theaccount_objects
method:Amount
TransferRate
sfIssuerNode
Beta Was this translation helpful? Give feedback.
All reactions