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.
For Source Agent Developer
If you are a source agent developer, you can follow these steps to submit 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
Highpriority=1
Mediumpriority=2
Low
MessageType
MessageType=0
RequestMessageType=1
ResponseMessageType=2
Event (Currently, only Event is supported.)
2、Agent review and approve
Contact the Attps developers and wait for the Attps agent review system to conduct the review and approve.
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
If registering an agent and the specified
converterAddress
is0x0000000000000000000000000000000000000000
, thedataHash
is the Keccak-256 hash of thedata
.If registering an agent and the specified
converterAddress
is not0x0000000000000000000000000000000000000000
, thedataHash
is the Keccak-256 hash of the value obtained from theconverter
method in theconverterAddress
.
payload.proofs
zkProof
(default is0x
),merkleProof
(default is0x
),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
ands
parts, wherer
is the first 64 characters ands
is the last 64 characters.rawRs
andrawSs
store all ther
ands
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 therawVs
array, then convert it to hexadecimal.Finally, return an ABI-encoded string containing three arrays:
rsArray
(ther
parts),ssArray
(thes
parts), andvArray
(the recovery identifiersv
).
payload.metadata
contentType, encoding, compression Default is
0x
.
For Target Agent Developer
If you are a target agent developer, you can utilize the following interface to read the data
Currently, there is a price source agent (APRO Data Pull)whose agent id is 'b660e3f4-bbfe-4acb-97bd-c0869a7ea142' . It provides the latest price of BTC every five minutes. You can use the following interface for testing.
You can utilize the SDK to parse the data (always the payloadData.data field) from the source agent. The parser code can be found here.
1、Data query interface
Method: GET
Params
A slot is a continuously incrementing data structure, akin to the concept of a block number. The larger the slot, the more recent the data it typically represents.
Response structure
{
"message": "success",
"result": {
"content": [
{
"chain": "bscTest",
"header": "0a03312e30122461613336326433632d663830372d346631632d616331302d6261396133343433303832331a2462363630653366342d626266652d346163622d393762642d63303836396137656131343222013128ada3cebb0650025801600a720e4150524f20446174612050756c6c",
"raw": "0a700a03312e30122461613336326433632d663830372d346631632d616331302d6261396133343433303832331a2462363630653366342d626266652d346163622d393762642d63303836396137656131343222013128ada3cebb0650025801600a720e4150524f20446174612050756c6c12e10a0aa0060006e706cf7ab41fa599311eb3de68be869198ce62aef1cd079475ca50e5b3f60000000000000000000000000000000000000000000000000000000006f33118000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a0010001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200003665949c883f9e0f6f002eac32e00bd59dfe6c34e92a91c37d6a8322d64890000000000000000000000000000000000000000000000000000000067c03e8d0000000000000000000000000000000000000000000000000000000067c03e8d000000000000000000000000000000000000000000000000000003af9b60173000000000000000000000000000000000000000000000000004db7325476300000000000000000000000000000000000000000000000000000000000067c1900d000000000000000000000000000000000000000000001249a1f7b07298b80000000000000000000000000000000000000000000000001249a0f235a339400000000000000000000000000000000000000000000000001249a7a84d467ea1000000000000000000000000000000000000000000000000000000000000000000032e447f02f51be9f5ecb7f2e0a9e8e12d3fd05d39bb645a5281ea24dfb88ff654cd0364b17ca58991797d4ea5c9fdb97d165703b394effe78b859d2902403f6dcdc3a89d4d57de3911ff4bd0166c4932dc29c7e94152902dc46c8a317481bf13e00000000000000000000000000000000000000000000000000000000000000034ff70fe5b1c884af935c4733b61dc60d0280e2514945931b3291539f034b76df08e9f1ab91e0f466079f9a73ff1b18ec1034091b0995bf608edd821a60e1ee124c8c7e74d160e4b1475807a29a87fc2472828e1c22f5b041a48d609a871425b01220755d2752493390d7e5327ba0f241a06316984a73c2514ecf2ac82ea409bc56fe1ae3031ae003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000032e447f02f51be9f5ecb7f2e0a9e8e12d3fd05d39bb645a5281ea24dfb88ff654cd0364b17ca58991797d4ea5c9fdb97d165703b394effe78b859d2902403f6dcdc3a89d4d57de3911ff4bd0166c4932dc29c7e94152902dc46c8a317481bf13e00000000000000000000000000000000000000000000000000000000000000034ff70fe5b1c884af935c4733b61dc60d0280e2514945931b3291539f034b76df08e9f1ab91e0f466079f9a73ff1b18ec1034091b0995bf608edd821a60e1ee124c8c7e74d160e4b1475807a29a87fc2472828e1c22f5b041a48d609a871425b0000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000122340a1e363137303730366336393633363137343639366636653266363136323639120836653735366336631a08366537353663366318a1fd80be06",
"slot": 18100,
"index": 0,
"sourceAgentId": "b660e3f4-bbfe-4acb-97bd-c0869a7ea142",
"messageType": 2,
"payloadData": {
"data": "0006e706cf7ab41fa599311eb3de68be869198ce62aef1cd079475ca50e5b3f60000000000000000000000000000000000000000000000000000000006f33118000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a0010001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200003665949c883f9e0f6f002eac32e00bd59dfe6c34e92a91c37d6a8322d64890000000000000000000000000000000000000000000000000000000067c03e8d0000000000000000000000000000000000000000000000000000000067c03e8d000000000000000000000000000000000000000000000000000003af9b60173000000000000000000000000000000000000000000000000004db7325476300000000000000000000000000000000000000000000000000000000000067c1900d000000000000000000000000000000000000000000001249a1f7b07298b80000000000000000000000000000000000000000000000001249a0f235a339400000000000000000000000000000000000000000000000001249a7a84d467ea1000000000000000000000000000000000000000000000000000000000000000000032e447f02f51be9f5ecb7f2e0a9e8e12d3fd05d39bb645a5281ea24dfb88ff654cd0364b17ca58991797d4ea5c9fdb97d165703b394effe78b859d2902403f6dcdc3a89d4d57de3911ff4bd0166c4932dc29c7e94152902dc46c8a317481bf13e00000000000000000000000000000000000000000000000000000000000000034ff70fe5b1c884af935c4733b61dc60d0280e2514945931b3291539f034b76df08e9f1ab91e0f466079f9a73ff1b18ec1034091b0995bf608edd821a60e1ee124c8c7e74d160e4b1475807a29a87fc2472828e1c22f5b041a48d609a871425b0",
"dataHash": "755d2752493390d7e5327ba0f241a06316984a73c2514ecf2ac82ea409bc56fe",
"proofs": {
"zkProof": "",
"merkleProof": "",
"signatureProof": "000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000032e447f02f51be9f5ecb7f2e0a9e8e12d3fd05d39bb645a5281ea24dfb88ff654cd0364b17ca58991797d4ea5c9fdb97d165703b394effe78b859d2902403f6dcdc3a89d4d57de3911ff4bd0166c4932dc29c7e94152902dc46c8a317481bf13e00000000000000000000000000000000000000000000000000000000000000034ff70fe5b1c884af935c4733b61dc60d0280e2514945931b3291539f034b76df08e9f1ab91e0f466079f9a73ff1b18ec1034091b0995bf608edd821a60e1ee124c8c7e74d160e4b1475807a29a87fc2472828e1c22f5b041a48d609a871425b00000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
},
"metadata": {
"contentType": "application/abi",
"encoding": "null",
"compression": "null"
}
},
"verificationData": {
"signatures": [
{
"signer": "0x19e7e376e7c213b7e7e7e46cc70a5dd086daff2a",
"signature": "2fdd1923789dc07f43709e0056fc3c9a19ed1b5a283727bb2da1f0b8ad9333b945a2fe43a83d48aa3f534ba0b3effc6c5bd4600fb5c2496f2d3f60afa3d2fd081b",
"hash": "43a85c7e11907517d9b762ed2352514d2ff3b2f286c5511a1509f55e307e1ae9",
"timestamp": 1740652193
},
{
"signer": "0x1563915e194d8cfba1943570603f7606a3115508",
"signature": "c4fb6156862bb81c62c63d351525d6615a310ff27b90359689487f965341e8fc3997ace60dc9b86331467430c7f7cc75c569ddbfb006c2ebd6e3b8425acfc8ff1c",
"hash": "43a85c7e11907517d9b762ed2352514d2ff3b2f286c5511a1509f55e307e1ae9",
"timestamp": 1740652193
},
{
"signer": "0x5cbdd86a2fa8dc4bddd8a8f69dba48572eec07fb",
"signature": "e362709088b5eff0185481e767dade72cd694bf9925c7f9409639ec3a98ebd763d7d4869f620a598eb2e768b902028efc2c393809987cb78ca1ca09b0bcb0ee81b",
"hash": "43a85c7e11907517d9b762ed2352514d2ff3b2f286c5511a1509f55e307e1ae9",
"timestamp": 1740652193
},
{
"signer": "0x7564105e977516c53be337314c7e53838967bdac",
"signature": "c078597073c4310f10c7276ec1c3bf304110264fe733480b03ae271b9b864ad057a7c443a3e3601243438854ce38712d153b4ce87b3f00d7464f32d9ad4172a91b",
"hash": "43a85c7e11907517d9b762ed2352514d2ff3b2f286c5511a1509f55e307e1ae9",
"timestamp": 1740652193
},
{
"signer": "0xe1fae9b4fab2f5726677ecfa912d96b0b683e6a9",
"signature": "79d8a47287c5e1c2df3b096d6f2ad3e11b399cd065bd6aab1aaff491dc2854397a2af2c60c2cafedd185f1bef6d7c4deb07978d3fc7140d5e2e901fdad71d6d51b",
"hash": "43a85c7e11907517d9b762ed2352514d2ff3b2f286c5511a1509f55e307e1ae9",
"timestamp": 1740652193
}
]
}
},
{
"chain": "bscTest",
"header": "0a03312e30122461613336326433632d663830372d346631632d616331302d6261396133343433303832331a2462363630653366342d626266652d346163622d393762642d63303836396137656131343222013128ada3cebb0650025801600a720e4150524f20446174612050756c6c",
"raw": "0a700a03312e30122461613336326433632d663830372d346631632d616331302d6261396133343433303832331a2462363630653366342d626266652d346163622d393762642d63303836396137656131343222013128ada3cebb0650025801600a720e4150524f20446174612050756c6c12e10a0aa0060006e706cf7ab41fa599311eb3de68be869198ce62aef1cd079475ca50e5b3f60000000000000000000000000000000000000000000000000000000006f34011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a0000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200003665949c883f9e0f6f002eac32e00bd59dfe6c34e92a91c37d6a8322d64890000000000000000000000000000000000000000000000000000000067c03fb90000000000000000000000000000000000000000000000000000000067c03fb9000000000000000000000000000000000000000000000000000003af31afa65c00000000000000000000000000000000000000000000000004db7325476300000000000000000000000000000000000000000000000000000000000067c1913900000000000000000000000000000000000000000000124bae90e2848cb1400000000000000000000000000000000000000000000000124bab3631a5fa7b000000000000000000000000000000000000000000000000124baeb962c1e321c0000000000000000000000000000000000000000000000000000000000000000003ad86b5e38c9cfe0bebb64037f9b2ccb3128fc2ac74f21315b1fa9f42d163a68b9b6afe253d7a29292ecd3318741ba55cc2e83329e5e2b9e97713a28768fa753a829b84b3297391ea617e736019dea96fca70022ca10d7b0a7bd5043e6f15149000000000000000000000000000000000000000000000000000000000000000032c8291ca016398eb9cde64f4e66207e0a69e8600e8db060ba50cd6f55895ec9d7e779c6a21f7346025ded32eeea267522bcd12634ae73e776ccc22c0939a50fe27c75c9ce60195d5e0cc6ed86383909874d24a76ab8d0b3b524fcde5d5844ded12202aafd915ee3dc1508fa9736dd4ec1df84ac6115bb45cef771d6f36ca4cf624481ae3031ae003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000003ad86b5e38c9cfe0bebb64037f9b2ccb3128fc2ac74f21315b1fa9f42d163a68b9b6afe253d7a29292ecd3318741ba55cc2e83329e5e2b9e97713a28768fa753a829b84b3297391ea617e736019dea96fca70022ca10d7b0a7bd5043e6f15149000000000000000000000000000000000000000000000000000000000000000032c8291ca016398eb9cde64f4e66207e0a69e8600e8db060ba50cd6f55895ec9d7e779c6a21f7346025ded32eeea267522bcd12634ae73e776ccc22c0939a50fe27c75c9ce60195d5e0cc6ed86383909874d24a76ab8d0b3b524fcde5d5844ded000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000122340a1e363137303730366336393633363137343639366636653266363136323639120836653735366336631a08366537353663366318ccff80be06",
"slot": 18101,
"index": 0,
"sourceAgentId": "b660e3f4-bbfe-4acb-97bd-c0869a7ea142",
"messageType": 2,
"payloadData": {
"data": "0006e706cf7ab41fa599311eb3de68be869198ce62aef1cd079475ca50e5b3f60000000000000000000000000000000000000000000000000000000006f34011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a0000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200003665949c883f9e0f6f002eac32e00bd59dfe6c34e92a91c37d6a8322d64890000000000000000000000000000000000000000000000000000000067c03fb90000000000000000000000000000000000000000000000000000000067c03fb9000000000000000000000000000000000000000000000000000003af31afa65c00000000000000000000000000000000000000000000000004db7325476300000000000000000000000000000000000000000000000000000000000067c1913900000000000000000000000000000000000000000000124bae90e2848cb1400000000000000000000000000000000000000000000000124bab3631a5fa7b000000000000000000000000000000000000000000000000124baeb962c1e321c0000000000000000000000000000000000000000000000000000000000000000003ad86b5e38c9cfe0bebb64037f9b2ccb3128fc2ac74f21315b1fa9f42d163a68b9b6afe253d7a29292ecd3318741ba55cc2e83329e5e2b9e97713a28768fa753a829b84b3297391ea617e736019dea96fca70022ca10d7b0a7bd5043e6f15149000000000000000000000000000000000000000000000000000000000000000032c8291ca016398eb9cde64f4e66207e0a69e8600e8db060ba50cd6f55895ec9d7e779c6a21f7346025ded32eeea267522bcd12634ae73e776ccc22c0939a50fe27c75c9ce60195d5e0cc6ed86383909874d24a76ab8d0b3b524fcde5d5844ded",
"dataHash": "2aafd915ee3dc1508fa9736dd4ec1df84ac6115bb45cef771d6f36ca4cf62448",
"proofs": {
"zkProof": "",
"merkleProof": "",
"signatureProof": "000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000003ad86b5e38c9cfe0bebb64037f9b2ccb3128fc2ac74f21315b1fa9f42d163a68b9b6afe253d7a29292ecd3318741ba55cc2e83329e5e2b9e97713a28768fa753a829b84b3297391ea617e736019dea96fca70022ca10d7b0a7bd5043e6f15149000000000000000000000000000000000000000000000000000000000000000032c8291ca016398eb9cde64f4e66207e0a69e8600e8db060ba50cd6f55895ec9d7e779c6a21f7346025ded32eeea267522bcd12634ae73e776ccc22c0939a50fe27c75c9ce60195d5e0cc6ed86383909874d24a76ab8d0b3b524fcde5d5844ded0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
},
"metadata": {
"contentType": "application/abi",
"encoding": "null",
"compression": "null"
}
},
"verificationData": {
"signatures": [
{
"signer": "0x19e7e376e7c213b7e7e7e46cc70a5dd086daff2a",
"signature": "549047f4a3f3ae5fe815ab18472664691cab4ef1ed916502a38f507eb4f6a59f4c2cc592f3b8c271e17cefa78bd5da51e35dfe3318e02e7529ecdf33a25549331b",
"hash": "211ce341e4673efb8802d7ddc11b2077e77d75bc5545eef97ae7cfd2c2bb56b8",
"timestamp": 1740652492
},
{
"signer": "0x1563915e194d8cfba1943570603f7606a3115508",
"signature": "2f0392e7788b7722c2522107d644d18b256924dcf7c58f0f88f1524a38fa23864c3e55b975e298e7b96acdaf0d753ac5e67e561e6aab36ff3addcaf0ba303a0c1b",
"hash": "211ce341e4673efb8802d7ddc11b2077e77d75bc5545eef97ae7cfd2c2bb56b8",
"timestamp": 1740652492
},
{
"signer": "0x5cbdd86a2fa8dc4bddd8a8f69dba48572eec07fb",
"signature": "00455f98307d06d2c743248eb412db9d5c1d43962cfbd1e6b0de4be524ba7af24b63a1cbc1f4112c8c838de950a226a6d3bc8ac38fb8e87c38bcefdeaf36391d1b",
"hash": "211ce341e4673efb8802d7ddc11b2077e77d75bc5545eef97ae7cfd2c2bb56b8",
"timestamp": 1740652492
},
{
"signer": "0x7564105e977516c53be337314c7e53838967bdac",
"signature": "6727fa0ee080b3a3c18f455634ea7b5ffa69f4e50952a690419edda48e2e321276b4a2e08d56370dced454f4883320d58418988eb79015bc2102bd00589f46791b",
"hash": "211ce341e4673efb8802d7ddc11b2077e77d75bc5545eef97ae7cfd2c2bb56b8",
"timestamp": 1740652492
},
{
"signer": "0xe1fae9b4fab2f5726677ecfa912d96b0b683e6a9",
"signature": "6c08b4fe9fafac06bf6e618741893d2d7511b58a60c6860fcc935d4d369cf4647cbe6e9dbc9472eef4f94c566f0dc4022a0f343b2c79484cf8a82fa11b242e941b",
"hash": "211ce341e4673efb8802d7ddc11b2077e77d75bc5545eef97ae7cfd2c2bb56b8",
"timestamp": 1740652492
}
]
}
}
]
},
"code": 0
}
2、Latest slot query interface
Method: GET
Response structure
{
"message": "success",
"result": 19503,
"code": 0
}
3. Display “Verified by ATTPs” on the Frontend Interface
Lastly, please ensure that your product’s frontend interface prominently displays: “Verified by ATTPs”. This will let users know that the data is secure, verifiable, and provided by a trusted third party, enhancing user trust in the data!
Congratulations on completing the integration! If you have any technical questions, feel free to reach out to the APRO team anytime.
Last updated