How a transaction reaches the ledger on EVM and Canton

One transfer of 100 USDC from Alice to Bob, split into five steps from signing to writing the ledger, comparing EVM and Canton at each step.

Open the comparison page
ExampleAlice sends 100 USDC to Bob
ERC-20 balances on EVMAlice 1000 → 900Bob 200 → 300
Holdings on CantonArchive #1 Alice 1000Create #3 Alice 900 and #4 Bob 100

Explanatory figureDrawn from the official documentation

Recorded figureDrawn from a run recorded in Tracelyth

  1. 1

    Sign and send

    Alice's side builds what to send and hands it to the first receiver

    EVMEthereum mainnetFusaka

    Explanatory figure
    AliceWalletNode11223344transfer(Bob, 100)transfer(Bob, 100)Sign with the private keySign with the private keyeth_sendRawTransactioneth_sendRawTransactionTransaction hash
    Processed by
    Alice's wallet and the Ethereum node that receives the transaction
    Receives
    A transaction that calls transfer on the USDC contract. It carries the nonce, the fee limits and the signature
    Checks
    Whether the signature is valid and Alice has enough ETH to pay the fee
    Returns
    The transaction hash. The transaction enters the node's mempool

    CantonCanton NetworkCanton 3.7

    Explanatory figure
    AliceAlice's participant11223344Transfer commandTransfer commandInterpret the Daml and build the transaction treeInterpret the Daml and build the transaction treeSplit it into one view per action and encrypt eachSplit it into one view per action and encrypt eachAttach a root hash over the whole tree
    Processed by
    The participant node that hosts Alice. On Canton Network, a participant bundled with the Splice application layer is called a validator node
    Receives
    A command to exercise Transfer on Holding #1
    Checks
    Interprets the Daml and checks that Holding #1 is active, Alice is its controller and the balance covers the amount
    Returns
    One view per action, each encrypted so only the participants hosting its informees can read it, and a root hash over the whole tree
  2. 2

    Order

    The transaction gets its place in the order and reaches those involved

    EVMEthereum mainnetFusaka

    Explanatory figure
    NodeOther nodesValidator112233Gossip through the mempoolGossip through the mempoolPicked from the mempoolPicked from the mempoolOrdered into a block in a 12-second slot
    Processed by
    One validator chosen for each slot
    Receives
    Transactions spread across the nodes' mempools
    Checks
    Whether the transaction can go into the block, judged from its nonce and fee limits
    Returns
    A block with the transactions in order, sent to every node

    CantonCanton NetworkCanton 3.7

    Explanatory figure
    Alice's participantSequencerIssuer's participantBob's participantMediator112233445566Confirmation requestConfirmation requestAssign order and timeAssign order and timeAlice's viewsAlice's viewsIssuer's viewsIssuer's viewsOnly Bob's viewsOnly Bob's viewsList of informees
    Processed by
    The synchronizer's sequencer
    Receives
    Encrypted views, root hashes and, for the mediator, the list of informees
    Checks
    It cannot read the contents. It timestamps the batch, which fixes the order
    Returns
    Each participant receives only the views for the parties it hosts
  3. 3

    Validate

    The receivers re-run what arrived and check it

    EVMEthereum mainnetFusaka

    Explanatory figure
    ValidatorEvery node112233BlockBlockRe-run every transaction in the EVMRe-run every transaction in the EVMCompare the result with state_root
    Processed by
    Every node that receives the block
    Receives
    The whole block of ordered transactions
    Checks
    Re-runs everything in the EVM and checks that the resulting state matches the block's state_root
    Returns
    Alice's balance 900, Bob's balance +100, and the Transfer event

    CantonCanton NetworkCanton 3.7

    Explanatory figure
    Alice's participantIssuer's participantBob's participantSequencerMediator112233445566Re-run the DamlRe-run the DamlValidate the same wayValidate the same wayValidate, no responseValidate, no responseApproveApproveApproveApproveDeliver the responses
    Processed by
    The participants of the parties whose confirmation is required, here the signatory issuer and Alice, the controller who exercised Transfer
    Receives
    Only the views its own parties are involved in
    Checks
    Re-runs the Daml for the same result, checks that the signatories and controllers authorized it, that the input Holding is still active, and the time. The activeness check prevents double spends
    Returns
    Approve or reject, sent to the mediator through the sequencer. Bob's participant also validates its view, but Bob, an observer, is not a required confirmer, so it does not respond
  4. 4

    Decide

    The result becomes final and cannot change later

    EVMEthereum mainnetFusaka

    Explanatory figure
    ValidatorBeacon chain112233Attestation votesAttestation votesJustified at two thirds or moreJustified at two thirds or moreFinalized in about 15 minutes
    Processed by
    All validators
    Receives
    Votes on blocks and checkpoints, called attestations
    Checks
    Whether votes from at least two thirds of the stake have arrived
    Returns
    Finalized after about 15 minutes, at least two epochs. Reverting it would destroy at least one third of all staked ETH, so in practice it does not change

    CantonCanton NetworkCanton 3.7

    Explanatory figure
    MediatorSequencerInvolved participants112233Check thresholds and the deadlineCheck thresholds and the deadlineApproval verdictApproval verdictDeliver the verdict
    Processed by
    The synchronizer's mediator
    Receives
    Approvals or rejections from the participants
    Checks
    Whether each required confirmer's threshold is met before the deadline, called the decision time. Here the issuer and Alice must approve
    Returns
    An approve or reject verdict. Once delivered it is final, with no forks
  5. 5

    Write the ledger

    Each ledger records the result, and who holds what changes

    EVMEthereum mainnetFusaka

    Recorded figure
    USDCbalanceOf−100 USDCPending1,000967942924913905902900USDC+100 USDCPending200233258276288295298300USDCAAliceAAlice1,000→1,000967942924913905902900BBobBBob200→200233258276288295298300CCarol0AAliceBBobCCarolLogUSDC.TransferPendingfromAlicetoBobamount100 USDCIn100 USDCUSDCbalanceOf900−100 USDCPending900−100 USDCFinalUSDC300+100 USDCPending300+100 USDCFinalUSDCAAlice1,000→900AAlice1,000→900BBob200→300BBob200→300CCarol0AAliceBBobCCarolLogUSDC.TransferPendingfromAlicetoBobamount100 USDCLogUSDC.TransferFinalfromAlicetoBobamount100 USDCIn100 USDCUSDC.transfertoBobamount100 USDC
    Processed by
    Every node
    Receives
    The result of executing the block
    Checks
    Whether the receipts it computed match the block's receipts_root. Status 1 means success
    Returns
    Every node holds the same state. Alice has 900 and Bob gains 100

    CantonCanton NetworkCanton 3.7

    Recorded figure
    USDCbalanceOf1,000USDC200USDCAAlice1,000BBob200CCarol0AAliceBBobCCarolIn100 USDC ≤ 1000 USDCUSDCbalanceOf−100 USDCPending1,000967942924913905902900USDC+100 USDCPending200233258276288295298300USDCAAliceAAlice1,000→1,000967942924913905902900BBobBBob200→200233258276288295298300CCarol0AAliceBBobCCarolIn100 USDC ≤ 1000 USDC100 USDCUSDCbalanceOf900−100 USDCPending900−100 USDCFinalUSDC300+100 USDCPending300+100 USDCFinalUSDCAAlice1,000→900AAlice1,000→900BBob200→300BBob200→300CCarol0AAliceBBobCCarolIn100 USDC ≤ 1000 USDC100 USDCUSDC.TransfernewOwnerBobquantity100 USDC
    Processed by
    Each participant that hosts an involved party
    Receives
    The mediator's approval verdict
    Checks
    Whether the verdict is approve
    Returns
    Archives Holding #1 and creates #3 and #4. The issuer stores #3 and #4, Alice stores #3, and Bob stores only #4

