A gas-optimized on-chain subscription engine. Most subscription systems store one slot per subscriber (mapping(address => uint256)) — a cost that grows linearly, so onboarding a million members means a million SSTOREs and a permanently larger state footprint. Tribute replaces that mapping with a single Merkle root: membership for any number of subscribers lives in one 32-byte slot, and each subscriber proves their own status on demand with a Merkle proof.
Membership is a Merkle tree whose root lives on-chain; payments and proofs do the rest. The contract never iterates a member set, so per-member cost is constant regardless of scale.
merkle_root: bytes32 commits to every subscriber and expiry; the owner refreshes it via update_root()check_status(addr, exp, proof) verifies leaf = keccak256(keccak256(abi_encode(addr, exp))) against the root via snekmate's merkle._verifyrenew(n) pulls n × price in a stablecoin to the treasury and emits RenewalRequested for an off-chain indexeractive = block.timestamp <= exp + GRACE_PERIOD keeps paying users live across the gap between payment and the operator publishing the refreshed rootThe trust model is small by construction: the contract custodies no membership list and only the root-update authority is privileged. Renewal accounting is event-driven so the on-chain surface stays minimal.
keccak256(keccak256(...)) prevents second-preimage / intermediate-node forgery against the Merkle treemerkle_proof_verification module rather than hand-rolled logicupdate_root(); no other path mutates membership staterenew(n)exp + GRACE_PERIOD across root-refresh windows