Architecture
How the Sinai Standard hook system composes compliance features on Token-2022
System Architecture
The Sinai Standard is a four-layer stack: a Dashboard UI, a Compliance Oracle API, an SDK, and on-chain programs.
- Dashboard — Web UI for issuers to create tokens, manage allowlists, configure hooks, and monitor compliance events in real time.
- Oracle — Express server that bridges off-chain KYC providers to on-chain allowlists. Listens to chain events and dispatches webhooks and WebSocket streams. See Compliance Oracle.
- SDK — TypeScript library for building and signing Solana transactions. See SDK Reference.
- On-Chain Programs — Anchor programs deployed on Solana that enforce compliance rules at the protocol level. See Programs.
Hook Composition
The Sinai Standard uses Solana's Token-2022 TransferHook extension to enforce compliance at the protocol level. Every transfer is validated on-chain before it can complete.
Single Hook Mode
When only one compliance feature is needed, the mint's TransferHook extension points directly to that hook program. This is the simplest setup and has the lowest compute cost.
Multi-Hook Mode (Router)
When two or more features are needed, the mint points to the Router Hook, which chains sub-hooks inline in order:
- Allowlist — checks that both source and destination are on the approved list
- Tax — logs the transfer for later tax collection via Permanent Delegate
- Hold Period — verifies the source wallet's lock-up has expired
- Max Balance — ensures destination wallet stays within per-wallet cap
The Router reads each sub-hook's config account directly (raw byte deserialization), rather than using CPI calls. This keeps compute usage within Solana's transaction limits.
Confidential Transfers
The Confidential Transfer extension is a native Token-2022 feature (not a custom Sinai Standard program). It encrypts on-chain balances and transfer amounts using ElGamal encryption. Only the account owner and an optional auditor can decrypt actual values.
Confidential transfers can be combined with TransferHook-based compliance features. A token can have both the TransferHook extension (for allowlist, tax, hold period, max balance) and the ConfidentialTransfer extension enabled simultaneously.
AksumKit Auto-Selection
AksumKit.createToken() automatically selects the right mode:
| Hooks specified | Mode |
|---|---|
| 0 hooks | No TransferHook extension |
| 1 hook | Direct hook program |
| 2+ hooks | Router Hook program |
Data Flow
Transfer Execution
- User calls
transferCheckedon Token-2022 - Token-2022 invokes the TransferHook program (CPI)
- Hook program validates the transfer against its config
- If valid, transfer completes; if invalid, transaction reverts
Tax Collection
Tax is collected in a separate step (not during the transfer):
- During
execute(TransferHook CPI), the tax hook logs the transfer - A separate
collect_taxinstruction uses the Permanent Delegate PDA to burn/transfer the tax amount - This two-step design keeps the transfer CPI within compute limits
Account Structure
Each hook program uses two key PDAs per mint:
| PDA | Purpose |
|---|---|
| Config PDA | Stores hook settings (authority, rates, wallets, etc.) |
| ExtraAccountMetas PDA | Lists additional accounts Token-2022 must pass to the hook during CPI |
The ExtraAccountMetas PDA must be initialized before any transfer_checked call, or the transaction will fail.