aviary library

Aviary for Dart: the whole Aviary ledger C ABI over dart:ffi, plus shortcuts. In a browser the same import gives the stateless part of the API over the WebAssembly engine: hashing, header hashes, and proof and certificate checks.

Classes

Account Ledger
A generated account: the signing secret, public key and chain address.
AddressBook Networking
The peers a node knows: self signed records saying where each validator is reached and which keys authenticate it. add is the trusted local path; merge is the peer exchange boundary, which verifies every record and never overwrites a known id. Encoded books are canonical, so two nodes that learned the same peers hold byte identical books.
AssuranceProfile Assurance and credentials
The security posture a chain commits to at genesis. Higher tiers only ever tighten the tier below them.
Aviary Ledger
The loaded native library and the stateless entry points. Feature surfaces are extensions on this class; stateful objects are created through it.
BlockFinalized Observability
A block was finalized and applied.
BlockRejected Observability
A block failed consensus or state validation.
Blueprint Chains
A declared mixture of engine, state model and proposer ids plus params. Commit it with AviaryGenesis.commitBlueprint.
Ceremony Custody
A two round threshold signing ceremony over one message and roster.
Chain Chains
An assembled node behind the uniform propose, justify, submit flow.
ChainEvent Observability
One event published by a node's event bus. Switch over the subtypes (BlockFinalized, BlockRejected, TxAdmitted, TxRemoved, UnknownEvent) exhaustively; UnknownEvent keeps a newer engine's event kinds readable.
ChainTree Subchains and trees
A built family of chains driven in process. produce anchors children upward automatically; ChainTreeQueries.proveAccount proves any descendant from the root header.
ChildRecord Subchains and trees
One child's entry in a dynamic registry: what the parent commits about it and what a child proof carries.
CredentialGate Assurance and credentials
A verifier's anonymous membership admission gate. It admits a holder by a zero knowledge proof of an issuer signed credential clearing the policy.
CredentialPolicy Assurance and credentials
A membership policy: issuer key, attribute schema and tier threshold. Build one with AviaryCredentials.makeCredentialPolicy.
ForeignEngine Chains
A consensus engine implemented in Dart and plugged into a mixture by id. The pipeline stays native; Dart supplies the justification policy. Both methods run synchronously inside consensus, must be deterministic, and must not call back into the chain.
KeyStore Custody
A custodial store that seals signing secrets at rest. Create one with AviaryNodes.createKeyStore or AviaryNodes.loadKeyStore.
LightClient Light clients
A light client that follows a header chain with certificates only. Sequential accept, plus the overlap rule in acceptSkipping: a far header is trusted when its own set certifies it and the signers hold more than the trust level of the set already trusted.
NetNode Networking
A validator or observer running BFT consensus over a gossip mesh, with no socket and no clock of its own. Every input returns an Outbound: send each relay to that peer over your transport, arm each timeout for a duration you choose, and feed what arrives back through onGossip and onTimeout. Blocks carry the transactions from setTransactions when this node proposes.
Node Ledger
A running single validator chain node.
NoiseSession Networking
A Noise_XX_25519_ChaChaPoly_SHA256 link for peers that speak Noise, with a post quantum identity proof bound to the handshake hash. The initiator sends handshakeMessage, the responder answers with its own, the initiator returns completeInitiator's result, then each side sends identityProof and checks the other's with verifyIdentityProof. Authentication is post quantum; confidentiality is X25519, so use SecureSession when post quantum confidentiality is required. Always pin peerIdentity against the keys you expect.
PeerMesh Networking
A deterministic in-memory mesh of NetNodes for tests and single process networks: relays go in emission order, timeouts fire only when none pends.
PortableAccount Custody
Key material as returned by the portable account open methods, or a hybrid KEM device key pair from AviaryPortableSeal.hybridKemKeypair.
SealedMempool Assurance and credentials
A mempool of sealed transactions only the block proposer can open.
SecureSession Networking
A confidential, mutually authenticated, post quantum hybrid link between two peers. Create one with AviaryNetwork.initiateSecureSession or AviaryNetwork.acceptSecureSession, exchange the handshake messages, then wrap every frame with encrypt and decrypt. Always check peerIdentity against the peers you expect: the handshake proves the peer holds that key, not that it is the peer you wanted.
ThresholdShare Custody
One participant's share of a threshold account. Persist bytes sealed.
TreeNode Subchains and trees
One chain of a family; children are subchains and must be BFT.
TxAdmitted Observability
A transaction entered the mempool.
TxRemoved Observability
A transaction left the mempool, included in a block or evicted.
UnknownEvent Observability
An event kind this version of the binding does not model. json holds the fields as the engine sent them.

Enums

