LogoLogo
Go to SiliconJoin Telegram 💬
  • About
    • Silicon Overview
      • Features
      • Missions
    • Silicon identity protocol
  • Users
    • Wallet configuration
    • Bridge
      • Deposit to Silicon
      • Withdrawal from Silicon
    • Block explorer
    • Fees
  • Builders
    • Build on Silicon
    • Build on OpenCohort & NamedWallet
      • Contract
        • OpenNameTag
        • Account Abstraction
      • Framework
        • Merkle Tree & Merkle Proof
        • Participants
        • Components Overview
        • Address & Identity
        • Use Case
        • Developer
          • Cohort
          • Protocol
            • Base API
            • Manage API
            • Prover API
          • Airdrop
            • Reward Type
          • Play OpenCohort
          • Named Wallet
        • Public Prover Lists
    • Network information
    • zkEVM contracts
    • Testnet
      • Setup
      • Faucet
      • Bridge
      • Block Explorer
      • zkEVM Testnet Contracts
  • Support
    • Contact Silicon
    • Silicon quick guide
  • More
    • Brand
    • Security
    • Terms of use
    • Privacy Policy
    • Open Source License
  • External Links
    • Polygon CDK
    • Polygon zkEVM
  • Agglayer
Powered by GitBook
LogoLogo

Sites

  • Silicon
  • Scope
  • Bridge

Community

  • X
  • Medium
  • Telegram

Developers

  • Testnet Scope
  • Testnet Bridge

Copyright Silicon(Highdraw). All Rights Reserved.

On this page
  • API Signatures
  • Basic Response
  • Success
  • Fail
  • Error Message List
  • Basic Validation
  • Basic Method Validation
  • Signature Generation Example

Was this helpful?

  1. Builders
  2. Build on OpenCohort & NamedWallet
  3. Framework
  4. Developer
  5. Protocol

Base API

API Signatures

  • The authorization signature uses 'Ethereum message signing', assuming the ChainID of the relevant chain (e.g., ETH: 1, Silicon Mainnet: 2355).

  • For signatures used in snapshot submissions, verification is conducted using the ETH ChainID of 1 (the ChainID is included in the message).

Basic Response

{
  statusCode: number;
  message: string;
  data: ResponseData;
}

Success


{
	"statusCode": 200
	"data": {},
	"message": "success"
	
}

Fail

{
	"statusCode": 500
	"message": error_message
}

Error Message List

The following are basic error messages. Additional error messages may be present depending on the handling within each method.

Basic Validation

Message
Description

invalid_target

When managerName does not match the name of the requested Manager.

request_timeout

Request timed out.

used_signature

When the signature value has already been processed within the allotted time (to prevent double usage).

invalid_cohort

When the CohortId in the request does not match the CohortId in the requestPath, or if the CohortId is invalid or the cohort does not exist.

invalid_owner

When the owner in the request is missing or does not match the Owner of the CohortId.

invalid_method

When the method is incorrect.

fail_to_authorization

When the authorization signature verified with the hash in the body does not match the Cohort Owner.

Basic Method Validation

Message
Description

invalid_members

When the members field is missing or not in a dictionary format.

exceed_limit

When the number of members being added exceeds the limit per request.

too_many_members

When the total number of members, after attempted additions, exceeds the overall limit.

invalid_address

When one or more addresses in the members field have an incorrect format.

invalid_weight

When the format of the weight in the members field is incorrect (must be an integer between 0 and uint32.max).

pending_snapshot

When an add request is sent during the snapshot prepare status, but a submit is expected.

Signature Generation Example

Example 1

dataHash = keccak256(
		abi.encode(
				[string, address, uint256, address[], address[], bytes[], uint256],
				["OpenCohort:UpdateIdentity", cohort, chainId, identityList, addressList, signatureList, validUntil]
		)
);
signingHash = ERC191(dataHash);

Example 2

const {
    cohort,
    chainId,
    cohortId,
    snapshotTime,
    snapshotSignature,
    validUntil
} = dto;

const dataBytes = defaultAbiCoder.encode(
    ['string', 'address', 'uint256', 'uint256', 'uint256', 'bytes', 'uint256'],
    ['OpenCohort:Submit', cohort, chainId, cohortId, snapshotTime, snapshotSignature, validUntil]
);
const dataHash = keccak256(dataBytes);
const signingBytes = Buffer.concat([
    Buffer.from('\x19Ethereum Signed Message:\n32', 'ascii'),
    Buffer.from(dataHash.replace("0x",""), 'hex')
]);
const signingHash = keccak256(signingBytes);
PreviousProtocolNextManage API

Last updated 6 months ago

Was this helpful?