Skip to main content

Documentation Index

Fetch the complete documentation index at: https://grat.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Stellar requires that transactions from a single account be submitted with sequential sequence numbers. If an application tries to submit multiple transactions from the same account at the same time, it will hit “bad sequence” errors. Channel accounts are Grat’s solution to this problem.

The Channel Pool

Grat maintains a pool of dedicated “channel accounts” that it uses exclusively for paying transaction fees. When a sponsorship request arrives, Grat pulls an available channel from the pool, uses it to sign the fee-bump envelope, and then releases it back to the pool once the transaction is submitted.

Automatic Management

The relay automatically manages the entire lifecycle of these accounts:
  • Derivation: Channels are derived from a single seed phrase using standard BIP39 paths.
  • Locking: Redis ensures that no two threads or instances ever try to use the same channel account at the same time.
  • Round-Robin: Grat uses a round-robin strategy to distribute load across all available channels.
  • Auto-Release: If a transaction takes too long to submit, the relay automatically releases the channel lock to prevent system bottlenecks.
By using a pool of channels, Grat can process many transactions in parallel, allowing your application to scale to thousands of users without hitting network bottlenecks. View on GitHub