-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This page is up-to-date as of 9/21/2021.
This page contains technical information about the Flare-XRPL Bridge
contract.
Note: The
Bridge
contract currently only supports ERC20 transfers from Flare to the XRPL.
The purpose of the bridge contract is to issue tokens on XRP Ledger in a trustless manner. The bridge contract will lock up the tokens to be issued until they are redeemed by an owner of the corresponding trustless issued currency (trustless IC) on the XRPL. The two primary tasks that this contract performs for clients are (1) to issue trustless issued currency on the XRPL or (2) redeem the tokens on Flare Network. Additionally, clients read from the bridge contract to verify the validity of an XRPL trustless issued currency. Only validated addresses can issue and redeem trustless issued currency.
Note: There is still a state connector feature that needs to be added before the protocol can be used in a production setting.
The bridge contract expects the client to create a new issuing account for each transfer from Flare to the XRP Ledger. A receiving account then receives the trustless issued currency after the following steps are completed:
The client approves an allowance of amount
tokens for the bridge contract to custody. The client then makes a newIssuer
transaction and provides the issuing account address and amount
of tokens to the contract.
On the XRP Ledger, the client creates a trust line from the receiving account to the issuing account with a limit of amount
. The issuing account settings must be configured as follows:
- Disable the No Ripple flag
- Assign a regular key to the issuing account with the address of
ACCOUNT_ONE
- Issue the exact
amount
from the issuing account to the receiver account - Disable the master key pair
Next, the client must validate the issuance by interacting with the state connector. The client calls provePaymentFinality
on the state connector contract and provides the XRPL transaction ID. This step verifies the issuance transaction. Before the issuing account can be validated, the client calls the (TBD) method on the state connector contract to prove the issuing address validity.
Solaris state connector requirements
Call completeIssuance
on on the bridge contract to finalize the issuing address validation process. Anyone can call verifyIssuer
to verify that issuers can no longer issue more tokens.
Call createRedemptionReservation
to pre-register an redemption attempt
Send the tokens back to the issuing account by the amount
you wish you redeem.
Prove that the payment on the XRP Ledger has completed by providing the transaction ID.
Call completeRedemption
to unlock the tokens.
The protocol penalizes bad actors. If an issuing address doesn't follow the procedure for trustless issued currency precisely, they will be penalized by paying a fee to the client that proves misuse before the contract returns the tokens to their original source.