How to create time-bound transactions
This recipe demonstrates how to create transactions that are only valid within a specific time window using the timeb
operation. Time-bound transactions enhance security and control by restricting when transactions can be included
on-chain.
- JS/TS client
Prerequisites
- Node.js
- FT4 client:
npm install @chromia/ft4
- Postchain client:
npm install postchain-client
Demo script
Key Features
This recipe includes examples for:
- Time window validation - Restricting transaction execution to specific time periods
- Offline transaction building - Creating and signing GTX transactions with temporal constraints
- Enhanced security - Preventing replay attacks and ensuring timely execution
- Transaction composition - Combining transfers with time-bound operations
What timeb
does
The timeb
operation enforces a temporal condition on transaction validity by requiring that transactions be included
in a block only within a specified time window (in epoch milliseconds). This enhances control, security, and
synchronization of blockchain actions.
Learn more
- FT4 client documentation — covers account management and FT4 operations.
- JavaScript/TypeScript client — covers setup, connection, and usage patterns.
- Generic Transaction Protocol (GTX) — understanding GTX transaction structure.