AviaryStatus Errors and helpers
The stable status codes of the C ABI. Values never change.
ChildStatus Subchains and trees
Whether a parent still anchors a child.
ConsensusStep Networking
The step of a consensus round a timeout belongs to.
RecordOp Records
What a record transaction does: write, hand over to a new owner, or remove.
RegistrarScheme Subchains and trees
The signature scheme of a registrar key: the transaction schemes.
SkipResult Light clients
Outcome of LightClient.acceptSkipping.

Extensions

AccountTools on Account Ledger
Convenience views of an account.
AviaryAssurance on Aviary Assurance and credentials
Assurance postures and the sealed mempool.
AviaryAsync on Aviary Custody
The Argon2 bound custody operations on a worker isolate, so the calling isolate stays responsive. The worker loads the engine the way this instance was loaded: the same explicit path, or the platform default.
AviaryCanonical on Aviary Ledger
Canonical bytes that are identical across every binding.
AviaryChildProofs on Aviary Subchains and trees
Proofs against a dynamic registry, and the anchor a parent takes next.
AviaryCredentials on Aviary Assurance and credentials
Anonymous membership credentials: issuers, policies and gates.
AviaryDynamicSubchains on Aviary Subchains and trees
Subchains version 2: a parent with a dynamic policy registers children in any block and commits its registry as a Merkle tree.
AviaryForeign on Aviary Chains
Foreign components: engines and proposer policies implemented in Dart.
AviaryGenesis on Aviary Ledger
Genesis construction and identity.
AviaryInterop on Aviary Interop
Multi chain address derivation and EVM calldata helpers.
AviaryLightClients on Aviary Light clients
Light clients that follow a header chain with certificates only.
AviaryMixtures on Aviary Chains
Composable chains: mixtures, registry discovery and assembly.
AviaryNetwork on Aviary Networking
Consensus over a network the app owns: nodes that return what to send and what to arm, and the authenticated session that protects each link.
AviaryNodes on Aviary Ledger
Single validator chain nodes and custodial key stores.
AviaryNodeStorage on Aviary Ledger
Rebuilding nodes from durable state.
AviaryNoise on Aviary Networking
Noise XX sessions with a post quantum identity proof, over a transport the app owns.
AviaryPeering on Aviary Networking
Self signed peer records and the address books that collect them.
AviaryPersistence on Aviary Chains
Bringing chains and chain trees back from a snapshot.
AviaryPortableOpen on Aviary Custody
Portable account import: opening a sealed account.
AviaryPortableSeal on Aviary Custody
Portable account export: sealing an account for transport.
AviaryProofs on Aviary Light clients
Light client verification of proofs and certificates.
AviaryQuick on Aviary Ledger
Shortcuts for the common single validator setups.
AviaryRecords on Aviary Records
Record transactions and proofs that need no chain handle.
AviaryScopes on Aviary Errors and helpers
Handles released at the end of a scope, whatever body does.
AviarySubchainOps on Aviary Subchains and trees
Registry operations: the unsigned bodies a registrar then signs.
AviarySubchainOpSigning on Aviary Subchains and trees
Authorising registry operations as a registrar.
AviarySubchainProofs on Aviary Subchains and trees
Subchain anchors and cross chain proofs.
AviarySubchains on Aviary Subchains and trees
Subchains: registering children and binding them to a parent.
AviaryThreshold on Aviary Custody
Threshold accounts: any t of n share holders can sign.
AviaryTrees on Aviary Subchains and trees
Chain trees: a declared family of chains built and driven together.
ChainBlocks on Chain Chains
The propose, justify and submit flow in one call.
ChainObservability on Chain Observability
Events and metrics of an assembled chain: every Chain.submit reports a BlockFinalized or a BlockRejected, and the metrics count them.
ChainPersistence on Chain Chains
Saving a chain and keeping its blocks.
ChainRecords on Chain Records
Application records on a chain assembled with the record state model, and the transaction queue every assembled chain proposes from.
ChainRegistry on Chain Subchains and trees
The parent side of a chain with a dynamic policy: registry operations, records and child proofs.
ChainSubchains on Chain Subchains and trees
The parent side of a chain: anchoring children and proving into them.
ChainTreeQueries on ChainTree Subchains and trees
Read only views and proofs of a chain tree.
ChainTreeRounds on ChainTree Subchains and trees
Driving every chain of a family together.
CredentialGatePseudonymous on CredentialGate Assurance and credentials
The pseudonymous admission flow of a gate.
CredentialPolicyPseudonymous on CredentialPolicy Assurance and credentials
The pseudonymous issuance and presentation flow of a policy.
HexBytes on Uint8List Errors and helpers
Hex rendering and comparison for byte strings such as addresses, hashes and transaction ids. Not constant time; do not compare secrets with it.
HexString on String Errors and helpers
Decoding of hex and text into bytes.
KeyStoreSigning on KeyStore Custody
Signing and inventory on a key store. The sealed secret is used inside the engine and wiped; it never reaches Dart.
LightClientSync on LightClient Light clients
Bisection sync for a light client.
NetNodeObservability on NetNode Observability
Events and metrics of a networked node: a BlockFinalized per committed height, and counters for gossip received, relayed and dropped, timeouts fired and peers banned.
NetNodeQueries on NetNode Networking
Read only views of a networked node's chain and mesh.
NodeEvents on Node Observability
Typed chain events, pulled or pushed.
NodeFunding on Node Ledger
Account creation with genesis funding in one step.
NodeQueries on Node Ledger
Read only views of a node.
NodeSending on Node Ledger
Transfers that pick the nonce and the signature scheme for you.
NodeStorage on Node Ledger
Durable state: the whole chain as one blob, and files around it.
NodeTransfers on Node Ledger
Signed transfers admitted to a node's mempool.
NodeViews on Node Ledger
Decoded views of a node's state.
ThresholdSigning on Aviary Custody
A whole threshold signing ceremony run in one process.
TreeNodeBuilding on TreeNode Subchains and trees
Fluent construction and inspection of chain families.
ValidatorKeyPair on KeyPairBytes Ledger
Turning a validator key pair into the entries the genesis, rotation and tree APIs take.

