Nerif Docs
  • Quickstart
  • Tutorials
    • Lottery Tutorial
      • Step 1. Configure your account
      • Step 2. Add a smart contract
      • Step 3. Create a new automation workflow
      • Step 4. Build your automation workflow
      • Step 5. Test workflow execution
    • Bridge Tutorial
      • Step 1. Configure your account
      • Step 2. Add smart contracts
      • Step 3. Create a new automation workflow
      • Step 4. Build your automation workflow
      • Step 5. Test workflow execution
    • Price Feed Tutorial
      • Step 1. Configure your account
      • Step 2. Add smart contract
      • Step 3. Create a new automation workflow
      • Step 4. Build your automation workflow
  • 1. What is Nerif Network?
    • Our Mission
    • Our Vision
    • Terms
  • 2. Architecture
    • Core components
    • Validators
      • Networking
        • Bootnode
        • Joining the network
        • Leaving the network
        • Slashing
      • Consensus
        • Epoch & Rounds
        • Automation workflow
          • Triggers
          • Actions
          • Condition
    • Contracts
      • System Contracts
      • Operational Contracts
    • Security
      • DKG
      • Threshold ECDSA
      • Security checks
  • 3. How it works
    • Introduction
    • Nerif App
    • Login
    • Account Configuration
      • 1. Deploy a Gateway Contract
        • 1.1 Create a new gateway
        • 1.2. Use existing gateway contract
        • 1.3.What if I want to update my gateway contract?
      • 2. Top up your balance
        • 2.1. Topping up your balance on Polygon Mumbai
        • 2.2. Topping up your balance on Ethereum Goerli
    • Fees
    • User balance
      • 1. Topping up the balance
        • 1.1 Top up your balance via Nerif App
        • 1.2 Top up your balance directly via Registry smart contract
      • 2. Withdraw from balance
        • 2.1 Withdraw via Nerif App
        • 2.2 Withdraw directly via Registry smart contract
    • API
      • Off-chain APIs
      • On-chain APIs
    • SDK
  • 5. Nerif DAO
    • Governance
    • Treasury
    • Proposal process
  • 6. Support
Powered by GitBook
On this page
  • DKG (Distributed Key Generation) Contract
  • Staking Contract
  • Slashing Contract
  • RewardDistributionPool Contract
  1. 2. Architecture
  2. Contracts

System Contracts

PreviousContractsNextOperational Contracts

Last updated 1 year ago

System contracts are designed to meet the internal needs of the network and enhance its security, e.g. through mechanisms like staking and slashing. All system contracts are deployed on mainchain, i.e. Polygon. The following are the key system contracts:

DKG (Distributed Key Generation) Contract

The Nerif Network utilizes a distributed key generation procedure to create a common shared secret among all validators. The implementation of DKG within the network requires on-chain logic for full decentralization.

This logic is implemented in the DKG smart contract, which is used during the .

Additionally, the DKG contract implements the SignerStorage interface to store the collective network address generated through the DKG process:

  • Distributed key derivation is used in the interactive process involving N parties to generate secret keys and a single public key

  • Valid signatures can be produced through an interactive process involving any T parties.

  • The DKG contract employs secret sharing, additively homomorphic encryption, and zero-knowledge proofs to achieve trustlessness.

Staking Contract

The staking contract implements the necessary logic for validators to stake tokens and join the network. Validators are required to store a certain amount of tokens (N tokens), configured per network within the contract, to become network participants. The staking contract governs this process.

Slashing Contract

The Nerif Network includes slashing protection functionality, which addresses malicious validators using smart contracts. The slashing contract handles the necessary mechanisms to penalize or slash tokens from validators engaging in malicious activities.

RewardDistributionPool Contract

The reward distribution pool contract implements the logic for proper rewards distribution.

DKG process