State Machine
Introduction
The State Machine is a core protocol component responsible for maintaining and updating the state of the blockchain as it progresses. It represents the collective state of all accounts, validators, and other relevant data stored on the blockchain.
Accounts
An account is a structure that holds funds and can send or receive transactions. Each account has a unique address and a balance, think of a bank account, but managed by the blockchain instead of a bank.
message Account {
// address: the short version of a public key
bytes address = 1;
// amount: the balance of funds the account has
uint64 amount = 2;
}The native cryptocurrency is able to be transferred to and from accounts from a digital signature from the user's private key that corresponds to the account Address.
message MessageSend {
// from_address: is the sender of the funds
bytes from_address = 1;
// to_address: is the recipient of the funds
bytes to_address = 2;
// amount: is the amount of tokens in micro-denomination
uint64 amount = 3;
}Pool
A pool is like an account without an owner, holding funds that are managed directly by the blockchain protocol. It's very similar to an account, but instead of an address, it has a unique ID and operates based on predefined blockchain rules rather than individual control.
For example:
DAO Treasury Pool
Committee Funds Pool
Committee Escrow Pool
Validators
A Validator is an actor in the blockchain network responsible for verifying transactions, creating new blocks, and maintaining the blockchain's integrity and security. In Canopy, Validators provide this service for multiple chains by restaking their tokens across multiple 'committees' and run a blockchain client for each.
The native cryptocurrency is able to be surety-bonded by participants to become validators. When staking (bonding), validators are able to choose a variety of configurations:
Amount: The amount of tokens to be removed from the sender account and locked as a surety bond against bad behavior during BFT. The entirety of this 'stake' is re-used (restaked) in each Committee BFT at the same time.
Committees: The list of chains the validator is restaking their tokens towards.
Delegate: A non-delegate is registering for active participation in the committee consensus, whereas a delegate is a passive participant who contributes their tokens to influence subsidized status.
Compounding: Automatically compounds rewards to the stake or early withdraws them to the reward address for a penalty.
Output Address: The address where early-withdrawal rewards and the unstaking surety bond are transferred to.
β¨ The more tokens the validator bonds, the more voting power it has in consensus operations. However, the more staked, the more at risk if βslashedβ for bad behavior like double or non-signing during consensus.
Both the Operator and the Output private key may sign transactions on behalf of the Validator, but only the Output private key may change the Output address.
At any time a validator is able to update their stake information like committees and compounding
status by submitting an edit_stake transaction:
In addition to this, the validator may also pause operations across all committees by submitting a pause_tx, temporarily removing it from service, and submit an unpause_tx to resume committee membership.
β© To exit completely the validator may submit an unstake_tx, permanently leaving the committees it is staked for. A Validator may be Paused up to MaxPauseBlocks before it's automatically unstaked.
For short and long-range attack protection, the validator must wait for governance-controlled unstaking_blocks before their bond is fully returned, during which they are still eligible for slashing for bad behavior.
Committee
A validator is eligible to provide shared security services to any Nested Chain it chooses.
Once staked for a Committee, the validator connects with the other members of that Committee via the P2P layer. Together, the committee executes consensus for the Nested-Chain, producing immediately final Nested-Chain blocks.
β© For each Nested-Chain block, the elected leader submits a Certificate Result Transaction to the Canopy Root-Chain, encapsulating the results of the quorum.
Details of how Validators perform BFT for Nested Chains are found in the Utility section.
Subsidization
Each Root-Chain block, new mint is created and is equally sent to the auto-subsidized committees' 'Committee Funds Pool'.
Committees qualify as AutoSubsidized using the following formula:
Patrons may manually subsidize the Committee Funds Pool by directly sending tokens to it with an OpCode instruction on distribution rules (if applicable)
From the Committee Funds Pool, the Committee may distribute these rewards at the quorum's discretion.
Rewards
The tokens for the RewardRecipients are distributed from the Committee Pool β which is funded by (auto & manual) Subsidies.
Each committee may choose Reward Recipients as determined by their respective softwareβbut the default is:
70% β Block Producer: The Root-Chain Validator who produced the Nested-Chain block.
10% β Root-Chain Delegate: Randomly selected by stake-weight from Delegates staked for the
NestedChainIDon the Root-Chain.10% β Nested-Chain Validator: Randomly selected by stake-weight from Validators staked for the
NestedChainIDon the Nested-Chain (will perform BFT once Nested-Chain is independent).10% β Nested-Chain Delegate: Randomly selected by stake-weight from Delegates staked for the
NestedChainIDon the Nested-Chain (will influence subsidization once Nested-Chain is independent).
The Certificate Result is included in the Nested-Chain block β so Reward Recipients are processed on both chains! Meaning, tokens are distributed proportionally to the same 4 actors on both chains.
Slashes
SlashRecipients are burned when processing each Certificate Result. By default, slashes only occur for 2 reasons:
A Validator didn't sign
MaxNonSignblocks within theNonSignWindowof blocks.A Validator Double-Signed blocks β violating BFT safety.
Both of these Slashes have respective burn amounts, which are parameterized.
Unlike rewards, Slashes are processed only on the Root-Chain and are applied directly without normalization by transaction count.
A governance parameter, MaxSlashPerCommittee limits the number of slashes per Committee per block.
β¨ If this limit is exceeded, slashes are capped, and a safety mechanism automatically ejects Validators from the Committee β removing their eligibility to participate and receive slashes, preventing cascading failures.
Token Swaps
A Seller may submit
CreateOrdertransactions that create a sell order on the Root-Chain. When submitting a CreateOrder transaction, the 'Root-Chain asset' is transferred to a Committee controlled escrow pool.The Buyer may reserve an Order by submitting a transaction to themselves on the 'buyer asset' chain with a
LockOrderembedded in the transaction (via SigScript, OpData, Memo etc).The Committee witnesses the Lock by deterministically parsing the buyer chain block. The Committee marks the on-chain SellOrder as 'Locked' by recording the Buyer's information and setting the BuyerChainDeadline.
The Buyer witnesses their information in the SellOrder on the Root-Chain and directly sends the funds to the Seller β embedding a
CloseOrderin the transaction.The Committee witnesses the CloseOrder by deterministically parsing the buyer chain block and releases the Seller's escrowed funds to the Buyer.
The Seller may
EditOrderorDeleteOrderif the order is not yet locked.
Governance
Canopy is pre-built with 2 different on-chain governance mechanisms:
Polling: Gather community sentiment by executing an on-chain vote of Accounts and Validators.
Proposals: Change governance parameters and distribute tokens from the DAO Treasury Fund by completing an on-chain referendum of Validators staked for the Root-Chain committee.
Polling
Polls don't actually execute any action β rather they are an on-chain community sentiment gathering tool.
Polling transactions come in 2 flavors:
StartPoll: Encoded in Root-Chain
SendTransactionsβ an Account or Validator begins an on-chain poll. StartPoll transactions cost a higher fee as dictated by governance parameters to prevent spam.VotePoll: Encoded in Root-Chain
SendTransactionsβ an Account or Validator signals their sentiment with a vote on an existing poll.

