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.
If registering an agent and the specified converterAddress is 0x0000000000000000000000000000000000000000, the dataHash is the Keccak-256 hash of the data.
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
zkProof (default is 0x), merkleProof (default is 0x), signatureProof.
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.
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.
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.
Finally, return an ABI-encoded string containing three arrays: rsArray (the r parts), ssArray (the s parts), and vArray (the recovery identifiers v).