Skip to content

Technology

How Agapao works underneath

This page is for developers, validators and anyone checking the claims on the home page. Every rule here is enforced by the node software running the devnet today, except the ones marked as not built. The whitepaper has the full design and the reasons behind it.

The project was called Agape before it was renamed Agapao, and the software keeps its original names: the node is agape-node, the crates are agape-ledger, agape-vm and so on, and addresses still start ag. The name is the Greek verb agapaō, "to love". The currency is still AGAPE, the noun: the love the network gives.

Consensus and validators

Agapao runs Malachite, a Rust implementation of Tendermint BFT consensus. A block is decided when validators holding more than two thirds of the active set's voting power sign it, and a decided block is final: there are no reorganisations. The target block time is 2 seconds.

The active set is the 100 eligible validators with the most bonded stake (self-stake plus delegations), recomputed every hour at an epoch boundary, and voting power is that stake, capped at 5% of the set's total once the set has 20 or more members, so it takes at least 7 validators to hold the third that can stop the chain. Proposers are still drawn by full stake. A validator needs 10,000 AGAPE of self-stake and pays a 500 AGAPE registration fee, which is burned. Up to 1,000 validators can be registered. Unbonding takes 21 days, and stake can still be slashed during that time.

OffencePenalty
Double-signing (two conflicting votes for the same height and round)5% of bonded and unbonding stake, and permanent removal
Downtime (signing less than 5% of the commit certificates over 24 hours)0.1% of bonded and unbonding stake, and jail until the validator sends an unjail transaction

Slashed stake is burned, since a penalty that paid someone would give that someone a reason to cause it. The operator and every delegator lose the same fraction. A validator's rates can be lowered at once, but an increase to either rate, or a move to a new giving destination, waits 21 days.

Issuance and fees

One AGAPE is 1,000,000 base units. New AGAPE is created only by blocks, and issuance is defined in time rather than per block: each block issues the yearly rate in force at its timestamp, multiplied by the time since its parent, counting at most 60 seconds. Fast blocks can't inflate the supply, and an outage doesn't produce a catch-up payment. There's no supply cap; the tail keeps a security budget that doesn't depend on fees.

PeriodYearsAGAPE a yearAGAPE in the period
10 to 2.421,024,00050,500,000
22.4 to 4.810,512,00025,250,000
34.8 to 7.25,256,00012,625,000
47.2 to 9.62,628,0006,312,500
Tail9.6 onward1,314,0001,314,000 a year

Each block's issuance goes to its proposer's validator and is split in order: the validator's philanthropy percentage (0 to 100) to its giving destination, or burned if it names none, its commission (0 to 100% of what remains) to the validator, and the rest to everyone staked with it in proportion to stake. Divisions round down, and rounding remainders go to the validator.

Fees follow demand, on the model of Ethereum's EIP-1559. Every block has a base fee per byte of encoded size and one per 1,000 gas, which rise when the block before was more than half full and fall when it was less, by up to an eighth a block, down to a floor of 1 base unit. The base fees are burned, as Ethereum burns them, so the proposer can't fill blocks with its own transactions for free. A transaction adds a tip for the proposer. A transfer costs about 0.0027 AGAPE at the starting base fee of 10 base units a byte, and about 0.0005 at the floor. Contract calls and deploys pay for gas on top, from a starting base fee of 4 base units per 1,000 gas.

AGAPE leaves the supply only by burning: a philanthropy share with no destination, an accrual unclaimed for 60 days, base fees, the validator registration fee, slashed stake and the 1,000 AGAPE asset creation fee. The ledger keeps a running total of everything burned, and each block reports its burns by cause, which nodes serve at /burns. Issuance doesn't depend on fees, so in a period when burns come to more than issuance the supply is smaller at the end than at the start. Nobody has modelled when that would happen.

Philanthropy

The protocol guarantees that each validator gives the share it publishes to the destination it names, or burns it, and that anyone can audit both from chain state. It doesn't know or check who the recipients are. There's no pooled fund, no registry of charities and no vetting on chain.

A validator names its destination with SetGivingDestination: a deployed contract, or none. Each block whose proposer names a contract adds the philanthropy share to that contract's accrual, and nothing runs in the contract at the end of the block. The contract takes what has accrued with the claim_giving host function, in any call anyone makes to it, and pays it on by its own code. What it leaves unclaimed for 60 days is burned. A plain account can't be a destination, since that would be commission under another name. The ledger keeps public counters for each destination (accrued, claimed, lapsed and pending), served under /giving, and where a contract sends what it claimed is in its receipts.

