Confidential inputs
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: "link to the download the Generator enclave image",
inputOuputVerifierUrl: "can be left blank (only applicable for Markets with no confidential inputs)",
};
const marketBytes = Buffer::from(JSON.stringify(marketSetupData), "utf-8");
const tx = await kalypso.MarketPlace().createPrivateMarket(marketBytes, wrapperAddress, slashingPenalty, proverImagePcrs);
console.log("Market Creation Receipt hash", tx.hash);
where
- marketBytes = Metadata related to the Market. Market Creators are advised to provide links to download the Generate enclave image and other metadata associated with 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
- proverImagePcrs = PCRs of Generator 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.