aviary_dart 1.1.1
aviary_dart: ^1.1.1 copied to clipboard
Embeddable ledger engine for Dart: signed app records with proofs, instant BFT finality, transfers, light clients, P2P consensus, key custody and Ethereum, Bitcoin, Solana interop.
Changelog #
1.1.1 #
The bundled macOS, Linux and web engines are rebuilt from Aviary 1.1.1 on CipherBird 1.6.0.
- Snapshot restore verifies every archived commit certificate.
restoreChain,restoreChainTreeandchainSnapshotErrorused to check only that an archived certificate below the tip named its block, so a snapshot whose certificate signature or signer bitmap had been altered restored andarchivedCertificatethen returned the forged certificate. Each certificate is now verified (signer list, quorum power, aggregate BLS signature) under the validator set in force at its height, following validator rotations. When that set is no longer in the snapshot (it was announced in a block pruned from the archive and has since rotated out), the certificate must equal the last commit embedded in the next archived header. A snapshot that fails either check is refused. - A snapshot of a chain other than BFT that carries an archive is refused.
1.1.0 #
The bundled macOS and Linux engines are rebuilt with the functions below.
Web
package:aviary_dart/aviary.dartcompiles to JavaScript and WebAssembly. In a browser it exports the stateless part of the API over a WebAssembly build of the same C++ core, so results are byte identical to every other binding:hash,txid,headerHash,verifyStateProof,verifyTxInclusion,verifyCommit,blockHeader,headerSubchainRoot,encodedHeaderHash,verifyChildProof,decodeChildRecordandverifySubchainProofV2, withAviaryException,ChildRecordand the hex helpers. Other platforms are unchanged.- The engine ships as
native/web/aviary.mjsandaviary.wasm(1.1 MB), declared as Flutter assets, so a Flutter web app serves it with no setup. A page can point elsewhere withself.aviaryEngineUrl, or a build with theAVIARY_WEB_ENGINEdefine. - A browser cannot load WebAssembly synchronously: await
Aviary.ensureInitialized()once beforeAviary.instance,loadoropen, which throw anAviaryExceptionuntil then. 64 bit arguments are exact up to 2 to the 53, the largest integer a browser number holds. ChildRecorddecoding reads its 64 bit fields as two 32 bit halves, the same values on every platform.
Engine
- The engine reports the CipherBird revision it was built from:
cryptoBackend()now ends with(CipherBird <revision>). - The bundled macOS, Linux and web engines are built against CipherBird
1.6.0. Its C ABI is now named
cipherbird_*, and it carries the P-256 and libcrypto thread safety fixes and the 1.6.0 input hardening. sealAccountPassphraseandsealShare, and theirAsyncforms, throw anAviaryExceptionfor an Argon2id memory cost that is not a multiple of 1024 bytes, and opening refuses an envelope that records one. Argon2id counts memory in whole KiB, so such a cost was silently rounded down before. Zero still selects the sensitive preset.
Packaging
- The build hook now bundles the macOS engine as a code asset too, so a
dart build clibundle carrieslibaviary_cinbundle/liband runs with no package config and noAVIARY_DYLIB. On macOS the hook leaves the engine to theaviaryandaviary_liteplugins when the app depends on one of them, so an app never carries two.
Subchains version 2
- A parent with a dynamic policy (
encodeDynamicSubchainPolicy, registrars asRegistrarEntry) registers children in any block:opRegister,opClose,opSetRegistrars,opDigest,signOp,addOpApprovalandChain.proposeSubchain. - A Merkle registry with one
ChildRecordper child:Chain.childRecord,Chain.childProof,Chain.registryCounts,verifyChildProof,pendingAnchor,Chain.subchainHopV2,encodeSubchainProofV2,verifySubchainProofV2andencodedHeaderHash.
Persistence
Chain.snapshot,restoreChainandchainSnapshotError; an opt in block archive (Chain.enableArchive,archiveRange,archivedBlock,archivedCertificate,pruneArchive);Chain.tip.ChainTree.snapshotandrestoreChainTree.
1.0.0 #
First stable release of the Dart API for the Aviary ledger, built on the CipherBird 1.3.0 crypto engine. The public API follows semantic versioning from this release on.
Ledger
Node: accounts (Ed25519 and hybrid Ed25519 + ML-DSA-65), signed transfers, a mempool, BFT finality with BLS aggregated certificates, state and transaction inclusion proofs.nextNoncecounts transfers still pending, andsend,sendToandsendFromStoreuse it, so several transfers per account can be queued before a block.- Persistence:
snapshot,restoreNode(resumes from the carried ledger state, orreplay: trueto audit every block),saveTo,restoreNodeFromandblockAt.
Chains
- Composable chains: blueprints that mix a consensus engine (
bft,pos,vrf-pos,pow), a state model (account,utxo,record) and a proposer policy, committed into the genesis hash. Foreign engines and proposers written in Dart. - Application records:
assembleRecordChainbuilds a chain that stores owned, versioned objects instead of balances.Chain.write,record,proveRecordandrecordFromProofcover the whole lifecycle;writeFromStoresigns inside the engine from aKeyStoreandsignRecordTxHybridsigns with a hybrid post quantum account.Chain.addTxqueues any signed transaction on any assembled chain, and the queue reportsTxAdmittedandTxRemovedevents. - Subchains with anchoring and cross chain proofs, validator rotation, light clients with the overlap rule and bisection, and chain trees that build and produce a whole family of chains.
Networking
NetNoderuns BFT consensus over a gossip mesh while the app owns sockets and timers;SecureSessiongives each link a mutually authenticated, post quantum hybrid channel.PeerMesh: a deterministic in-memory mesh ofNetNodes for tests, simulations and single process networks.AddressBookand self signed peer records with verified peer exchange,NoiseSession(Noise XX with a post quantum identity proof), and the anonymous membership admission handshake (admissionChallenge,admissionAnswer,admissionGranted).- Record model networks:
NetNode.record,recordNonceandproveRecordanswer on every node, observers included.setTransactionslists are cleared when the height commits, so the next height's list is set beforeadvanceand reaches its round 0 proposal.
Custody, assurance and credentials
KeyStoreseals secrets at rest and signs inside the engine (signTransfer,sendFromStore,submitTransferFromStore), withlock,unlock,publicKey,hasandaddresses.- Portable accounts sealed to a passphrase, a recipient or with a signature; threshold accounts with ceremonies and sealed shares. Argon2 bound operations have async variants that run on a worker isolate.
- Assurance postures, sealed mempools and anonymous membership credentials with an optional pseudonymous mode.
Observability
- Typed events (
BlockFinalized,BlockRejected,TxAdmitted,TxRemoved,UnknownEvent) fromevents()and a push basedeventStream, plus Prometheus metrics, onNode,ChainandNetNode.
Packaging and ergonomics
-
Native symbols are resolved once per library, and each call's inputs share one native block that is wiped before it is freed, so secret keys do not linger in freed memory.
-
The engine ships as one self contained library per platform (macOS arm64 2.8 MB, Linux x64 and arm64); the build hook bundles the Linux library as a code asset, and
Aviary.loadedFromreports which library was loaded.AVIARY_DYLIBpoints at any other build. -
Native handles are released by a finalizer; releasing twice is a no-op.
withNode,withKeyStoreandwithTreerelease at the end of a scope. -
AviaryException.statuscarries the C ABI status (AviaryStatus). -
Shortcut extensions: hex helpers, funded accounts, one call blocks, single validator chains, whole threshold ceremonies, fluent chain trees.
-
API docs are grouped into dartdoc categories. Requires Dart 3.10.