Quick Start Guide

Anyone can submit an agent application to the on-chain APRO contract. Once the agent application is approved, the APRO contract will create an agent for you, which can be used for data signature verification. The signature verification data will undergo consensus in APRO's agent consensus system. You can also query your agent list, agent verification data, and other information through the APRO agent explorer. Similarly, you can use these verification data in the target agent.

This guide explains how to apply for an agent, verify data, and query data.

1、Submit an agent application

Prepare an EVM EOA address and call the agent creation application. Similarly, you can use our provided SDK to complete this task. As an example of directly calling the contract:

Call the registerAgent interface of the AgentProxy.

function createAndRegisterAgent(Common.AgentSettings memory agentSettings)
//For example, fill in the data as follows:
{
  [
    '0x4b1056f5XXX32c67XXXb5Ae812936249c40AfBF',
    '0xB973476eXXX88a36XXX14b99f230CEB5A01ac686',
  ], // signers, each signer consists of 128 characters
  2, // threshold
  '0x0000000000000000000000000000000000000000', // converterAddress
  { // agentHeader
    '1.0', // version
    '31ef7297-e5fd-4ebb-ac20-21f4b7fe285e', // messageId
    '54db0b59-453a-4de8-bd03-2d5784b8a2ce', // sourceAgentId
    'Apro Test', // sourceAgentName
    '8cc3f595-2681-4786-8cfb-283b03a0dcd0', // targetAgentId
    1735635479, // timestamp
    2, // messageType
    1, // priority
    3600 // ttl
  }
}

Field Description

  • priority

    • priority=0 High

    • priority=1 Medium

    • priority=2 Low

  • MessageType

    • MessageType=0 Request

    • MessageType=1 Response

    • MessageType=2 Event (Currently, only Event is supported.)

2、Agent review

Contact the APRO developers and wait for the APRO agent review system to conduct the review.

3、View agent information

Once approved, you can query the relevant agent information in the agent explorer.

4、Verify the agent data

Call the verify interface of the AgentProxy

function verify(address agent,bytes32 settingsDigest,Common.MessagePayload memory payload)

Parameter Description:

  • agent: The address generated during Agent registration

  • settingsDigest: Call the getAgentConfigs interface of the AgentManager

The first value in the obtained array is the settingsDigest, and there may be multiple arrays. When initiating data validation, if the data satisfies the signer under settingsDigest, the validation will be successful.

function getAgentConfigs(address agent)
  • payload Data to be validated.

payload : 
{
  '0xXXXXXX',  // data
  '0xXXXXXX',  // dataHash
  {  // proofs
    '0x',  // zkProof
    '0x',  // merkleProof
    '0xXXXXXX'  // signatureProof
  },
  {  // metadata
    '0x',  // contentType
    '0x',  // encoding
    '0x'   // compression
  }
}
  • payload.dataHash

  1. If registering an agent and the specified converterAddress is 0x0000000000000000000000000000000000000000, the dataHash is the Keccak-256 hash of the data.

  2. If registering an agent and the specified converterAddress is not 0x0000000000000000000000000000000000000000, the dataHash is the Keccak-256 hash of the value obtained from the converter method in the converterAddress.

  • payload.proofs

  1. zkProof (default is 0x), merkleProof (default is 0x), signatureProof.

  2. Currently, only signatureProof is supported, which is an ABI-encoded string. It is extracted from the signer’s signature, where each signature consists of 128 characters.

  3. Split each signature string into the r and s parts, where r is the first 64 characters and s is the last 64 characters. rawRs and rawSs store all the r and s parts of the signatures, respectively.

  4. recoveryIds is a comma-separated list of numbers, where each number represents a recovery identifier. Convert each recovery identifier (v) to a numeric form and store it in the rawVs array, then convert it to hexadecimal.

  5. Finally, return an ABI-encoded string containing three arrays: rsArray (the r parts), ssArray (the s parts), and vArray (the recovery identifiers v).

  • payload.metadata

  1. contentType, encoding, compression Default is 0x.

5、Data query interface

