Logo

    CryptoNet is a Protocol Labs initiative.

    Meeting Notes Sept. 27, 2022

    • Smart Contracts
    • Various IDs in Medusa
    • Demo plan
    • Example run command with config
    • Sismo

    Smart Contracts

    Jonathan to start the refactoring of the smart contract

    • Style
      • Let’s use NatSpec comments
      • Solidity Style Guide
    • Naming
      • snake_case vs. camelCase
      • Rename DKGManager —> DKG
    • Layout
      • DKGFactory creates DKGManagers
        • DKGFactory creates an ID
        • bytes32 dkgId = keccak256(abi.encode(block.chainid, blockhash(block.number - 1)));
      • OracleFactory creates BN128EncryptionOracles
        • And other types in the future
    • Scope of current “sprint” of work
      • No Resharing

    Various IDs in Medusa

    • Suite ID ⇒ represents the cryptographic curve, the parameters of encryption + different encryption schemes (todo)
    • “Request ID + Cipher ID” request id is just a nonce currently
    • “Oracle ID” = oracle contract address (+ chain id + “chain name”)
    • “Protocol ID” ⇒ unique amongst all the chains, all networks, for a given reencryption request.
      • protocol_id = H(dkgID, request_id, suite_id, oracle_id)
      • This is passed in gossip messages
    • “DKG network ID”
      • bytes32 dkgId = keccak256(abi.encode(block.chainid, smart contract address);
      • bytes32 dkgId = keccak256(abi.encode(distributed public key));
      • PRE-DKG:
        • Smart Contract - not a real need
          • ID = H(smart contract address + chain id)
        • HTTP API -
          • ID = H(URL)
      • POST-DKG:
        • in oracle contract, “refer to this DKG ID” → contract/http api where dkg has ran

        Only keep “pre-dkg”

    Demo plan

    • Go with structural changes until 7th of October
    • Then Jonathan works on
      • Demo website deployment (automatic updates from github master)
      • Deployment of the nodes via kubernetes
        • TODO: ask aws accounts
    • Nicolas works on the saving/loading file
      • FOllowing is “static” and common for all nodes
        • only contains oracle address /maybe dkg/
      • Following is per node
        • give ethereum key via CLI
        • DKG share —> THIS IS TO SAVE/LOAD
    • ETHEREUM_KEY=…. testnet node run —oracleAddress 0x… —share share.toml

    Example run command with config

    testnet node run —config config.toml

    [oracle.<address>]
    dkgID = …
    
    [key]
    path = /…/key.ethereum
    
    [[dkg]]
    id = …
    share = /path/share
    
    [[dkg]]
    id = …
    share = /…/
    config.toml

    Sismo

    Sismo ZK-badges potential collab with medusa

    • Use sismo badges as authorization for Medusa encrypted data