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
|`0xFE`| Custom Instruction | Carry `keccak256(PackedUserOperation)` in the memo; the bytes are delivered off-chain by an executor. See [Custom Instruction](/smart-accounts/custom-instruction). |
161
-
|`0xFF`|Raw Custom Instruction | Carry the full ABI-encoded `PackedUserOperation` inline in the memo. See [Raw Custom Instruction](/smart-accounts/raw-custom-instruction).|
161
+
|`0xFF`|Memo Field Custom Instruction | Carry the full ABI-encoded `PackedUserOperation` inline in the memo. See [Memo Field Custom Instruction](/smart-accounts/memo-field-custom-instruction). |
162
162
|`0xE0`| Skip memo | Mark a target XRPL transaction's memo to be skipped on its next direct mint. |
163
163
|`0xE1`| Fast-forward nonce | Advance the personal account's memo-instruction nonce. |
164
164
|`0xE2`| Replace executor fee | Set a replacement executor fee for a stuck XRPL transaction. |
@@ -197,7 +197,7 @@ It enforces that the caller is the `AssetManager`, resolves (or deploys) the use
197
197
The XRPL user's smart account performs the actions in the instructions.
198
198
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 ...
199
199
Furthermore, custom instructions can be executed - arbitrary function calls on Flare, encoded as an [EIP-4337](https://eips.ethereum.org/EIPS/eip-4337)`PackedUserOperation` and replayed on-chain by the personal account.
200
-
The user operation can be committed to as a 32-byte hash with the bytes delivered to Flare by an off-chain executor (opcode `0xFE`, see the [Custom Instruction guide](/smart-accounts/custom-instruction)), or carried in the XRPL memo in full (opcode `0xFF`, see the [Raw Custom Instruction guide](/smart-accounts/raw-custom-instruction)).
200
+
The user operation can be committed to as a 32-byte hash with the bytes delivered to Flare by an off-chain executor (opcode `0xFE`, see the [Custom Instruction guide](/smart-accounts/custom-instruction)), or carried in the XRPL memo in full (opcode `0xFF`, see the [Memo Field Custom Instruction guide](/smart-accounts/memo-field-custom-instruction)).
201
201
Authorization comes from the XRPL `Payment` signature itself; the on-chain check only validates the `sender` and `nonce` fields of the `PackedUserOperation`.
202
202
The [Custom Instruction Comparison](/smart-accounts/custom-instruction-comparison) covers when to pick each.
Copy file name to clipboardExpand all lines: docs/smart-accounts/3-custom-instruction.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ The **custom instruction** (memo opcode `0xFE`) is the recommended way to drive
26
26
The XRPL memo is a fixed 42 bytes that commits to a `PackedUserOperation` by carrying only its `keccak256` hash, and an off-chain executor delivers the actual user operation bytes to the FAssets `AssetManager` on Flare.
27
27
This keeps the XRPL footprint constant regardless of how complex the call batch is.
28
28
29
-
For the simpler single-actor variant that ships the entire `PackedUserOperation` inline in the XRPL memo, see the [Raw Custom Instruction](/smart-accounts/raw-custom-instruction); the [comparison guide](/smart-accounts/custom-instruction-comparison) covers when to pick which.
29
+
For the simpler single-actor variant that ships the entire `PackedUserOperation` inline in the XRPL memo, see the [Memo Field Custom Instruction](/smart-accounts/memo-field-custom-instruction); the [comparison guide](/smart-accounts/custom-instruction-comparison) covers when to pick which.
30
30
31
31
:::warning No destination tags
32
32
XRPL transactions targeting smart accounts must not use a destination tag.
@@ -110,7 +110,7 @@ The custom instruction memo is a constant 42 bytes:
110
110
|`10-41`|`userOpHash`|`keccak256(abi.encode(userOp))` - the 32-byte commitment |
111
111
112
112
The memo length is independent of the call batch: a single small call and a 50-call batch both fit in the same 42 bytes, because the user-operation bytes the executor delivers off-chain never touch the XRPL ledger.
113
-
This is the main practical advantage over the [Raw Custom Instruction](/smart-accounts/raw-custom-instruction), whose memo carries the entire ABI-encoded `PackedUserOperation` and is therefore subject to the XRPL's 1024-byte memo cap.
113
+
This is the main practical advantage over the [Memo Field Custom Instruction](/smart-accounts/memo-field-custom-instruction), whose memo carries the entire ABI-encoded `PackedUserOperation` and is therefore subject to the XRPL's 1024-byte memo cap.
114
114
115
115
The off-chain delivery also makes the call payload **private on XRPL**.
116
116
Only the 32-byte commitment is published; the inner `target`, `value`, and `data` of each call only become visible when the executor submits the user operation to Flare.
@@ -211,6 +211,6 @@ The minted FXRP remains in the personal account and the user can recover by eith
211
211
## Next steps
212
212
213
213
- Walk through a Viem implementation in the [Custom Instruction TypeScript guide](/smart-accounts/guides/typescript-viem/custom-instruction-ts).
214
-
- See the simpler single-actor variant in the [Raw Custom Instruction](/smart-accounts/raw-custom-instruction).
214
+
- See the simpler single-actor variant in the [Memo Field Custom Instruction](/smart-accounts/memo-field-custom-instruction).
215
215
- Compare the two flows in the [Custom Instruction Comparison](/smart-accounts/custom-instruction-comparison).
216
216
- Dig into `IMasterAccountController` in the [reference](/smart-accounts/reference/IMasterAccountController).
The **raw custom instruction** (memo opcode `0xFF`) is a single-actor variant of the [Custom Instruction](/smart-accounts/custom-instruction): instead of committing to a `keccak256(userOp)` hash and relying on an executor to deliver the bytes, the XRPL `Payment` memo carries the entire ABI-encoded `PackedUserOperation` inline immediately after a 10-byte header.
19
+
The **memo field custom instruction** (memo opcode `0xFF`) is a single-actor variant of the [Custom Instruction](/smart-accounts/custom-instruction): instead of committing to a `keccak256(userOp)` hash and relying on an executor to deliver the bytes, the XRPL `Payment` memo carries the entire ABI-encoded `PackedUserOperation` inline immediately after a 10-byte header.
20
20
The user signs the XRPL `Payment`, ships the payload on XRPL, and the smart account replays the user operation on Flare with no further off-chain data.
21
21
22
22
The recommended path is the [Custom Instruction](/smart-accounts/custom-instruction) - it lifts the XRPL memo size cap and is what the rest of the smart-accounts tooling defaults to.
23
-
Reach for the raw variant when you do not want to operate or coordinate with an executor and your call batch fits inside the XRPL memo cap.
23
+
Reach for the memo field variant when you do not want to operate or coordinate with an executor and your call batch fits inside the XRPL memo cap.
24
24
The [comparison guide](/smart-accounts/custom-instruction-comparison) breaks down when each is appropriate.
25
25
26
26
This page covers only what differs from the [Custom Instruction](/smart-accounts/custom-instruction).
@@ -37,7 +37,7 @@ The XRPL memo carries a 10-byte instruction header followed by the ABI-encoded `
|`0`|`instructionId`|`0xFF` - raw custom instruction|
40
+
|`0`|`instructionId`|`0xFF` - memo field custom instruction |
41
41
|`1`|`walletId`| One-byte wallet identifier assigned by Flare; `0` if not registered |
42
42
|`2-9`|`executorFeeUBA`| Executor fee in the FAsset's smallest unit, big-endian `uint64`|
43
43
|`10+`|`userOpData`|`abi.encode(PackedUserOperation)` - the call payload the controller decodes |
@@ -70,7 +70,7 @@ The freshly minted FXRP remains in the personal account, and the user can either
70
70
71
71
## Next Steps
72
72
73
-
- Walk through a Viem implementation in the [Raw Custom Instruction TypeScript guide](/smart-accounts/guides/typescript-viem/raw-custom-instruction-ts).
73
+
- Walk through a Viem implementation in the [Memo Field Custom Instruction TypeScript guide](/smart-accounts/guides/typescript-viem/memo-field-custom-instruction-ts).
74
74
- Read the [Custom Instruction](/smart-accounts/custom-instruction) for the recommended hash-commitment variant.
75
75
- Compare the two flows in the [Custom Instruction Comparison](/smart-accounts/custom-instruction-comparison).
76
76
- Dig into `IMasterAccountController` in the [reference](/smart-accounts/reference/IMasterAccountController).
The XRPL memo carries only `keccak256(userOp)` in fixed 42 bytes; an off-chain executor delivers the ABI-encoded custom instruction (`userOp`) via `executeDirectMintingWithData`.
-[**Memo Field Custom Instruction**](/smart-accounts/memo-field-custom-instruction) - opcode `0xFF`.
24
24
The XRPL memo contains the ABI-encoded `PackedUserOperation` in full.
25
25
26
26
Both flows are validated on-chain against the same `(sender, nonce)` rules and emit the same [`UserOperationExecuted`](/smart-accounts/reference/IMasterAccountController#useroperationexecuted) event.
@@ -31,7 +31,7 @@ The `0xFE` memo is a constant 42 bytes regardless of the user's operation size,
| XRPL memo size | Constant 42 bytes regardless of batch size | Grows linearly with batch and argument sizes; capped at ~1024 bytes |
@@ -41,7 +41,7 @@ The `0xFE` memo is a constant 42 bytes regardless of the user's operation size,
41
41
| AssetManager entry point |`executeDirectMintingWithData(proof, data)`|`executeDirectMinting(proof)`|
42
42
|`msg.value` on the inner call | Whatever the executor attaches; forwarded to `executeUserOp`| Whatever the relayer attaches; forwarded to `executeUserOp`|
43
43
| Confirmation | Same event lives in the executor's transaction receipt | Watch for `UserOperationExecuted` after the `MasterAccountController` dispatches the memo |
44
-
| Replay protection | Same as raw - plus the on-chain hash check pins `_data` to the memo's commitment| Personal account nonce + `usedTransactionIds`|
44
+
| Replay protection | Same as memo field - plus the on-chain hash check pins `_data` to the memo's commitment | Personal account nonce + `usedTransactionIds`|
45
45
| Failure modes specific to the flow |`CustomInstructionHashMismatch` if `keccak256(_data)` differs from the commitment | None beyond shared ones |
46
46
47
47
**Use the custom instruction (`0xFE`) when**
@@ -52,15 +52,15 @@ The `0xFE` memo is a constant 42 bytes regardless of the user's operation size,
52
52
- You already operate an executor that observes XRPL payments and submits Flare transactions - the custom instruction lets that executor batch deliveries or rate-limit submissions without splitting user operations into multiple XRPL payments.
53
53
- You need fee predictability: the XRPL memo is always 42 bytes, so the XRPL fee is constant regardless of how complex the user operation is.
54
54
55
-
**Use the raw custom instruction (`0xFF`) when**
55
+
**Use the memo field custom instruction (`0xFF`) when**
56
56
57
57
- The call batch fits comfortably inside the XRPL ~1024-byte memo (most single-call user operations and small batches do).
58
58
- You do not need to hide the call payload from public XRPL observers.
59
59
- You do not want to operate or coordinate with an executor service.
60
60
- You want the simplest possible on-chain integration: a single FAssets transaction `executeDirectMinting(proof)` carries the whole thing.
61
61
62
62
In short, the custom instruction trades a small amount of off-chain coordination (and one extra on-chain proof-binding check) for a fixed memo size and private payloads.
63
-
The raw custom instruction trades memo bandwidth for end-to-end simplicity.
63
+
The memo field custom instruction trades memo bandwidth for end-to-end simplicity.
64
64
65
65
## Similarities
66
66
@@ -78,13 +78,13 @@ The two flows share more than they differ:
78
78
The example helpers in [`flare-viem-starter`](https://github.com/flare-foundation/flare-viem-starter) mirror the two flows directly:
79
79
80
80
- Custom Instruction: [`sendHashInstruction`](/smart-accounts/guides/typescript-viem/custom-instruction-ts#step-1-send-the-hash-memo-on-xrpl) + [`executeDirectMintingWithData`](/smart-accounts/guides/typescript-viem/custom-instruction-ts#step-2-executor-submits-the-proof-and-the-bytes) + [`findUserOperationExecuted`](/smart-accounts/guides/typescript-viem/custom-instruction-ts#step-3-confirm-execution-from-the-receipt) - three calls, one per actor.
81
-
-Raw Custom Instruction: [`sendMemoFieldInstruction`](/smart-accounts/guides/typescript-viem/raw-custom-instruction-ts#sending-the-user-operation) - one call, waits for the event.
81
+
-Memo Field Custom Instruction: [`sendMemoFieldInstruction`](/smart-accounts/guides/typescript-viem/memo-field-custom-instruction-ts#sending-the-user-operation) - one call, waits for the event.
82
82
83
83
A practical decision rule when integrating:
84
84
85
85
1. Default to the custom instruction (`0xFE`).
86
86
It fits every call batch and keeps the call payload off the public XRPL ledger.
87
-
2. Reach for the raw custom instruction (`0xFF`) only when you do not want to operate or coordinate with an executor service, and you can guarantee `abi.encode(userOp)` stays well under ~900 bytes (leaving room for the 10-byte header and XRPL framing).
87
+
2. Reach for the memo field custom instruction (`0xFF`) only when you do not want to operate or coordinate with an executor service, and you can guarantee `abi.encode(userOp)` stays well under ~900 bytes (leaving room for the 10-byte header and XRPL framing).
Copy file name to clipboardExpand all lines: docs/smart-accounts/guides/typescript-viem/02-custom-instruction.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,7 +166,7 @@ export type Call = {
166
166
};
167
167
```
168
168
169
-
Because the `0xFE` memo is independent of batch size, the script issues a single batch for all three calls - the same three that overflow the XRPL memo cap in the [raw flow](/smart-accounts/guides/typescript-viem/raw-custom-instruction-ts):
169
+
Because the `0xFE` memo is independent of batch size, the script issues a single batch for all three calls - the same three that overflow the XRPL memo cap in the [memo field flow](/smart-accounts/guides/typescript-viem/memo-field-custom-instruction-ts):
170
170
171
171
```typescript
172
172
const calls:Call[] = [
@@ -246,7 +246,7 @@ export function encodeHashInstructionMemo({
246
246
```
247
247
248
248
The `encodePackedUserOpData` helper ABI-encodes a `PackedUserOperation` whose only meaningful fields are `sender`, `nonce`, and `callData` - the others are not validated on-chain.
249
-
The `buildInstructionHeader` helper packs the opcode (`0xFE` for the custom instruction, `0xFF` for the raw variant), the one-byte `walletId`, and the 8-byte big-endian `executorFeeUBA` into the 10-byte instruction header.
249
+
The `buildInstructionHeader` helper packs the opcode (`0xFE` for the custom instruction, `0xFF` for the memo field variant), the one-byte `walletId`, and the 8-byte big-endian `executorFeeUBA` into the 10-byte instruction header.
250
250
251
251
## Computing the XRPL Payment Amount
252
252
@@ -635,7 +635,7 @@ To continue your Flare Smart Accounts development journey, you can:
635
635
636
636
- Get the smart account state using the [State Lookup guide](/smart-accounts/guides/typescript-viem/state-lookup-ts).
637
637
- Read the [Custom Instruction overview](/smart-accounts/custom-instruction) for the on-chain details.
638
-
- Explore the [Raw Custom Instruction TypeScript guide](/smart-accounts/guides/typescript-viem/raw-custom-instruction-ts).
638
+
- Explore the [Memo Field Custom Instruction TypeScript guide](/smart-accounts/guides/typescript-viem/memo-field-custom-instruction-ts).
639
639
- Compare the two flows in the [Custom Instruction Comparison](/smart-accounts/custom-instruction-comparison).
640
640
- Dig into the `IMasterAccountController`[reference](/smart-accounts/reference/IMasterAccountController).
0 commit comments