{
    "message": "success",
    "result": {
        "content": [
            {
                "chain": "bscTest",
                "header": "0a03312e30122464653639373433382d396634362d346561352d393631362d3764383534376566646635611a2438353435336236312d653462322d343035312d623331322d306436666335646563653635222437393230323239642d613239322d346638632d386364362d33383038383330343662653328f5c3cebb065001580160901c720d4170726f2054657374204f6e65",
                "raw": "0a93010a03312e30122464653639373433382d396634362d346561352d393631362d3764383534376566646635611a2438353435336236312d653462322d343035312d623331322d306436666335646563653635222437393230323239642d613239322d346638632d386364362d33383038383330343662653328f5c3cebb065001580160901c720d4170726f2054657374204f6e6512be030a600006e706c0000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000022000000009a020590c959853e804d2247592f8ae1ad56c0743b827acf46d78b75adc2942c12209e7d9cb4c54dba7046afa55deb42888deb61cd78590c8e80b7a83036fe76b0f51aa3021aa002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000019a020590c959853e804d2247592f8ae1ad56c0743b827acf46d78b75adc2942c0000000000000000000000000000000000000000000000000000000000000001000000000000000e804d2247592f8ae1ad56c0743b827acf46d78b75adc2942c0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000022120a04333037381204333037381a043330373818b580d5bb06",
                "slot": 1,
                "index": 18,
                "sourceAgentId": "85453b61-e4b2-4051-b312-0d6fc5dece65",
                "messageType": 2,
                "payloadData": {
                    "data": "0006e706c0000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000022000000009a020590c959853e804d2247592f8ae1ad56c0743b827acf46d78b75adc2942c",
                    "dataHash": "9e7d9cb4c54dba7046afa55deb42888deb61cd78590c8e80b7a83036fe76b0f5",
                    "proofs": {
                        "zkProof": "",
                        "merkleProof": "",
                        "signatureProof": "000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000019a020590c959853e804d2247592f8ae1ad56c0743b827acf46d78b75adc2942c0000000000000000000000000000000000000000000000000000000000000001000000000000000e804d2247592f8ae1ad56c0743b827acf46d78b75adc2942c00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000"
                    },
                    "metadata": {
                        "contentType": "0x",
                        "encoding": "0x",
                        "compression": "0x"
                    }
                },
                "verificationData": {
                    "signatures": [
                        {
                            "signer": "0x19e7e376e7c213b7e7e7e46cc70a5dd086daff2a",
                            "signature": "eadc71c09888b93b4b8b56454470bf0d675b3224df507c6ac7c7e79b0f78afa2664800682c607482e4187231f56427979898114b6d9874be31f220fa60fbfd731b",
                            "hash": "dcd7823e6d56f0659136d71e2ec5999bf6edefbe20633f1a580306966f72a79b",
                            "timestamp": 1735737397
                        },
                        {
                            "signer": "0x1563915e194d8cfba1943570603f7606a3115508",
                            "signature": "21c11b07a651a104386a556379a825f0bbb840d5f06f6552ca082c06789e7ca11ac8ec08795e7df40d5f839c269a254448733139bf2f89f0baaa5b675a75dbda1c",
                            "hash": "dcd7823e6d56f0659136d71e2ec5999bf6edefbe20633f1a580306966f72a79b",
                            "timestamp": 1735737397
                        },
                        {
                            "signer": "0x5cbdd86a2fa8dc4bddd8a8f69dba48572eec07fb",
                            "signature": "fc05fe55bbe9d7df3500bf15024d4da99cccf920680c24a146908aca34553d5720cbae220d1e04fe9a2c5a977ed85508a7c13a8d312b349278d18016d35b24911b",
                            "hash": "dcd7823e6d56f0659136d71e2ec5999bf6edefbe20633f1a580306966f72a79b",
                            "timestamp": 1735737397
                        },
                        {
                            "signer": "0x7564105e977516c53be337314c7e53838967bdac",
                            "signature": "06b3c9ee968f80ae88beac5e588bc3f0a949bc492d5f01d8f46abae86e3aab6f04f6764cad50f6c10cc83012761fe918fa78ecf5a6c0917b708e191f5f846ee21c",
                            "hash": "dcd7823e6d56f0659136d71e2ec5999bf6edefbe20633f1a580306966f72a79b",
                            "timestamp": 1735737397
                        },
                        {
                            "signer": "0xe1fae9b4fab2f5726677ecfa912d96b0b683e6a9",
                            "signature": "99f33051e48835b094bc20e1c4f2a8c9fe3b1afae4f1c3b46381a40f6f3dcb2247afc7c303fe3b773623e0bfaea1ba6fb245e08a6f0899083d57613f07eed1411b",
                            "hash": "dcd7823e6d56f0659136d71e2ec5999bf6edefbe20633f1a580306966f72a79b",
                            "timestamp": 1735737397
                        } ,
                   //....
                    ]
                }
            }
        ]
    },
    "code": 0
}

Supported chains: BNB Smart Chain (TestNet)

BNB Smart Chain Testnet AgentProxy: 0x5E787A4131Cf9fC902C99235df5C8314C816DA11 AgentManager: 0x0951bA1BbC1632Fd3B6C8A93e71B4Db3ad5350bC

Last updated