This document defines the requirements for a Relay Server that facilitates communication between the Agent Pocket Extension and external applications (DApps).
The server acts as a message broker. It routed authenticated JSON-RPC requests to Wallet Users.
Senders MUST wrap their payload in an Authenticated Envelope.
{
"target": "0xTargetWalletAddress",
"payload": {
"protocol": "ed25519/v1",
"data": {
"nonce": 123,
"method": "...",
"params": [...]
},
"auth": {
"pubkey": "ed25519_pubkey_hex",
"signature": "ed25519_sig_hex"
}
}
}- Routing: Server looks up the socket for
targetaddress. - Passthrough:
- The Server DOES NOT verify the Ed25519 signature (that is the Wallet's job).
- The Server simply forwards the
payloadobject to the target wallet.
- Error Handling:
- If
targetis not connected, return error to Sender.
- If
Wallets MUST sign their responses to prove origin.
- Wallet Response:
{ "protocol": "eth/v1", "data": { "nonce": 123, "result": "..." }, "auth": { "address": "0xWalletAddress", "signature": "0xEthSignature..." } } - Server Action: Forward the response back to the original Sender.
- Replay Protection: The Server is not responsible for replay protection; the Wallet handles nonces.
- Privacy: The Server sees the
targetaddress and the payload content.