Nomad Architecture
Components
Nomad has several logical components:
- Home - The on-chain contract responsible for producing the message tree
- Replica - The on-chain contract responsible for replicating the message root on some other chain
- Updater - The off-chain participant responsible for submitting updates to the home chain
- Watcher - The off-chain participant responsible for observing a replica, and submitting fraud proofs to the home chain
- Relayer - The off-chain participant responsible for submitting updates to a replica
- Processor - The off-chain participant responsible for causing messages to be processed
On-chain (Contracts)
Home
The home contract is responsible for managing production of the message tree and holding custody of the updater bond. It performs the following functions:
- Expose a "send message" API to other contracts on the home chain
- Enforce the message format
- Commit messages to the message tree
- Maintain a queue of tree roots
- Hold the updater bond
- Slash on double-update proofs (not implemented)
- Slash on improper update proofs (not implemented)
- Future: manage updater rotation/bond
- Future: recover from
FAILED
state
Replica
The replica contract is responsible for managing optimistic replication and dispatching messages to end recipients. It performs the following functions:
- Maintain a queue of pending updates
- Finalize updates as their timeouts elapse
- Accept double-update proofs
- Validate message proofs
- Enforce the message format
- Dispatch messages to their destination
- Expose a "disconnect" feature
- Future: recover from
FAILED
state
Off-chain (Agents)
Updater
The updater is responsible for signing attestations of new roots. It is an off-chain actor that does the following:
- Observe the home chain contract
- Sign attestations to new roots
- Publish the signed attestation to the home chain
- Future: manage Updater bond
Watcher
The watcher observes the Updater's interactions with the Home contract (by watching the Home contract) and reacts to malicious or faulty attestations. It also observes any number of replicas to ensure the Updater does not bypass the Home and go straight to a replica. It is an off-chain actor that does the following:
- Observe the home
- Observe 1 or more replicas
- Maintain a DB of seen updates
- Submit double-update proofs
- Submit invalid update proofs
- If configured, issue an emergency halt transaction
Relayer
The relayer forwards updates from the home to one or more replicas. It is an off-chain actor that does the following:
- Observe the home
- Observe 1 or more replicas
- Polls home for new signed updates (since replica's current root) and submits them to replica
- Polls replica for confirmable updates (that have passed their optimistic time window) and confirms if available (updating replica's current root)
Processor
The processor proves the validity of pending messages and sends them to end recipients. It is an off-chain actor that does the following:
- Observe the home
- Generate and submit merkle proofs for pending (unproven) messages
- Maintain local merkle tree with all leaves
- Observe 1 or more replicas
- Maintain list of messages corresponding to each leaf
- Dispatch proven messages to end recipients