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
  • Ownership Verification
  • Create Workflow
  • Get Existing Workflow
  • Manually Execute Workflow
  1. 3. How it works
  2. API

Off-chain APIs

The off-chain API of the Nerif Network is implemented as a GraphQL server within each Nerif Network Node. This API allows network users to directly interact with the network by sending HTTP requests to the GraphQL endpoints exposed by the node.

Ownership Verification

To ensure security and access control, the Nerif Network implements an ownership verification mechanism. This mechanism verifies that requests to modify workflows or perform other actions are coming from trusted entities. Requests must be signed by the sender's private key and include the necessary data for verification.

Implementation:

  1. The sender requests signing artifacts.

  2. The node returns the signing artifacts, which include the current nonce of the sender's address (whitelisted address with at least one active workflow).

  3. The sender signs the provided signing artifacts along with the request payload and attaches the signature to the request.

  4. Nerif Network verifies the signature against the current nonce and payload. If the verification is successful, the network processes the request.

Create Workflow

To create a workflow, you need to provide a valid workflow configuration that includes a list of steps, the owner address, and a signature of the provided signing artefacts. The receiving node verifies and validates the request before broadcasting it to the network. If the workflow is invalid, an error is returned, and it is not broadcasted to the network.

Before creating a workflow within the Nerif Network, it is necessary for the user to register the workflow through the Registry contract function “registerWorkflow”. This registration process ensures that the workflow is properly recorded and recognized within the network. Once the workflow is registered, it can be created and utilized within the Nerif Network.

Get Existing Workflow

This endpoint retrieves an existing workflow based on its ID. The workflow can be either publicly available or private. For private workflows, the default ownership verification mechanism is used.

Manually Execute Workflow

This endpoint allows the workflow owner to trigger the execution of an existing active workflow. Only the workflow owner can initiate this action using the default ownership verification mechanism.

Please note that manual workflow execution is only available for workflows that have the manual execution trigger.

PreviousAPINextOn-chain APIs

Last updated 1 year ago