π₯οΈ Operating System Reference
β Target Reference | Standard Library
An OS defines the runtime environment: storage, accounts, syscalls, and
I/O conventions. The compiler's job is runtime binding β link against
OS-specific modules (os.<os>.*). Everything in this document is about
the OS, not the instruction set. For VMs, see vm.md.
The Model: Neurons, Signals, Tokens
The entire blockchain design space reduces to three primitives:
- Neuron β an actor. Accounts, UTXOs, objects, cells, notes, resources, contracts, wallets β all are neurons. A neuron has identity, can hold state, and can send signals.
- Signal β a transaction. A bundle of directed weighted edges (cyberlinks) from neuron to neuron. The weight is the amount. The signal is the act of communication itself.
- Token β a neuron viewed as an asset. Neurons ARE tokens. A fungible token (ETH, SOL, CKByte) is a fungible neuron β many identical interchangeable units, like shares of a company. A uniq (unique asset, smart contract, unique UTXO) is a non-fungible neuron β unique identity, one-of-one, like a person.
The model: neurons send signals carrying tokens to other neurons. Neurons are the tokens. Everything else β accounts, UTXOs, objects, cells β is how a specific OS represents neurons internally. The compiler's job is to map neuron/signal operations down to those internals.
The Three-Tier Namespace
std.* Standard library Pure computation (all 20 VMs, all 25 OSes)
os.* OS standard Universal runtime contract (all OSes)
os.<os>.* OS extensions OS-native API (one specific OS)
Programs can mix all three tiers. std.* for math and crypto. os.*
for portable neuron identity, signals, state, and events. os.<os>.*
when OS-native features are needed (PDAs, object ownership, L1/L2
messaging, CPI, etc.).
os.* β The Gold Standard
Available on all blockchain and traditional OSes. The compiler lowers each
function to the OS-native mechanism based on --target. Programs using
only std.* + os.* are portable across all OSes that support the
required operations. If an OS doesn't support a concept (e.g.,
os.neuron.id() on UTXO chains, os.signal.send() on journal targets),
the compiler emits a clear error.
os.neuron β Identity and Authorization
| Function | Signature | Description |
|---|---|---|
id() |
() -> Digest |
Identity of the current neuron (caller) |
verify(expected) |
(expected: Digest) -> Bool |
Check caller matches expected |
auth(credential) |
(credential: Digest) -> () |
Assert authorized; crash if not |
A neuron is identified by a Digest β the universal identity container.
A 20-byte EVM address, a 32-byte Solana pubkey, and a 251-bit Starknet
felt all fit in a Digest.
neuron.auth(credential) is an assertion β it succeeds silently or crashes
the VM. On account chains, it checks the caller address. On UTXO chains,
it checks a hash preimage (divine the secret, hash it, assert the digest
matches). Same source code, different mechanism. This is the only auth
mechanism that works on every OS with identity.
Supported: Account, Stateless, Object, Process.
id()/verify() compile error: UTXO (no caller β use auth()), Journal (no identity).
auth() compile error: Journal (no identity).
Per-OS Lowering
| OS family | OSes | neuron.id() lowers to |
|---|---|---|
| Account (EVM) | Ethereum | msg.sender (padded to Digest) |
| Account (Cairo) | Starknet | get_caller_address |
| Account (WASM) | Near, Cosmos | predecessor_account_id / info.sender |
| Account (other) | Ton, Polkadot, Miden | OS-native caller address |
| Stateless | Solana | account.key(0) (first signer) |
| Object | Sui, Aptos | tx_context::sender |
| Process | Linux, macOS, WASI, Android | getuid() (padded to Digest) |
| UTXO | Neptune, Nockchain, Nervos, Aleo, Aztec | Compile error β no caller; use neuron.auth() |
| Journal | Boundless, Succinct, OpenVM Network | Compile error β no identity |
| OS family | OSes | neuron.auth(cred) lowers to |
|---|---|---|
| Account (EVM) | Ethereum | assert(msg.sender == cred) |
| Account (Cairo) | Starknet | assert(get_caller_address() == cred) |
| Account (WASM) | Near, Cosmos | assert(predecessor == cred) / assert(sender == cred) |
| Account (other) | Ton, Polkadot, Miden | assert(caller == cred) |
| Stateless | Solana | assert(is_signer(find_account(cred))) |
| Object | Sui, Aptos | assert(tx.sender() == cred) |
| UTXO | Neptune, Nockchain, Nervos, Aleo, Aztec | divine() + hash() + assert_eq(hash, cred) |
| Process | Linux, macOS, WASI, Android | assert(getuid() == cred) |
| Journal | Boundless, Succinct, OpenVM Network | Compile error β no identity |
os.signal β Communication Between Neurons
| Function | Signature | Description |
|---|---|---|
send(from, to, amount) |
(from: Digest, to: Digest, amount: Field) -> () |
Emit a weighted directed edge from one neuron to another |
balance(neuron) |
(neuron: Digest) -> Field |
Query neuron balance |
send(from, to, amount) is the universal primitive: a directed weighted
edge β a signal β from one neuron to another. In most cases from is the
current neuron, but delegation/proxy/allowance patterns pass a different
from (e.g., ERC-20 transferFrom, spending another neuron's UTXO with
their authorization).
Supported: Account, Stateless, Object, UTXO. Compile error: Journal (no value), Process (no native value).
Per-OS Lowering
| OS family | OSes | signal.send(from, to, amount) lowers to |
|---|---|---|
| Account (EVM) | Ethereum | CALL(to, amount, "") (self) / transferFrom(from, to, amount) (delegated) |
| Account (Cairo) | Starknet | transfer(from, to, amount) syscall |
| Account (WASM) | Near, Cosmos | Promise::transfer / BankMsg::Send |
| Account (other) | Ton, Polkadot | OS-native transfer message |
| Stateless | Solana | system_program::transfer(from, to, amount) |
| Object | Sui, Aptos | coin::split + transfer::public_transfer |
| UTXO | Neptune, Nockchain, Nervos, Aleo, Aztec | Emit output UTXO/note (from = consumed input, to = recipient) |
| Process | Linux, macOS, WASI, Browser, Android | Compile error β no native value |
| Journal | Boundless, Succinct, OpenVM Network | Compile error β no native value |
os.state β Persistent State
| Function | Signature | Description |
|---|---|---|
read(key) |
(key: Field) -> Field |
Read one field element at key |
write(key, value) |
(key: Field, value: Field) -> () |
Write one field element at key |
read_n(key, width) |
(key: Field, width: U32) -> [Field; N] |
Read N elements starting at key |
write_n(key, values) |
(key: Field, values: [Field; N]) -> () |
Write N elements starting at key |
exists(key) |
(key: Field) -> Bool |
Check if key has been written |
Supported: Account, Stateless, Object, UTXO, Process. Compile error: Journal (no persistent state).
On UTXO chains, the compiler auto-generates the divine-and-authenticate
pattern: divine the value, hash it, Merkle-prove against the state root.
The developer writes state.read(key) β the proof machinery is invisible.
Per-OS Lowering
| OS family | OSes | state.read(key) lowers to |
|---|---|---|
| Account | Ethereum, Starknet, Near, Cosmos, Ton, Polkadot, Miden | SLOAD(key) / storage read syscall |
| Stateless | Solana | account.data(derived_index, offset) |
| Object | Sui, Aptos | dynamic_field.borrow(context_object, key) |
| UTXO | Neptune, Nockchain, Nervos, Aleo, Aztec | divine() + merkle_authenticate(key, root) |
| Process | Linux, macOS, WASI, Browser, Android | File / environment read |
| Journal | Boundless, Succinct, OpenVM Network | Compile error β no persistent state |
os.token β Token Operations (PLUMB)
Tokens are neurons viewed as assets. os.signal.send() moves native
currency between neurons. os.token provides the full PLUMB lifecycle β
Pay, Lock, Update, Mint, Burn β plus read queries,
for both coins and uniqs.
See TSP-1 β Coin and TSP-2 β Card for leaf formats, config model, and circuit constraints. See the Gold Standard for the PLUMB framework design rationale and skill library.
PLUMB Operations β Coins
| Function | Signature | Description |
|---|---|---|
pay(to, amount) |
(to: Digest, amount: Field) -> () |
Transfer value to recipient |
lock(until) |
(until: Field) -> () |
Time-lock caller's account |
update(new_config) |
(new_config: Digest) -> () |
Update token config (admin only) |
mint(to, amount) |
(to: Digest, amount: Field) -> () |
Create new tokens for recipient |
burn(amount) |
(amount: Field) -> () |
Destroy tokens from caller |
Read Queries β Coins
| Function | Signature | Description |
|---|---|---|
balance(account) |
(account: Digest) -> Field |
Query token balance |
supply() |
() -> Field |
Query total supply |
PLUMB Operations β Uniqs
| Function | Signature | Description |
|---|---|---|
pay(asset_id, to) |
(asset_id: Digest, to: Digest) -> () |
Transfer ownership of unique asset |
lock(asset_id, until) |
(asset_id: Digest, until: Field) -> () |
Time-lock asset |
update(new_config) |
(new_config: Digest) -> () |
Update token config (admin only) |
mint(asset_id, to, metadata) |
(asset_id: Digest, to: Digest, metadata: Digest) -> () |
Create unique asset |
burn(asset_id) |
(asset_id: Digest) -> () |
Destroy unique asset |
Read Queries β Uniqs
| Function | Signature | Description |
|---|---|---|
owner(asset_id) |
(asset_id: Digest) -> Digest |
Query current owner |
metadata(asset_id) |
(asset_id: Digest) -> Digest |
Query metadata commitment |
exists(asset_id) |
(asset_id: Digest) -> Bool |
Check if asset exists in tree |
All 5 PLUMB operations require authorization β the compiler enforces this
via the OS-native mechanism. pay and burn require account auth (plus
config-level dual auth if configured). mint requires config-level mint
authority. update requires admin authority. lock extends the time-lock
on an account or asset (extend only β cannot shorten).
Supported: Account, Stateless, Object, UTXO. Compile error: Journal (no persistent state), Process (no native token concept).
Per-OS Lowering β Coins
| OS family | OSes | token.pay(to, amount) lowers to |
|---|---|---|
| Account (EVM) | Ethereum | transfer(to, amount) (ERC-20) |
| Account (Cairo) | Starknet | transfer(to, amount) |
| Account (WASM) | Near, Cosmos | ft_transfer / SendMsg |
| Stateless | Solana | spl_token::transfer(from, to, amount) |
| Object | Sui, Aptos | coin::split + transfer::public_transfer |
| UTXO | Neptune | Consume sender leaf, emit two leaves: sender (balance - amount), receiver (balance + amount) (TSP-1 Pay op) |
| UTXO | Nervos, Aleo, Aztec | Consume cell/record/note, emit with updated balances |
| Process | Linux, macOS, WASI, Browser, Android | Compile error β no native token |
| Journal | Boundless, Succinct, OpenVM Network | Compile error β no persistent state |
| OS family | OSes | token.mint(to, amount) lowers to |
|---|---|---|
| Account (EVM) | Ethereum | _mint(to, amount) (ERC-20 internal) |
| Account (Cairo) | Starknet | mint(to, amount) syscall |
| Account (WASM) | Near, Cosmos | ft_transfer / MintMsg |
| Stateless | Solana | spl_token::mint_to(mint, to, amount) |
| Object | Sui, Aptos | coin::mint(treasury, amount) + transfer |
| UTXO | Neptune | Emit output UTXO with amount (TSP-1 Mint op) |
| UTXO | Nervos, Aleo, Aztec | Emit output cell/record/note with amount |
| Process | Linux, macOS, WASI, Browser, Android | Compile error β no native token |
| Journal | Boundless, Succinct, OpenVM Network | Compile error β no persistent state |
| OS family | OSes | token.balance(account) lowers to |
|---|---|---|
| Account (EVM) | Ethereum | balanceOf(account) (ERC-20) |
| Account (Cairo) | Starknet | balance_of(account) |
| Account (WASM) | Near, Cosmos | ft_balance_of / QueryBalanceRequest |
| Stateless | Solana | spl_token::get_account(account).amount |
| Object | Sui, Aptos | coin::balance(account) |
| UTXO | Neptune | Sum UTXO values for account (Merkle-authenticated) |
| UTXO | Nervos, Aleo, Aztec | Sum cell/record/note values |
| Process | Linux, macOS, WASI, Browser, Android | Compile error β no native token |
| Journal | Boundless, Succinct, OpenVM Network | Compile error β no persistent state |
Per-OS Lowering β Uniqs
| OS family | OSes | token.pay(asset_id, to) lowers to |
|---|---|---|
| Account (EVM) | Ethereum | transferFrom(owner, to, tokenId) (ERC-721) |
| Account (Cairo) | Starknet | transfer_from(owner, to, token_id) |
| Account (WASM) | Near, Cosmos | uniq_transfer / SendUniq |
| Stateless | Solana | mpl_token::transfer(asset, to) (Metaplex) |
| Object | Sui, Aptos | transfer::public_transfer(object, to) |
| UTXO | Neptune | Consume owner's asset leaf, emit new leaf with owner_id = to (TSP-2 Pay op) |
| UTXO | Nervos, Aleo, Aztec | Consume cell/record/note, emit with new owner |
| Process | Linux, macOS, WASI, Browser, Android | Compile error β no native token |
| Journal | Boundless, Succinct, OpenVM Network | Compile error β no persistent state |
| OS family | OSes | token.owner(asset_id) lowers to |
|---|---|---|
| Account (EVM) | Ethereum | ownerOf(tokenId) (ERC-721) |
| Account (Cairo) | Starknet | owner_of(token_id) |
| Account (WASM) | Near, Cosmos | uniq_token / OwnerOf query |
| Stateless | Solana | mpl_token::get_metadata(asset).owner |
| Object | Sui, Aptos | object::owner(object_id) |
| UTXO | Neptune | Merkle inclusion proof for asset leaf, read owner_id |
| UTXO | Nervos, Aleo, Aztec | Merkle inclusion proof, read owner field |
| Process | Linux, macOS, WASI, Browser, Android | Compile error β no native token |
| Journal | Boundless, Succinct, OpenVM Network | Compile error β no persistent state |
os.time β Clock
| Function | Signature | Description |
|---|---|---|
now() |
() -> Field |
Current timestamp |
step() |
() -> Field |
Current step number (block height, slot, epoch, etc.) |
Supported: All OS families.
On blockchain OSes, now() returns block/slot timestamp. On traditional
OSes, it returns wall-clock time. On journal targets, it returns the
timestamp provided as public input. step() returns the discrete
progression counter β block height on most chains, slot on Solana,
tick count on process OSes.
Per-OS Lowering
| OS family | OSes | time.now() lowers to |
|---|---|---|
| Account (EVM) | Ethereum | block.timestamp |
| Account (Cairo) | Starknet | get_block_timestamp |
| Account (WASM) | Near, Cosmos | env.block.time |
| Account (other) | Ton, Polkadot | OS-native block time |
| Stateless | Solana | Clock::unix_timestamp |
| Object | Sui, Aptos | tx_context::epoch_timestamp_ms |
| UTXO | Neptune, Nockchain | kernel.authenticate_timestamp(root) |
| Process | Linux, macOS, Android | clock_gettime(CLOCK_REALTIME) |
| WASI/Browser | WASI, Browser | wall_clock.now() / Date.now() |
| Journal | Boundless, Succinct, OpenVM Network | Timestamp from public input |
| OS family | OSes | time.step() lowers to |
|---|---|---|
| Account (EVM) | Ethereum | block.number |
| Account (Cairo) | Starknet | get_block_number |
| Account (WASM) | Near, Cosmos | env.block.height |
| Account (other) | Ton, Polkadot | OS-native block number |
| Stateless | Solana | Clock::slot |
| Object | Sui, Aptos | tx_context::epoch() |
| UTXO | Neptune, Nockchain | kernel.authenticate_block_height(root) |
| Process | Linux, macOS, Android | Monotonic tick counter |
| WASI/Browser | WASI, Browser | monotonic_clock.now() / performance.now() |
| Journal | Boundless, Succinct, OpenVM Network | Step number from public input |
os.event β Events
reveal and seal are the event mechanism. They compile to the TIR ops
Reveal and Seal, which each backend lowers to its native event
mechanism (LOG on EVM, sol_log on Solana, announcements on Neptune).
No additional os.event module needed β events use language-level
reveal/seal statements directly.
OS Registry
Designed for 25 OSes across provable, blockchain, and traditional runtimes (today: Neptune):
| OS | VM | Runtime binding | Account / process model | Interop | Details |
|---|---|---|---|---|---|
| Provable | |||||
| Neptune | TRITON | os.neptune.* |
UTXO | -- | neptune.md |
| Polygon Miden | MIDEN | os.miden.* |
Account | -- | miden.md |
| Nockchain | NOCK | os.nockchain.* |
UTXO (Notes) | -- | nockchain.md |
| Starknet | CAIRO | os.starknet.* |
Account | Ethereum L2 | starknet.md |
| Boundless | RISCZERO | os.boundless.* |
-- | Ethereum verification | boundless.md |
| Succinct | SP1 | os.succinct.* |
-- | Ethereum verification | succinct.md |
| OpenVM Network | OPENVM | os.openvm.* |
-- | -- | openvm-network.md |
| Aleo | AVM | os.aleo.* |
Record (UTXO) | -- | aleo.md |
| Aztec | AZTEC | os.aztec.* |
Note (UTXO) + public | Ethereum L2 | aztec.md |
| Blockchain | |||||
| Ethereum | EVM | os.ethereum.* |
Account | -- | ethereum.md |
| Solana | SBPF | os.solana.* |
Account (stateless programs) | -- | solana.md |
| Near Protocol | WASM | os.near.* |
Account (1 contract each) | -- | near.md |
| Cosmos (100+ chains) | WASM | os.cosmwasm.* |
Account | IBC | cosmwasm.md |
| Arbitrum | WASM + EVM | os.arbitrum.* |
Account (EVM-compatible) | Ethereum L2 | arbitrum.md |
| Internet Computer | WASM | os.icp.* |
Canister | -- | icp.md |
| Sui | MOVEVM | os.sui.* |
Object-centric | -- | sui.md |
| Aptos | MOVEVM | os.aptos.* |
Account (resources) | -- | aptos.md |
| Ton | TVM | os.ton.* |
Account (cells) | -- | ton.md |
| Nervos CKB | CKB | os.nervos.* |
Cell (UTXO-like) | -- | nervos.md |
| Polkadot | POLKAVM | os.polkadot.* |
Account | XCM | polkadot.md |
| Traditional | |||||
| Linux | X86-64 / ARM64 / RISCV | os.linux.* |
Process | POSIX syscalls | linux.md |
| macOS | ARM64 / X86-64 | os.macos.* |
Process | POSIX + Mach | macos.md |
| Android | ARM64 / X86-64 | os.android.* |
Process (sandboxed) | NDK, JNI | android.md |
| WASI | WASM | os.wasi.* |
Process (capability) | WASI preview 2 | wasi.md |
| Browser | WASM | os.browser.* |
Event loop | JavaScript, Web APIs | browser.md |
Key observations:
- One VM, many OSes. WASM powers 6+ OSes (Near, Cosmos, ICP, Arbitrum,
WASI, Browser). x86-64 and ARM64 power Linux, macOS, Android. MOVEVM
powers Sui and Aptos. Same bytecode output, different
os.<os>.*bindings. - RISC-V lowering is shared across SP1, OPENVM, RISCZERO, JOLT, CKB,
POLKAVM, and native RISCV β 7 targets from one
RiscVLowering. - Arbitrum supports both WASM (Stylus) and EVM.
OS TOML [runtime] Fields
The compiler selects lowering strategy from three fields in os/*.toml:
| Field | Values | Effect on os.* |
|---|---|---|
account_model |
account, stateless, object, utxo, journal, process |
Selects neuron/signal lowering |
storage_model |
key-value, account-data, object-store, merkle-authenticated, filesystem, none |
Selects state lowering |
transaction_model |
signed, proof-based, none |
Selects neuron.auth/signal lowering |
Extension Tracking
Each OS provides its own os.<os>.* modules with runtime-specific
bindings: storage, accounts, syscalls, transaction models. Importing any
os.<os>.* module binds the program to that OS β the compiler rejects
cross-OS imports.
Implemented
| Module | Description | OS doc |
|---|---|---|
os.neptune.kernel |
Transaction kernel MAST authentication | neptune.md |
os.neptune.utxo |
UTXO structure authentication | neptune.md |
os.neptune.xfield |
Extension field arithmetic intrinsics | neptune.md |
os.neptune.proof |
Recursive STARK verification | neptune.md |
os.neptune.recursive |
Low-level recursive proof primitives | neptune.md |
Designed (not yet implemented)
| OS | Modules | OS doc |
|---|---|---|
| Ethereum | os.ethereum. storage, account, transfer, call, event, block, tx, precompile |
ethereum.md |
| Solana | os.solana. account, pda, cpi, transfer, system, log, clock, rent |
solana.md |
| Starknet | os.starknet. storage, account, call, event, messaging, crypto |
starknet.md |
| Sui | os.sui. object, transfer, dynamic_field, tx, coin, event |
sui.md |
See each OS doc for the full API reference.
Per-OS On-Chain Registry (Atlas)
Each OS can maintain an on-chain package registry called Atlas β a TSP-2 Card collection where packages are Cards. See Atlas Reference for the complete specification: registry model, three-tier resolution, CLI commands, wire protocol, and security model.
OS Configuration
Each OS that supports Atlas declares it in target.toml:
[atlas]
collection_id = "0x..." # TSP-2 collection address on this OS
mint_authority = "governance" # Who can publish new packages
resolution = "on-chain" # "on-chain", "http", or "local-only"
cache_dir = "~/.trident/cache"
See Atlas CLI Commands for trident atlas
and trident deploy usage.
π See Also
- Target Reference β OS model, integration tracking, how-to-add checklists
- VM Reference β VM registry, lowering paths, tier/type/builtin tables, cost models
- Standard Library β
std.*modules - Language Reference β Types, operators, builtins, grammar, sponge, Merkle, extension field, proof composition
- Per-OS docs:
os/<os>/README.md
Trident v0.5 β Write once. Run anywhere.