Skip to main content

Module types

Module types 

Source
Expand description

Core primitive types used throughout arknet.

These types are the on-the-wire and on-chain vocabulary. Layout must stay stable: any breaking change is a protocol hard fork.

§Crypto agility

Signatures, public keys, and KEM keys carry a SignatureScheme / KemScheme / VrfScheme tag in their first byte. At launch only the 0x01 variants (Ed25519, X25519, Ristretto255 VRF, BLS12-381 threshold) are implemented, but the wire format reserves the remaining space so a governance-scheduled post-quantum migration can ship without breaking transaction encoding.

See docs/SECURITY.md §4 (Cryptographic Primitives) and §12 (PQ Migration).

Structs§

Address
20-byte account address. Derived as blake3(pubkey_bytes)[0..20].
AppHash
Application-layer state digest after applying a block’s transactions.
BlockHash
Block hash. Computed over a canonical [BlockHeader] borsh encoding.
ChannelId
Payment channel identifier.
JobId
Inference job identifier. Unique per job.
NodeId
Node identifier — 32-byte hash of the node’s consensus pubkey.
PoolId
Computation pool identifier — hash(model_id || quantization)[0..16].
PubKey
A scheme-tagged public key.
RoleBitmap
Bitmap of active roles on a node. Multiple roles can be enabled simultaneously.
Signature
A scheme-tagged signature.
StateRoot
Merkle root of the state trie. Included in every [BlockHeader].
TeeCapability
On-chain TEE capability record for a compute node.
TxHash
Transaction hash. Distinct newtype from block hashes to prevent cross-type collision attacks — see DOMAIN_TX / DOMAIN_BLOCK.

Enums§

KemScheme
Key-encapsulation-mechanism (KEM) identifier. Used for prompt encryption.
SignatureScheme
Signature scheme identifier. First byte of every encoded Signature / PubKey.
TeePlatform
Trusted Execution Environment platform identifier.
VrfScheme
Verifiable Random Function scheme — used for unpredictable verifier selection.

Constants§

ARK_SUPPLY_CAP
Protocol-level hard cap on ARK supply (1B ARK).
ATOMS_PER_ARK
Atomic units per whole ARK token.
DOMAIN_BLOCK
Domain tag for block (header) hashes. See DOMAIN_TX.
DOMAIN_RECEIPT_ROOT
Domain tag for block-body receipt Merkle roots.
DOMAIN_TX
Domain tag for transaction hashes. Prepended to borsh-encoded bytes before hashing so that hash(tx) != hash(block) even when their borsh happens to collide.
DOMAIN_TX_ROOT
Domain tag for block-body tx Merkle roots.
MAX_TEE_QUOTE_BYTES
Maximum size of a TEE attestation quote (16 KiB). Intel TDX quotes are typically ~5 KB; AMD SEV-SNP reports ~4 KB. This cap prevents abuse while leaving room for certificate chains.

Type Aliases§

Amount
Token amount in atomic units. 1 ARK = ATOMS_PER_ARK ark_atom (9 decimals).
Gas
Gas units consumed by a transaction. Fee markets price in ark_atom/gas.
Hash256
256-bit digest. SHA-256 on-chain, BLAKE3 for fast local hashing.
Height
Block height.
Nonce
Per-account transaction counter. Increments by 1 with each committed tx from the same sender; replay is detected at the state-application layer.
Timestamp
Unix timestamp in milliseconds.