For the complete documentation index, see llms.txt. This page is also available as Markdown.

Custom 2FA

Two-factor authentication for transfers using a secondary approval address

Category: Token Types

Summary

Required standards: ["Custom-2FA"]

  • autoDeletionOptions.allowPurgeIfExpired: MUST be true

  • Approval name MUST contain "Custom 2FA"

  • Use time-dependent ownershipTimes in MsgTransferTokens (not forever)

  • Calculate timestamps: current time + expiration duration (milliseconds since epoch)

  • Tokens automatically expire and can be purged after expiration

Instructions

Custom-2FA Configuration

When creating a Custom-2FA collection, follow these requirements:

Required Structure

  1. Standards: MUST include "Custom-2FA"

    • "standards": ["Custom-2FA"]

  2. Approval Requirements:

    • autoDeletionOptions.allowPurgeIfExpired: MUST be true

    • This allows expired tokens to be automatically purged

    • Approval name MUST contain "Custom 2FA"

  3. Time-Dependent Ownership: Use time-dependent ownershipTimes in MsgTransferTokens

    • Calculate timestamps: current time + expiration duration

    • Example: 5 minutes = Date.now() + (5 * 60 * 1000)

Complete Example

2FA-Specific Gotchas

  • MUST set allowPurgeIfExpired: true

  • Use time-dependent ownershipTimes in transfers (not forever)

  • Calculate expiration timestamps correctly (milliseconds since epoch)

  • Tokens automatically expire and can be purged after expiration

Last updated