You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FXRP and calls back into `mintedFAssets` (4) → `MasterAccountController`
87
+
forwards FXRP and dispatches the memo to the user's `PersonalAccount` (5).
88
88
</p>
89
89
90
-
## 1. Instructions on XRPL
90
+
## Instructions on XRPL
91
91
92
92
The Flare Smart Accounts allow XRPL users to perform actions on the Flare chain through instructions on the XRPL.
93
93
This is done through a `Payment` to an XRPL address, designated by the operator, a backend monitoring incoming transactions and interacting with the Flare chain.
94
94
The payment must transfer sufficient funds, as specified by the operator, and must include the proper payment reference (proof-based flow) or memo (direct-minting flow).
95
95
96
96
The payment reference is a `bytes32` value.
97
97
The first byte is reserved for the instruction code.
98
-
The second byte is a wallet identifier;
99
-
this is a number assigned to wallet providers by the Flare Foundation, and should otherwise be `0`.
98
+
The second byte is a wallet identifier.
99
+
This is a number assigned to wallet providers by the Flare Foundation, and should otherwise be `0`.
100
100
The remaining 30 bytes are the parameters for the chosen instruction.
101
101
102
102
In practice, the payment reference should be prepared by a backend, through a web form.
103
103
104
104
The first, instruction code, byte is further subdivided into two half-bytes.
105
-
The first nibble is the instruction type;
106
-
this is either `FXRP`, `Firelight`, or `Upshift` (with corresponding type IDS `0`, `1`, and `2`).
105
+
The first nibble is the instruction type.
106
+
This is either `FXRP`, `Firelight`, or `Upshift` (with corresponding type IDS `0`, `1`, and `2`).
107
107
The second nibble is the instruction command; the available commands are different for each instruction type.
108
108
109
109
For the direct-minting flow, the memo carries a different layout — see the [Custom Instruction guide](/smart-accounts/custom-instruction) for the `PackedUserOperation` format and the `0xFF`/`0xE0`/`0xE1`/`0xE2`/`0xD0`/`0xD1` instruction codes.
@@ -119,9 +119,9 @@ Instructions for interacting with the `FXRP` token.
|`00`|`collateralReservation`| Reserve a `value` of lots of collateral in the agent vault, registered with the `agentVaultId` with the `MasterAccountController` contract. |
123
-
|`01`|`transfer`| Transfer a `value` (in drops) of FXRP to the `recipientAddress`. |
124
-
|`02`|`redeem`| Redeem a `value` of lots of FXRP. |
122
+
|`00`|`collateralReservation`| Reserve a `value` of lots of collateral in the agent vault, registered with the `agentVaultId` with the `MasterAccountController` contract. |
123
+
|`01`|`transfer`| Transfer a `value` (in drops) of FXRP to the `recipientAddress`. |
124
+
|`02`|`redeem`| Redeem a `value` of lots of FXRP. |
125
125
126
126
### Firelight
127
127
@@ -131,10 +131,10 @@ Instructions for interacting with a Firelight-type vault.
|`00`|`collateralReservationAndDeposit`| Reserve a `value` of lots of collateral in the agent vault, registered with the `agentVaultId` with the `MasterAccountController` contract. After successful minting, deposit the FXRP into the Firelight type vault, registered with the `vaultId` with the `MasterAccountController` contract. Equivalent to sending a `collateralReservation` instruction and a Firelight `deposit` instruction. |
135
-
|`01`|`deposit`| Deposit a `value` of FXRP into the Firelight type vault, registered with the `vaultId` with the `MasterAccountController` contract. |
136
-
|`02`|`redeem`| Start the withdrawal process for a `value` of vault shares (in drops) from the Firelight type vault, registered with the `vaultId`, with the `MasterAccountController` contract. |
137
-
|`03`|`claimWithdraw`| Withdraw the `FXRP`, requested in the `value` period, from Firelight type vault, registered with the `vaultId`, with the `MasterAccountController` contract. |
134
+
|`00`|`collateralReservationAndDeposit`| Reserve a `value` of lots of collateral in the agent vault, registered with the `agentVaultId` with the `MasterAccountController` contract. After successful minting, deposit the FXRP into the Firelight type vault, registered with the `vaultId` with the `MasterAccountController` contract. Equivalent to sending a `collateralReservation` instruction and a Firelight `deposit` instruction. |
135
+
|`01`|`deposit`| Deposit a `value` of FXRP into the Firelight type vault, registered with the `vaultId` with the `MasterAccountController` contract. |
136
+
|`02`|`redeem`| Start the withdrawal process for a `value` of vault shares (in drops) from the Firelight type vault, registered with the `vaultId`, with the `MasterAccountController` contract. |
137
+
|`03`|`claimWithdraw`| Withdraw the `FXRP`, requested in the `value` period, from the Firelight type vault, registered with the `vaultId`, with the `MasterAccountController` contract. |
138
138
139
139
### Upshift
140
140
@@ -144,30 +144,30 @@ Instructions for interacting with an Upshift-type vault.
|`00`|`collateralReservationAndDeposit`| Reserve a `value` of lots of collateral in the agent vault, registered with the `agentVaultId` with the `MasterAccountController` contract. After successful minting, deposit the FXRP into the Upshift type vault, registered with the `vaultId`, with the `MasterAccountController` contract. Equivalent to sending a `collateralReservation` instruction and a Upshift `deposit` instruction. |
148
-
|`01`|`deposit`| Deposit a `value` of FXRP into the Upshift type vault, registered with the `vaultId` with the `MasterAccountController` contract. |
149
-
|`02`|`requestRedeem`| Start the withdrawal process for a `value` of vault shares (in drops) from the Upshift type vault, registered with the `vaultId` with the `MasterAccountController` contract. |
150
-
|`03`|`claim`| Withdraw the `FXRP` requested for the `value` date (encoded as `yyyymmdd`) from the Upshift type vault, registered with the `vaultId` with the `MasterAccountController` contract. |
147
+
|`00`|`collateralReservationAndDeposit`| Reserve a `value` of lots of collateral in the agent vault, registered with the `agentVaultId` with the `MasterAccountController` contract. After successful minting, deposit the FXRP into the Upshift type vault, registered with the `vaultId`, with the `MasterAccountController` contract. Equivalent to sending a `collateralReservation` instruction and a Upshift `deposit` instruction. |
148
+
|`01`|`deposit`| Deposit a `value` of FXRP into the Upshift type vault, registered with the `vaultId` with the `MasterAccountController` contract. |
149
+
|`02`|`requestRedeem`| Start the withdrawal process for a `value` of vault shares (in drops) from the Upshift type vault, registered with the `vaultId` with the `MasterAccountController` contract. |
150
+
|`03`|`claim`| Withdraw the `FXRP` requested for the `value` date (encoded as `yyyymmdd`) from the Upshift type vault, registered with the `vaultId` with the `MasterAccountController` contract. |
151
151
152
152
</details>
153
153
154
-
## 2. Dispatch on Flare
154
+
## Dispatch on Flare
155
155
156
156
### Proof-based flow
157
157
158
158
The operator monitors incoming transactions to the specified XRPL address.
159
159
Upon receiving a payment, it requests a [`Payment` attestation](/fdc/attestation-types/payment) from the FDC and submits the proof together with the user's XRPL address to the appropriate facet on the `MasterAccountController`:
160
160
161
161
-[`reserveCollateral`](/smart-accounts/reference/IMasterAccountController#reservecollateral) — for command `00` of any instruction type.
162
-
Takes the payment reference and XRPL transaction id (no FDC proof needed at this stage, the user has only committed to mint).
162
+
Takes the payment reference and XRPL transaction ID (no FDC proof needed at this stage, the user has only committed to mint).
163
163
-[`executeDepositAfterMinting`](/smart-accounts/reference/IMasterAccountController#executedepositafterminting) — second leg of the Firelight/Upshift collateral-reservation-and-deposit instructions, after FAssets minting completes.
164
164
-[`executeInstruction`](/smart-accounts/reference/IMasterAccountController#executeinstruction) — for all other reference-encoded instructions.
165
165
166
166
For the proof-bearing functions, the contract verifies the FDC proof and checks that:
167
167
168
-
- the receiving address matches the one configured for the operator,
168
+
- the receiving address matches one of the registered operator XRPL addresses,
169
169
- the source address matches the XRPL address passed to the function,
170
-
- the XRPL transaction id has not already been used (replay protection via `usedTransactionIds`).
170
+
- the XRPL transaction ID has not already been used (replay protection via `usedTransactionIds`).
171
171
172
172
The contract then resolves the XRPL user's `PersonalAccount` from the address mapping, deploying it via `CREATE2` if it does not yet exist, and dispatches the instruction encoded in the payment reference.
173
173
@@ -176,11 +176,12 @@ The contract then resolves the XRPL user's `PersonalAccount` from the address ma
176
176
When the user mints FXRP directly to their smart account via [FAssets direct minting](/fassets/direct-minting), the FAssets `AssetManager` calls back into [`mintedFAssets`](/smart-accounts/reference/IMasterAccountController#mintedfassets) on `MemoInstructionsFacet`.
177
177
The facet enforces that the caller is the `AssetManager`, resolves (or deploys) the user's `PersonalAccount`, pays an executor fee out of the minted FAssets, forwards the remainder to the personal account, and dispatches any memo instruction (`0xFF`, `0xE0`, `0xE1`, `0xE2`, `0xD0`, `0xD1`).
178
178
179
-
## 3. Actions on Flare
179
+
## Actions on Flare
180
180
181
181
The XRPL user's smart account performs the actions in the instructions.
182
182
This can be any of the instructions listed above, reserving collateral for minting FXRP, transferring FXRP to another address, redeeming FXRP, depositing it into a vault ...
183
-
Furthermore, custom instructions (`0xFF`) can be executed — arbitrary function calls on Flare, signed as an EIP-4337 `PackedUserOperation` and replayed on-chain by the personal account.
183
+
Furthermore, custom instructions (`0xFF`) can be executed — arbitrary function calls on Flare, encoded as an EIP-4337 `PackedUserOperation` carried in the XRPL memo and replayed on-chain by the personal account.
184
+
Authorization comes from the XRPL `Payment` signature itself; the on-chain check only validates the `sender` and `nonce` fields of the `PackedUserOperation`.
184
185
See the [Custom Instruction guide](/smart-accounts/custom-instruction) for the details.
0 commit comments