When it is rejected

The same steps, showing where each case stops and what happens to the ledger and the fee.

  1. Send more than the balance

    When Alice tries to send 1200 USDC

    EVMEthereum mainnetFusaka

    Explanatory figure
    AliceNodeValidator1122334455transfer(Bob, 1200)transfer(Bob, 1200)Picked from the mempoolPicked from the mempoolExecutes and revertsExecutes and revertseth_getTransactionReceipteth_getTransactionReceiptReceipt status 0
    Stops at
    When it reverts during execution inside the block. The transaction stays in the block
    Ledger
    The balance changes and the event are discarded. Alice keeps 1000
    Fee
    Paid. The nonce also goes up
    Returns
    A receipt with status 0

    CantonCanton NetworkCanton 3.7

    Explanatory figure
    AliceAlice's participantSequencer112233Transfer command for 1200Transfer command for 1200Rejected while interpreting the DamlRejected while interpreting the DamlReason for the rejection
    Stops at
    At Alice's participant while it interprets the Daml. Nothing is sent to the sequencer
    Ledger
    Unchanged. Holding #1 stays Alice's 1000
    Fee
    Not paid. The traffic cost is 0
    Returns
    A DAML_FAILURE error. The reason is balance too low, raised by assertMsg in the Daml
  2. Spend the same balance twice

    When Alice tries to send the same 1000 in two transactions at almost the same time

    EVMEthereum mainnetFusaka

    Explanatory figure
    AliceNodeValidator1122334455transfer(Bob, 1000), nonce ntransfer(Bob, 1000), nonce ntransfer(Carol, 1000), nonce n+1transfer(Carol, 1000), nonce n+1Picked from the mempoolPicked from the mempoolThe first succeedsThe first succeedsThe second reverts
    Stops at
    The second one, executed later. One sender's transactions run in nonce order
    Ledger
    Only the first one changes it
    Fee
    Paid for both
    Returns
    Receipts with status 1 for the first and 0 for the second

    CantonCanton NetworkCanton 3.7

    Explanatory figure
    Alice's participantSequencerIssuer's participantMediator11223344556677Two requests that use Holding #1Two requests that use Holding #1Delivered first, then secondDelivered first, then secondSecond is unusableSecond is unusableReject the secondReject the secondDeliver the responseDeliver the responseThe second is rejectedThe second is rejectedDeliver the verdict
    Stops at
    At the issuer's and Alice's participants during validation. For the second one, sequenced later, Holding #1 is locked while the first is pending, or already archived once it has committed
    Ledger
    Only the first one changes it
    Fee
    Alice's participant pays the traffic cost of the second confirmation request too
    Returns
    A reject verdict for the second, with LOCAL_VERDICT_LOCKED_CONTRACTS or LOCAL_VERDICT_INACTIVE_CONTRACTS

