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
- POST
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
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:
- GET
/
- Response:
Welcome
- StatusCode: 200
- POST
/checkInput
- Payload:
publicinputs
: An hex stringencryptedsecret
: An hex stringacl
: An hex string
- StatusCodes & Responses:
- 200
- Condition: When
True
- Response:
Ok
- Condition: When
- 400
- Condition: All Other Cases
- Response:
Ok
- 200
- POST
/checkInputWithSignature
- Payload:
publicinputs
: An hex stringencryptedsecret
: An hex stringacl
: An hex string
- StatusCodes and Responses:
- 200
- Condition: When
True
- Response:
askid
: int_stringsignature
: hex_string
- Condition: When
- 400
- Condition: All Other Cases
- Response:
Ok
- 200
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.