Functions

extractCommitment(Uint8List membershipCommit) → Uint8List Assurance and credentials
The commitment part of a membership commit blob, for the issuer.

Typedefs

AdmissionChallenge = ({Uint8List nonce, Uint8List wire}) Networking
An admission challenge: keep nonce, send wire to the peer.
ArchiveRange = ({int first, int last}) Chains
The first and last archived block heights of a chain.
Checkpoint = ({Uint8List certificate, Uint8List header, List<ValidatorEntry> validators}) Light clients
A header, its certificate, and the validator set in force at its height.
FinalizedHook = void Function(int chainId, Uint8List block) Subchains and trees
Observes a finalized block on a chain.
GenesisAccountEntry = ({Uint8List address, int balance}) Ledger
A genesis funded account: a 32 byte address and its balance.
KeyPairBytes = ({Uint8List public, Uint8List secret}) Ledger
A key pair as public and secret bytes.
NoiseIdentity = ({KeyPairBytes noiseStatic, KeyPairBytes sig}) Networking
A Noise identity: the X25519 static pair and the hybrid signature pair.
Outbound = ({List<Relay> relays, List<TimeoutRequest> timeouts}) Networking
What a NetNode wants done after an input: relays to send and timers to arm. The duration of a timer is the caller's choice.
PeerRecordInfo = ({String host, int id, Uint8List kemPublic, int port, Uint8List prekey, Uint8List sigPublic}) Networking
A peer record's fields, read back from its encoding.
ProposerPolicy = int Function(int height, int validators) Chains
A proposer policy: the proposer index for height among validators.
RecordEntry = ({Uint8List owner, Uint8List value, int version}) Records
A committed application record: owner, write count and current bytes.
RecordLeaf = ({Uint8List key, Uint8List owner, Uint8List value, int version}) Records
A record read out of a verified state proof, with its key.
RegistrarEntry = ({Uint8List publicKey, RegistrarScheme scheme}) Subchains and trees
A registrar: the scheme and public key allowed to authorise registry operations on a parent with a dynamic policy.
RegistryCounts = ({int authorityEpoch, int open, int records}) Subchains and trees
The sizes of a dynamic registry and its authority epoch, which grows by one each time the registrar set is replaced.
Relay = ({Uint8List message, int to}) Networking
A gossip message to send to one peer.
SecureIdentity = ({KeyPairBytes kem, KeyPairBytes sig}) Networking
A long term peer identity: a hybrid KEM pair to receive handshakes and a hybrid signature pair to authenticate.
ThresholdCommit = ({Uint8List commitment, Uint8List nonces}) Custody
Round one of a threshold signature: keep nonces, share commitment.
TimeoutRequest = ({int round, ConsensusStep step}) Networking
A consensus timer to arm; when it fires, call NetNode.onTimeout.
TreeValidator = ({int power, Uint8List publicKey, Uint8List? secret}) Subchains and trees
A tree validator; secret is null when this process does not hold it.
TxSource = List<Uint8List> Function(int chainId, int timestamp) Subchains and trees
Supplies the encoded transactions a chain includes when it produces.
ValidatorEntry = ({int power, Uint8List publicKey}) Ledger
A validator's BLS public key and voting power.

Exceptions / Errors

AviaryException Errors and helpers
Raised when a native call reports an error.