Terms

EVM

mempool
The list of pending transactions each node keeps before they go into a block
nonce
A per-sender counter that starts at 0 and goes up by one. One sender's transactions run in this order, and each number can be used only once
validator
Stakes ETH, proposes blocks and votes on them. One validator proposes in each 12-second slot
attestation
A validator's vote on a block and on checkpoints, weighted by its stake
state_root
A hash that commits to the state of every account. It is in the block header, and nodes compare it with the result of re-execution
receipt
The record of a transaction's execution. It holds status 1 for success or 0 for failure, the gas used and the event logs
revert
Stops execution and undoes every state change the transaction made. The fee is still paid and the nonce still goes up
finalized
A justified checkpoint whose next-epoch checkpoint has also been justified by two thirds of the stake. It takes about 15 minutes, and reverting it would destroy at least one third of all staked ETH

Canton

party
An entity that holds rights and obligations on the ledger. Alice, Bob and the issuer are parties, each hosted on a participant
participant
A node that hosts parties, stores their contracts and validates transactions. On Canton Network, a participant bundled with the Splice application layer is called a validator node
Holding
A contract that records an amount of a token and its owner. A transfer archives the original Holding and creates new Holdings for the amount sent and the remainder
signatory
A party that signed the contract. Its authority is needed to create or archive the contract, and it confirms changes. On a Holding it is the issuer
observer
A party that can see the contract but did not sign it. It is informed of changes but does not confirm them. On a Holding it is the owner
controller
A party that can exercise a choice on the contract, and whose confirmation is then required. For Transfer on a Holding it is the owner
synchronizer
The layer that orders transactions and coordinates agreement between participants. It consists of sequencers and mediators. The sequencer keeps the encrypted views for a limited period but cannot decrypt them
sequencer
Timestamps incoming requests, which fixes their order, and delivers them. Participants and mediators never talk directly; every message goes through it
mediator
Collects the participants' responses and decides approve or reject. It does not see the Daml code or contract contents
view
A part of the transaction tree, one per action. Only the participants hosting the view's informees can decrypt it
informee
A party that is informed of a view. Signatories, observers and controllers are informees, and of these the signatories and controllers must confirm
traffic cost
The fee a participant pays for the messages it sends through the sequencer. A transaction rejected before it is sent costs nothing