Skip to main content

IVS

The section explains how to create an IVS image. This is required only when the marketplace is a public marketplace i.e. the marketplace has no confidential inputs. You can skip to next section if required.

1. Clone a template repo

Run the following command to clone a template enclave prover into kalypso-enclave-setups and navigate into the input-verifier directory:

git clone https://github.com/marlinprotocol/kalypso-enclave-setups.git & cd kalypso-enclave-setups/input-verifier

The kalypso-enclave-setups/input-verifier directory should contain the following files:

...
...
Dockerfile
setup.sh
zkb_input_verifier
...
...
  • Wrap IVS code into a server. zkapp_input_verifier should expose endpoint
    • POST /checkInput
    • POST /checkInputWithSignature

Why IVS is required?

IVS is a specific enclave for dispute resolution and can be operated by anyone. For public markets, IVS is mandatory.

Components

Components

Implementing your own IVS

To Implememt you own IVS you need to create your own "Input Verification Service Server" (IVS Server) in any language of your choice and replace it in the template

What to Implement in IVS Server?

On your IVS Server, should be an executable that must implement these 3 routes:

  1. GET /
  • Response: Welcome
  • StatusCode: 200
  1. POST /checkInput
  • Payload:
    • publicinputs: An hex string
    • encryptedsecret: An hex string
    • acl: An hex string
  • StatusCodes & Responses:
    • 200
      • Condition: When True
      • Response: Ok
    • 400
      • Condition: All Other Cases
      • Response: Ok
  1. POST /checkInputWithSignature
  • Payload:
    • publicinputs: An hex string
    • encryptedsecret: An hex string
    • acl: An hex string
  • StatusCodes and Responses:
    • 200
      • Condition: When True
      • Response:
        • askid: int_string
        • signature: hex_string
    • 400
      • Condition: All Other Cases
      • Response: Ok
tip

Once implemented, create a standalone binary of the IVS server that runs inside linux alpine

Now clone the input-verifier template.

git clone https://github.com/marlinprotocol/kalypso-enclave-setups.git & cd kalypso-enclave-setups/input-verifier

The kalypso-enclave-setups/input-verifier directory should contain the following files:

...
...
Dockerfile
setup.sh
zkapp_input_verifier
...
...

Replace the zkapp_input_verifier with your own executable. Ensure that the name is same.