blockchain state management service for Tana.
tana-ledger is the core state layer of the blockchain. it manages user accounts, tracks balances across multiple currencies, validates and stores transactions, produces blocks, and executes smart contracts.
when a transaction arrives, the ledger validates signatures and business rules, applies state changes (balance updates, contract state), and includes the transaction in the next block. during block production, the ledger batches pending transactions, executes any contract logic, computes merkle roots, and persists the finalized block.
transaction submitted
|
v
signature verification
|
v
business rule validation
|
v
state transition applied
|
v
included in block
|
v
block finalized
contracts are TypeScript modules stored in t4 by their SHA256 hash. when a transaction invokes a contract, the ledger fetches the code from t4, executes it in tana-runtime (an isolated V8 sandbox), and applies the resulting state changes.
contracts can read and write to key-value storage, query user balances, and emit events. all contract operations are deterministic to ensure validators reach the same state.
built with TypeScript using Hono for HTTP and Drizzle ORM for PostgreSQL. the ledger maintains tables for users, balances, transactions, blocks, contracts, and validators.
blocks are produced on a schedule or when transactions are pending. the ledger consumes transactions from tana-queue, validates each one, executes contract logic, and assembles the block with proper signatures and merkle proofs.
GET /users - list usersPOST /users - create userGET /balances/:userId - get balancesPOST /transactions - submit transactionGET /blocks - list blocksPOST /contracts/deploy - deploy contractPOST /contracts/:id/invoke - invoke contracttana-ledger coordinates with tana-consensus for block finalization, tana-queue for transaction ingestion, t4 for contract storage, and tana-runtime for contract execution.
blockchain state management service for Tana.
tana-ledger is the core state layer of the blockchain. it manages user accounts, tracks balances across multiple currencies, validates and stores transactions, produces blocks, and executes smart contracts.
when a transaction arrives, the ledger validates signatures and business rules, applies state changes (balance updates, contract state), and includes the transaction in the next block. during block production, the ledger batches pending transactions, executes any contract logic, computes merkle roots, and persists the finalized block.
transaction submitted
|
v
signature verification
|
v
business rule validation
|
v
state transition applied
|
v
included in block
|
v
block finalized
contracts are TypeScript modules stored in t4 by their SHA256 hash. when a transaction invokes a contract, the ledger fetches the code from t4, executes it in tana-runtime (an isolated V8 sandbox), and applies the resulting state changes.
contracts can read and write to key-value storage, query user balances, and emit events. all contract operations are deterministic to ensure validators reach the same state.
built with TypeScript using Hono for HTTP and Drizzle ORM for PostgreSQL. the ledger maintains tables for users, balances, transactions, blocks, contracts, and validators.
blocks are produced on a schedule or when transactions are pending. the ledger consumes transactions from tana-queue, validates each one, executes contract logic, and assembles the block with proper signatures and merkle proofs.
GET /users - list usersPOST /users - create userGET /balances/:userId - get balancesPOST /transactions - submit transactionGET /blocks - list blocksPOST /contracts/deploy - deploy contractPOST /contracts/:id/invoke - invoke contracttana-ledger coordinates with tana-consensus for block finalization, tana-queue for transaction ingestion, t4 for contract storage, and tana-runtime for contract execution.