The result of a poll are automatically recorded by the Canopy node deterministically parsing the block for StartPoll and VotePoll transactions.
β¨ The results are updated per block as Account and Validator funds change and may be viewed in the web wallet. Results are locked in after EndBlock and are pruned after a node-configurable expiration height.

Proposals
Canopy has 2 different flavors of Proposal:
Change Parameter: update on-chain governance parameters that allow 'on-the-fly' adjustments to the protocol without any software changes.
DAO Transfer: Distribute treasury funds from the DAO pool to any account
Proposals require approval from +β of the Voting Power of the Root-Chain committee to be finalized.
A Proposal Transaction is created by any community member.

This proposal is exported in JSON format and may be distributed via governance forum.
Once exported, each Validator configures their node to approve or reject the proposal via the web interface. This configures the node to accept or reject this proposal hash when validating the transaction at the Mempool and BFT level.

Once +β of the Voting Power has approved the proposal, the Proposal Transaction may be submitted by any community member to be included in a block. Importantly, the transaction may never be sent before the
StartHeightensuring sufficient time to achieve quorum.
Supply Tracker
A supply tracker is a structure that keeps track of the total amount of tokens or funds available across the entire blockchain.
β€ It provides a single source of truth for the overall token supply managed by the network. It conveniently buckets the tokens into useful categories, allowing transparency and consistency.
Last updated