Skip to main content

Public inputs-only

The following code snippet can help you easily execute the Market Creation contract call:

/kalypso-tutorial/index.ts
    // existing sdk setup

const marketSetupData = {
zkAppName: "name of the Market",
proverCode: "link to an illustrative prover codebase",
verifierCode: "link to the verifier codebase",
proverOysterImage: "can be left blank (only applicable for Markets with confidential inputs)",
inputOuputVerifierUrl: "IVS endpoint",
};

const marketBytes = Buffer::from(JSON.stringify(marketSetupData), "utf-8");
const tx = await kalypso.MarketPlace().createPublicMarket(marketBytes, wrapperAddress, slashingPenalty, ivsImagePcrs);
console.log("Market Creation Receipt hash", tx.hash);

where

  • marketBytes = Metadata related to the Market
  • wrapperAddress = Contract Address of the Proof Verifier
  • slashingPenalty = Number of tokens to be slashed from a Generator's stake when it fails to produce a proof for any Request within the committed time
  • ivsImagePcrs = PCRs of IVS enclave image created earlier
note

slashingPenalty is to be decided by the Market Creator based on the security gaurantees required.

Once the transaction has been broadcasted, you can check the transaction logs on a block explorer to find the market ID. This market ID is unique to every Market.