Expand description
§RPC response packet encode / decode
The outbound-server and inbound-client halves of a response, symmetric to
crate::protocol::rpc::rpc_request:
-
RpcResponsePacketTx— server side.encodepicks a fresh randompow_content_hash_saltand signshash(pow_content_hash_salt || pow_content_hash)with the server’s private key, embedding both the signature and the salt in the header. The signature binds the response to this specific request and this specific server identity, so clients can reject replays across servers or across requests. Payload is optionally compressed.The salt matters:
pow_content_hashis chosen by the caller, and every other server-key signature in the protocol (peers, bundle headers, tokens) is a signature over a 32-byte blake3 digest. Signing the caller’s hash directly would turn every server into a signing oracle for arbitrary structures under its identity key. -
RpcResponsePacketRx— client side. Parses the server-identity fields (verification key, PQ commitment, sponsor id, PoW timestamp, PoW hash, salt) from the header, re-derives the server id PoW to check it is sufficient, and verifies the signature against the request’s content hash — all statelessly, so no peer database is required to validate the response of a freshly-discovered server.
Structs§
- RpcResponse
Packet Rx - The client-side view of an inbound RPC response, after header parsing, PoW checks, and signature verification.
- RpcResponse
Packet Tx - The encoder for an outbound RPC response.
- RpcResponse
Packet TxFlags
Constants§
- RPC_
RESPONSE_ PACKET_ VERSION - Version 2 added
pow_content_hash_saltafter the signature (the signature covershash(pow_content_hash_salt || pow_content_hash)instead of the rawpow_content_hash).