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 NameDecimal ValueHexBinaryDescription
lsfMPTCanTransfer320x2000100000Allows the token to be transferred between accounts
lsfMPTCanTrade160x1000010000Allows the token to be traded on DEX
lsfMPTCanEscrow80x0800001000Allows the token to be placed in escrow
lsfMPTCanLock20x0200000010Allows the token to be locked
lsfMPTRequireAuth40x0400000100Requires issuer authorization for transfers
lsfMPTCanClawback640x4001000000Allows 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:

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:

  1. Verify the transaction flags: Check the actual transaction on the XRPL explorer
  2. Check the MPToken object: Query account_objects with type: 'mptoken' to see the actual flags
  3. Verify flag calculation: Ensure the flags are combined correctly (32 | 16 | 8 = 56)
  4. 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

SolidLayer Logo
LIQUIDITYLAYER

The modular core of CardLayer, LegacyLayer, and beyond — engineered with tRPC, monorepo architecture, and a stack that devs actually enjoy using.

Legal

© 2025 Layer.Company • Part of the LayerVerse

Built with ❤️ for the future