Back to Documentation
MPToken Flags Documentation
Flag Values
The MPToken flags are bitwise values that control various capabilities of Master Provenance Tokens on the XRPL. Each flag is a power of 2, allowing multiple flags to be combined using bitwise OR (|).
Current Flag Values Used
| Flag Name | Decimal Value | Hex | Binary | Description |
|---|---|---|---|---|
lsfMPTCanTransfer | 32 | 0x20 | 00100000 | Allows the token to be transferred between accounts |
lsfMPTCanTrade | 16 | 0x10 | 00010000 | Allows the token to be traded on DEX |
lsfMPTCanEscrow | 8 | 0x08 | 00001000 | Allows the token to be placed in escrow |
lsfMPTCanLock | 2 | 0x02 | 00000010 | Allows the token to be locked |
lsfMPTRequireAuth | 4 | 0x04 | 00000100 | Requires issuer authorization for transfers |
lsfMPTCanClawback | 64 | 0x40 | 01000000 | Allows the issuer to reclaim tokens |
Combined Flags
When multiple flags are combined, they are added using bitwise OR:
Flags: 32 | 16 | 8 // CanTransfer, CanTrade, CanEscrow
// Result: 56 (binary: 00111000)
Verification
To verify flags are set correctly:
const flags = 32 | 16 | 8; // = 56
// Check individual flags
(flags & 32) !== 0 // CanTransfer: true
(flags & 16) !== 0 // CanTrade: true
(flags & 8) !== 0 // CanEscrow: true
(flags & 64) !== 0 // CanClawback: false (should be false)
Official Documentation
The official XRPL documentation for MPToken flags can be found at:
- XRPL Reference: https://xrpl.org/docs/references/xrpl-api/transaction-formats/mptokenissuancecreate
- Transaction Types: https://xrpl.org/docs/references/xrpl-api/transaction-formats/
Flag Constants
According to official XRPL documentation, these flags are defined as:
// Official XRPL MPTokenIssuance flags (from XRPL docs)
const lsfMPTCanTransfer = 0x00000020; // 32
const lsfMPTCanTrade = 0x00000010; // 16
const lsfMPTCanEscrow = 0x00000008; // 8
const lsfMPTCanLock = 0x00000002; // 2
const lsfMPTRequireAuth = 0x00000004; // 4
const lsfMPTCanClawback = 0x00000040; // 64
Current Implementation
TapMint Flow
In src/server/api/root.ts, the tapMintMPT mutation uses:
Flags: 32 | 16 | 8, // CanTransfer, CanTrade, CanEscrow
This results in a combined flag value of 56 (binary: 00111000).
Playground Mint Flow
In src/server/api/root.ts, the mintMPT function calculates flags dynamically:
let flags = 0;
flags |= 32; // lsfMPTCanTransfer - always enabled
flags |= 16; // lsfMPTCanTrade - always enabled
if (allowEscrow) {
flags |= 8; // lsfMPTCanEscrow (8, not 64)
}
Troubleshooting
If escrow appears disabled on the ledger viewer:
- Verify the transaction flags: Check the actual transaction on the XRPL explorer
- Check the MPToken object: Query
account_objectswithtype: 'mptoken'to see the actual flags - Verify flag calculation: Ensure the flags are combined correctly (32 | 16 | 8 = 56)
- Verify CanClawback is NOT set: Check that (flags & 64) === 0 (should be false)
Query MPToken Flags
const client = new Client('wss://s.devnet.rippletest.net:51233');
await client.connect();
const response = await client.request({
command: 'account_objects',
account: 'YOUR_ACCOUNT',
ledger_index: 'validated',
type: 'mptoken'
});
// Check the Flags field in the response
console.log('MPToken Flags:', response.result.account_objects[0].Flags);
References
- XRPL Documentation: https://xrpl.org/docs/
- MPTokenIssuanceCreate: https://xrpl.org/docs/references/xrpl-api/transaction-formats/mptokenissuancecreate
- Account Objects: https://xrpl.org/docs/references/xrpl-api/requests/account_objects
