Willem Olding
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # The Signal: Ethereum + Wormhole Integration notes The Signal: Ethereum (TSEth) produces proofs that can be used to update a local view of the beacon chain consensus state (finalized and justified checkpoints) by compressing the verification of attestations using the RISC Zero ZKVM. This project is to implement a contract capable of processing these proofs to follow the beacon chain and store trusted block roots, and to also include a Wormhole message receiver by which the Wormhole guardian network can provide a second opinion on block roots. Block roots that are verified both by the ZK proof and by the Wormhole guardians (2-of-2) can be considered safe to use by consumers. ## Existing Work This design could be considered identical to the [Hashi bridge aggregator](https://github.com/gnosis/hashi) and we may chose to use that implementation with the existing [Wormhole adapter](https://github.com/gnosis/hashi/blob/main/packages/evm/contracts/adapters/Wormhole/WormholeAdapter.sol) and a new custom adapter for TSEth which would be similar to the [SP1Helios adapter](https://github.com/gnosis/hashi/blob/main/packages/evm/contracts/adapters/SP1Helios/SP1HeliosAdapter.sol). ## Consensus State We define the consensus state as: ```solidity struct Checkpoint { uint64 epoch; bytes32 root; // beacon block root for epoch boundary block } struct ConsensusState { Checkpoint current_justified_checkpoint; Checkpoint finalized_checkpoint; } ``` A TSEth proof is a way to verify transition from a trusted current state, `pre_state`, to a new state, `post_state`. This transition will usually, but not always, transition the `current_justified_checkpoint` to become the `finalized_checkpoint` and introduce a new `justified_checkpoint`. Once a new state is trusted its `finalized_checkpoint` field can safely be used as a root of trust for further proofs into the chain. For this reason the most recent consensus state must be stored in the contract. This will never need to be rolled back unless there is a liveness failure. ## RISC0 Receipts and Journal In RISC0 the output from the ZKVM execution for a particular program a set of inputs is called a receipt. It is made up of two parts - `journal` and `seal`. The journal contains the public outputs of the program while the seal is opaque cryptographic material required to verify the execution. To verify a proof requires the journal, seal, and imageID. The result is a confirmation that the program with a given image ID asserts that the given journal is correct. The inputs to the program are hidden by default unless explicitly added to the journal. [Example of verifying a RISC0 proof](https://github.com/risc0/risc0-ethereum/blob/fbda42566f4b379e1d439b5b16ae017b02f5f588/examples/erc20-counter/contracts/src/Counter.sol#L55) The journal for TSEth is ABI encoded and has the form ```solidity struct Journal { ConsensusState pre_state; ConsensusState post_state; } ``` This will be available to the contract when verifying a state transition. A (seal, imageID, journalHash) tuple can be verified by calling the RISC0 verifier singleton contract which is deployed on all major EVM chains. - [Deployed RISC0 Verifier contracts](https://dev.risczero.com/api/blockchain-integration/contracts/verifier) - [Example use in forge tests](https://github.com/risc0/risc0-ethereum/blob/main/examples/erc20-counter/contracts/test/Counter.t.sol) ## Timing Considerations It is important to keep track of the timing between state transitions to ensure these are sufficiently close together such that there hasn't been enough time for a large number of validators to exit and be able to conduct a long-range attack. This is very similar to the notion of weak-subjectivity. Following the analysis of https://notes.ethereum.org/@adiasg/weak-subjectvity-eth2 a delay in the order of several days should be acceptable. This should be configurable by the contract admin. If an update is not received within the required time period the contract should freeze and require a restart from a new trusted consensus state. ## Loss of Liveness Considerations TSEth can follow the beacon chain under normal conditions however there are some cases that it cannot. These include: - A fork upgrade - Reorg of a justified checkpoint - Occurence of 2-finality (currently unsupported) - Period of non-finalization longer than 4 epochs There is no need to check for any of these as if they occur it will be impossible to produce a valid proof and the contract should time out. ## Contract Roles Since a liveness failure can occur it is a requirement that the contract can recover. It should be possible for a particular role (which in practice would be a threshold multisig) to restart the contract from a new trusted consensus state and resume operation. They should also be able to update the ImageID which corresponds to an upgrade of the ZKVM guest code. At this time I don't know the exact requirements for these roles but I will try and clarify. ## Obtaining Proofs As of the 15/7/2025 TSEth proofs will be generated by the Boundless network for the ethereum beacon chain. These will be visible on https://explorer.beboundless.xyz/orders. Image ID TBD. [example order](https://explorer.beboundless.xyz/orders/0x2546c553d857d20658ece248f7c7d0861a240681243dfde7?tab=more-details) where you can see the raw data for the journal, seal, and image ID in the explorer. ## Wormhole Integration Wormhole will be used to receive a second opinion on the (epoch, block_root) tuple that makes up a finalized checkpoint. By using a 2-of-2 we are protected from a failure in the ZK proof or a compromise of the Wormhole guardian set (additive security). ### Emitter On the Ethereum mainnet side a contract can read the beacon roots via [EIP-4788](https://eips.ethereum.org/EIPS/eip-4788) and obtain trusted beacon roots in the execution for a given slot. These should be relayed to the Ethereum Wormhole core contract and sent as a multicast message. This should use the [lower level messaging SDK](https://wormhole.com/docs/products/messaging/guides/core-contracts/) and not the relayers since relayers cannot support multicast. Building it this way allows for a single message to be consumed by multiple destination chains, same as the ZK proofs. ### Receiver The receiver should contain a function that accepts a single encoded VAA. It should delegate to the local deployment of Wormhole core contract to call `parseAndVerifyVM` and then check that the emitter Chain ID and contract match what is expected. Once these checks have passed the (slot, blockRoot) tuple can be consumed by the contract and used as an attestation to any (epoch, blockRoot) tuples attested to by a ZK proof > **Notes on slot/epoch conversions** > The beacon chain has what are called Epoch Boundary Blocks (EBBs). See the [beacon chain checkpoints section of this doc](https://ethos.dev/beacon-chain). Typically these are the blocks at the beginning of an epoch and so to get the slot number for a given epoch just multiply it by 32. > Unfortunately this isn't always true due to skipped slots. If the first slot of an epoch is skipped then the EBB of that epoch is last block in the previous epoch. Fortunately the EIP-4788 contract uses the same logic so

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully