Skip to main content

Module rpc_response

Module rpc_response 

Source
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. encode signs the request’s pow_content_hash with the server’s private key and embeds the signature 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.
  • 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§

RpcResponsePacketRx
The client-side view of an inbound RPC response, after header parsing, PoW checks, and signature verification.
RpcResponsePacketTx
The encoder for an outbound RPC response.
RpcResponsePacketTxFlags