Manage API

If a Manager API’s role is solely focused on managing the cohort's foundational information, membership, and identity to provide snapshot rollup data to the Prover, it does not strictly need to follow the Protocol outlined on this page. Manager APIs may adopt more flexible permission structures, alternative verification methods, or even entirely different protocols depending on the provider. The descriptions below refer to the default Manager API as implemented by the Silicon development team.

  • Required Permissions: Owner of the Cohort NFT item on the Silicon Network.

  • Permission Verification: An HTTP header authorization containing the signature from the Cohort Item owner on keccak256(request.body), valid within N seconds from the timestamp (N = 30 seconds).

Add Members to a Cohort

POST /cohort/{cohortId}/member/add

  • Adds an address to a specific cohort. If the address is already included, only its Weight is updated.

// request
{
  "validUntil": 1718266039,
  "members":{
    "0x0000000000000000000000000000000000000400":1,
    "0x0000000000000000000000000000000000000500":2
  },
  "signature": "0xabcsafbasdb..."
}

// response
{
  "statusCode": 200,
  "data": affectedRowCount
}

Removing Members from a Cohort:

POST /cohort/{cohortId}/member/remove

  • Removes a specified address from a cohort. If the address does not exist in the cohort, the action is ignored.

POST /cohort/{cohortId}/member/remove/all

  • Removes all members from a cohort. If the address does not exist in the cohort, the action is ignored.

Adding or Removing Identity Mapping in a Cohort

POST /identity/update

  • Maps an actual EOA to an address (Identity) within a specified cohort and submits a signature for the mapping.

  • This function operates independently of the snapshot preparation status.

  • Updating signatures for addresses not currently in the cohort is also supported.

  • If a new signature is received and is valid, it will overwrite any previous signature (e.g., EOA change).

  • To delete a signature, set the EOA to the 0x0 address and submit a signed message. However, to prevent the reuse of a previous signature, it’s recommended to process it as a revocation.3

signature

The signature is signed as follows. This signature is used by the AirdropContract, which verifies it through the code below when collecting an ExtraSignature for airdrop targeting this cohort.

  • Silicon Chain Cohort NFT Verification Code

  • Each identity signature example

Request & Response

Preparing a Cohort Snapshot

POST /cohort/{cohortId}/snapshot/initialize

  • Confirms nonce 0 snapshot data for a Cohort with a specified Hash and generates a snapshot.

POST /cohort/{cohortId}/snapshot/prepare

  • Requests the necessary information to create a finalized snapshot of the addresses currently under management. This is only possible if the RootHash for the Cohort item is generated.

Confirmation of Cohort Snapshot

POST /cohort/{cohortId}/snapshot/submit

  • Signatures for a pending snapshot are submitted via prepare, finalizing the snapshot data and storing the rollup data.

Signature

The signature is generated based on the signatureInfo provided in prepare, as shown below.

  • Reference: Silicon Network Cohort NFT verification code

  • Example of a rollup signature

Request & Response

Last updated

Was this helpful?