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
Copy file name to clipboardExpand all lines: docs/smart-accounts/1-overview.mdx
+15-14Lines changed: 15 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ Flare Smart Accounts support two complementary flows for turning an XRPL `Paymen
33
33
### Proof-based flow (payment reference)
34
34
35
35
1. The XRPL user sends a `Payment` transaction to the operator's XRPL address with a 32-byte instruction encoded as the **payment reference**.
36
-
2. The operator requests a [`Payment` attestation](/fdc/attestation-types/payment) from the [Flare Data Connector](/fdc/overview) and submits it to the `MasterAccountController`.
36
+
2. The operator requests a [`Payment` attestation](/fdc/attestation-types/payment) from the [Flare Data Connector (FDC)](/fdc/overview) and submits it to the `MasterAccountController`.
37
37
3. The XRPL user's `PersonalAccount` performs the action encoded in the reference.
38
38
39
39
<ThemedImage
@@ -51,8 +51,8 @@ Flare Smart Accounts support two complementary flows for turning an XRPL `Paymen
51
51
52
52
### Direct-minting (memo) flow
53
53
54
-
1. The XRPL user sends a `Payment` to an FAssets agent's XRPL address that mints FXRP directly to the smart account, with the [memo field](/smart-accounts/custom-instruction) carrying the instruction.
55
-
2. The FAssets `AssetManager` mints FXRP to the `MasterAccountController` and calls back into [`mintedFAssets`](/smart-accounts/reference/IMasterAccountController#mintedfassets) on `MemoInstructionsFacet`.
54
+
1. The XRPL user sends a `Payment` to an FAssets agent's XRPL address that mints FXRP directly to the smart account, with the [memo field](/smart-accounts/custom-instruction-comparison) carrying the instruction.
55
+
2. The FAssets `AssetManager` mints FXRP to the `MasterAccountController` and calls back into [`handleMintedFAssets`](/smart-accounts/reference/IMasterAccountController#handlemintedfassets) on `MemoInstructionsFacet`.
56
56
3. The facet routes the FAssets to the user's `PersonalAccount`, optionally pays an executor fee, and dispatches any memo instruction (`0xFF` execute UserOp, `0xE0` ignore memo, `0xE1` set nonce, `0xE2` replace fee, `0xD0`/`0xD1` set/remove executor).
FXRP and calls back into `mintedFAssets` (4) → `MasterAccountController`
86
+
FXRP and calls back into `handleMintedFAssets` (4) → `MasterAccountController`
87
87
forwards FXRP and dispatches the memo to the user's `PersonalAccount` (5).
88
88
</p>
89
89
@@ -106,7 +106,7 @@ The first nibble is the instruction type.
106
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
-
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.
109
+
For the direct-minting flow, the memo carries a different layout — see the [Full Custom Instruction guide](/smart-accounts/full-custom-instruction) for the `PackedUserOperation` format, the [Hash Custom Instruction guide](/smart-accounts/hash-custom-instruction) for the 0xFE variant, or the [comparison](/smart-accounts/custom-instruction-comparison) of `0xFF`/`0xFE` and the executor-management codes `0xE0`/`0xE1`/`0xE2`/`0xD0`/`0xD1`.
110
110
111
111
<details>
112
112
<summary>Table of instruction IDs and corresponding actions.</summary>
@@ -173,16 +173,17 @@ The contract then resolves the XRPL user's `PersonalAccount` from the address ma
173
173
174
174
### Direct-minting flow
175
175
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
-
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`).
176
+
When the user mints FXRP directly to their smart account via [FAssets direct minting](/fassets/direct-minting), the FAssets `AssetManager` calls back into [`handleMintedFAssets`](/smart-accounts/reference/IMasterAccountController#handlemintedfassets) on `MemoInstructionsFacet`.
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`, `0xFE`, `0xE0`, `0xE1`, `0xE2`, `0xD0`, `0xD1`).
178
178
179
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, encoded as an EIP-4337 `PackedUserOperation` carried in the XRPL memo and replayed on-chain by the personal account.
183
+
Furthermore, custom instructions can be executed — arbitrary function calls on Flare, encoded as an EIP-4337 `PackedUserOperation` and replayed on-chain by the personal account.
184
+
The user operation can be carried in the XRPL memo in full (opcode `0xFF`, see the [Full Custom Instruction guide](/smart-accounts/full-custom-instruction)), or committed to as a 32-byte hash with the bytes delivered to Flare by an off-chain executor (opcode `0xFE`, see the [Hash Custom Instruction guide](/smart-accounts/hash-custom-instruction)).
184
185
Authorization comes from the XRPL `Payment` signature itself; the on-chain check only validates the `sender` and `nonce` fields of the `PackedUserOperation`.
185
-
See the [Custom Instruction guide](/smart-accounts/custom-instruction) for the details.
186
+
The [Custom Instruction Comparison](/smart-accounts/custom-instruction-comparison) covers when to pick each.
|`0`|`instructionId`|`0xFF` — full custom instruction |
41
+
|`1`|`walletId`| One-byte wallet identifier assigned by Flare; `0` if not registered |
42
+
|`2-9`|`executorFeeUBA`| Executor fee in the FAsset's smallest unit, big-endian `uint64`|
43
+
|`10+`|`userOpData`|`abi.encode(PackedUserOperation)` — the call payload the facet decodes |
44
44
45
45
The total memo length is `10 + len(abi.encode(userOp))` bytes.
46
-
The XRPL caps each memo at roughly `1024` bytes, so large or repetitive call batches may need to be split across multiple XRPL payments.
46
+
The XRPL caps each memo at `1024` bytes, so large or repetitive call batches must be split across multiple XRPL payments — each of which pays its own FAssets minting fee and executor fee — and a single call whose ABI-encoded calldata alone exceeds the budget cannot be expressed at all without deploying a shim contract on Flare to compress it.
47
+
The [Hash Custom Instruction](/smart-accounts/hash-custom-instruction) was added specifically to lift this cap: its memo is a constant 42 bytes regardless of batch size.
0 commit comments