JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 188
  • Score
    100M100P100Q90582F
  • License MIT

Symbiotic Relay smart contracts allowing construction of validator set using various mechanics, verification and management of operators' keys of various types, aggregated signatures verification, and validator set's running.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@symbioticfi/relay-contracts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    [!WARNING]
    The SDK is a work in progress and is currently under audits. Breaking changes may occur in SDK updates as well as backward compatibility is not guaranteed. Use with caution.

    Symbiotic Relay Smart Contracts

    Ask DeepWiki

    Overview

    Symbiotic Relay is a peer-to-peer side-network designed to collect and aggregate signatures from validators, maintain validator sets on the settlement contract.

    To achieve that, Symbiotic provides a set of predefined smart contracts, in general, representing the following modules:

    • VotingPowerProvider - provides the basic data regarding operators, vaults and their voting power, it allows constructing various onboarding schemes such as:

    • KeyRegistry - verifies and manages operators' keys; currently, these key types are supported:

    • ValSetDriver - is used by the off-chain part of the Symbiotic Relay for validator set deriving and maintenance

    • Settlement - requires a compressed validator set (header) to be committed each epoch, but allows verifying signatures made by the validator set; currently, it supports the following verification mechanics:

      • SimpleVerifier - requires the whole validator set to be inputted on the verification, but in a compressed and efficient way, so that it is the best choice to use up to around 125 validators
      • ZKVerifier - uses ZK verification made with gnark, allowing larger validator sets with an almost constant verification gas cost
    • Network - a standard contract that can be used as a "network" address across the Symbiotic ecosystem, it enables verifiability of delays for different actions (e.g., change of the middleware or change of the resolver)

    Examples

    Can be found here.

    Security

    Security audits can be found here.

    Repo init

    Clone the repo:

    git clone --recurse-submodules https://github.com/symbioticfi/relay-contracts.git

    Create env configuration

    cp .env.example .env

    Key parameters:

    • OPERATORS - number of operators in network
    • VERIFICATION_TYPE - signatures aggregation type, (0 for ZK, 1 for simple)

    On-chain setup

    Before running off-chain nodes need to set up on-chain contract.

    To simplify local development, we've prepared a Docker image with an Anvil node and deployed Symbiotic contracts.

    Build Docker image

    docker build -t symbiotic-anvil .

    Run anvil node

    docker run --rm -d -p 8545:8545 --env-file .env --name symbiotic-node symbiotic-anvil

    Configure network

    Use the right generate_genesis file depending on your system here.

    docker run --rm -it --env-file .env --network host symbiotic-anvil yarn deploy:network

    This command will execute a list of transactions to set up network contracts.

    In execution logs, you can see the deployed configuration and contract addresses.

    Stop anvil node

    docker stop symbiotic-node

    Tests

    forge test

    Coverage

    forge coverage