ParameterValue
Philanthropy percentage0 to 100, set by each validator
Giving destinationA deployed contract, or none (the share is burned)
Wait for a rate increase or a new destination21 days, at once for a validator with no delegators (once every 30 days)
Unclaimed accrualBurned after 60 days, at a lapse tick every 30 days
Contracts with an accrual pendingAt most 2,000; a share for a contract that would join a full list is burned
Domain claimOne domain per address, 1 to 253 bytes in A-label form
DNS recordTXT at _agapao.<domain>: v=agapao1 a=<address>, with n=<chain name> on a test network
DNS checkTwo DNS-over-HTTPS resolvers run by different companies, both must list the address; kept for an hour

Any transparent account can claim a domain with SetDomainClaim, and a contract claims one for its own address with set_domain_claim. The ledger checks the domain's form and nothing else, and nothing on chain reads it. The domain lists the address back in a TXT record, and the wallet counts the claim as verified only when two resolvers run by different companies both return it. It shows "example.org, domain verified" and never "vetted" or "charity": a verified domain means whoever controls the domain's DNS lists the address as theirs, and says nothing about who they are or how they spend. DNSSEC is shown and not required. The light client can't check DNS, and the wallet says so.

The wallet sorts validators by philanthropy first, and counts a validator's percentage only when its share goes to a contract with 90 days since its first claim and a domain the wallet has verified. A validator burning its share sorts with the validators at 0%.

Vetting happens off chain, in signed lists anyone can publish: JSON files at HTTPS addresses, each naming addresses and the domains they claim with its publisher's notes, signed with an Ed25519 key the publisher lists in its own domain's DNS. The wallet will ship with no list. A user adds the lists they trust by URL, and the wallet shows "listed by" and the publisher's domain beside an address only when the list, the address's claim and the domain's DNS agree. The format is proposed and not built.

Giving model v1, with a treasury, vetted charities, Philanthropic Service Providers, slates and challenges, was removed in November 2026, before the testnet or mainnet started. A pooled fund needs someone to allocate it, which is a point of control however that someone is chosen, and the protocol couldn't check the real-world facts its vetting rested on.

Native assets

Anyone can issue a fungible asset on the ledger itself (e.g. a stablecoin, a community token, points) for 1,000 AGAPE, which is burned. Every account and contract can hold any asset, and wallets show assets beside AGAPE. Fees are always paid in AGAPE, and validator rewards and giving shares stay in AGAPE.

An address opts in to an asset before it can hold it, for a refundable deposit of 0.122 AGAPE, so no one can fill an account with tokens it never asked for. An asset can declare a mint power and a freeze power at creation and only then, each held by an address that can hand it on or renounce it, and a mintable asset can cap its supply for good. Anyone can burn what they hold. A frozen holding can't send or receive the asset, and there's no clawback. Names aren't unique, so a wallet shows each asset with its issuer.

Private payments

The shielded pool is Zcash's Ironwood protocol: the Orchard circuit, with notes that can be recovered if elliptic-curve cryptography is ever broken (ZIP 2005). Agapao uses the orchard crate (0.16) unchanged and writes no cryptography of its own. Proofs are Halo 2, which needs no trusted setup.

AGAPE moves three ways. A shield sends it from a public account into the pool, a shielded transfer moves it inside the pool with sender, recipient and amount hidden, and an unshield sends it back out. Shields and unshields reveal their public side and the amount crossing.

The ledger checks each shielded transaction's proof and signatures, refuses any nullifier it has seen, and accepts an anchor only from the last 24 hours of blocks. The pool keeps its own balance, which no transaction may take below zero, so a soundness flaw in the circuit couldn't create AGAPE outside it. Viewing keys show a wallet's transactions without being able to spend. The pool's cryptography isn't post-quantum.

Staking, giving destinations, domain claims and contracts stay public. Shielded AGAPE has to be unshielded before it can be staked.

Contracts

Contracts are WebAssembly modules, run by agape-vm on Wasmtime 48, a long-term-support release. A contract is compiled once, at deploy, with Wasmtime's single-pass Winch compiler, and every node keeps the compiled module. Everything that could differ between machines is fixed: floating point is refused at deploy, every WebAssembly feature is set explicitly (sign extension, multi-value and bulk memory are on), call depth is limited to 512 by instrumentation, memory is capped at 16 MiB and code at 128 KiB.

One gas meter covers execution and every host function, and host work is charged before it runs. A call that fails pays for the gas it used and changes nothing else. A contract also holds a refundable deposit of 1,000 base units for every byte it stores. The same deploys and calls give the same state root on arm64 and x86_64, which CI checks on every change.

A contract is an account: it holds AGAPE, keeps its storage in the state tree and emits events. It can send AGAPE to any address, claim what validators' shares have accrued to it when it's their destination, and claim a domain for its own address. It can't delegate, vote or call another contract, and its code can't change once deployed.

A contract can also hold native assets, send them, and use the mint and freeze powers it holds, including those of an asset it created with itself as the issuer. Host functions let it check other chains' proofs: BN254 and BLS12-381 with Ethereum's precompile encodings, Keccak-256, SHA-256, and SP1 PLONK proofs, which the node checks with SP1's own verifier. A release registry holds values only a node release writes, such as the SP1 verifier keys a release accepts, and contracts read them. These are the building blocks for bridges, which are applications of their own; a bridge to Ethereum is in development in a separate project.

Contracts are written in Rust with agape-sdk. Each embeds a schema of its methods, arguments, return values and events, which the ledger checks at deploy. Wallets use the schema to show what a call does before it's signed and to decode results and events.

State, keys and encoding

The state is a Jellyfish Merkle Tree over SHA-256, stored in redb and versioned by height. Every block header commits to the state root after that block, so a value can be checked against a header. Transactions, blocks and state use a canonical borsh encoding with a written specification and golden test vectors. Signatures are Ed25519, verified under ZIP-215.

A node keeps the newest day of state and prunes older versions as it goes. Blocks, certificates, state roots and every voting set are kept for every height, so peers and light clients still follow the chain from genesis. A node that wallets restore from can keep everything instead.

Public addresses are bech32m, ag1… on mainnet and agtest1… on test networks, and shielded addresses agz1… and agztest1…, so neither kind can be mistaken for the other or used on the wrong network.

No key signs the genesis. A chain starts from a public configuration that every node reproduces, and the hash of its encoding is the chain id, which every transaction signs. There's no admin key, pause switch or upgrade key anywhere in the ledger, the shielded pool and contracts included.

The wallet

The wallet app is written in Rust with a Slint interface, for macOS, Windows, Linux and Android. Everything that touches keys or money is in agape-wallet-core, which the command-line wallet shares. One 24-word BIP-39 phrase derives the public keys (Ed25519, by SLIP-10) and the shielded spending key (by ZIP-32). The vault is encrypted with a key derived from your password by Argon2id or, on Android, held in Android Keystore.

Every transaction goes through a plan: the core builds the exact body, writes a summary from it, and signs that body only after you confirm the summary. The wallet is a light client: starting from the genesis its chain id names, it follows the voting set through each change, checks the header at each answer's height against its commit certificate, and checks every balance and record it acts on against that header's state root. A node can still withhold answers or show an old height, but it can't change a balance.

Each release carries the Android app, signed with the Play upload key, as an app bundle and a universal APK. The desktop app has no release builds yet and builds from source, and the app isn't on Google Play yet.

Upgrades and releases

There's no on-chain governance. Protocol parameters are fixed in each release, and changing one means a new release of agape-node that validators holding more than two thirds of the voting power choose to run. A release can add rules to a running chain from an activation height, and the chain ids of known networks are compiled into the binary. A new network runs every rule its release has from genesis, so the current networks have no activation heights; the first release that changes a rule on a running testnet or mainnet adds one.

Releases are built in CI: agape-node for Linux (x86_64 and ARM64) and Windows, signed with Sigstore keyless signing and shipped with a CycloneDX software bill of materials, and the Android wallet app with SHA-256 checksums. There's no macOS build. The install script refuses an archive whose signature doesn't verify.

The devnet

The public devnet's chain id, which changes whenever it is reset, is reported by https://agapao.network/api/status. The shielded pool, contracts, giving destinations, domain claims and every other rule are on from height 1. Its nodes' API is at https://agapao.network/api. Devnet coins have no value. The faucet sends 1,000 devnet AGAPE to an address once a day, for a few seconds of proof of work in the browser; its API is at https://agapao.network/faucet/api.

Specifications

ParameterValue
ConsensusMalachite (Tendermint BFT), stake-weighted
Active validatorsTop 100 by bonded stake, recomputed hourly
Voting power cap5% of the active set per validator, from a set of 20
Target block time2 seconds
FinalityWhen a block is decided (more than 2/3 of voting power signs it)
Maximum block size4 MiB
SignaturesEd25519 with ZIP-215 verification
State commitmentJellyfish Merkle Tree over SHA-256
FeesA base fee per encoded byte that follows demand, from 10 base units down to a floor of 1, burned, plus a tip to the proposer
Shielded poolZcash Ironwood (orchard 0.16), Halo 2 proofs, no trusted setup
Shielded anchor window43,200 blocks (24 hours)
Contract runtimeWasmtime 48 LTS, Winch compiler, no floating point
Contract code limit128 KiB
Contract memory limit16 MiB
Gas limits1 billion per transaction, 2 billion per block
Gas priceA base fee per 1,000 gas that follows demand, from 4 base units down to a floor of 1
Storage deposit1,000 base units per stored byte, refundable

Further reading

  • Whitepaper The design, the economics and the reasons behind them.
  • API explorer Every request the devnet's nodes answer, with a way to send them.
  • Releases Signed node builds with checksums and SBOMs.
  • The project on GitLab The source, from git clone https://gitlab.com/friendowment/agapao.git.