Enabling Kate RPC
Kate RPC endpoints are disabled by default. To enable them, start your Avail node with the--enable-kate-rpc flag:
Configuration
The Kate RPC service can be configured through theDeps struct with the following parameters:
The maximum number of cells that can be requested in a single query. This limit applies to
kate_queryProof and kate_queryMultiProof methods.Configure via the --kate-max-cells-size command-line flag.Enable or disable Kate RPC endpoints.Set via the
--enable-kate-rpc flag.Enable metrics collection for Kate RPC calls. Only use if you understand the performance implications.
Available Methods
The Kate RPC API provides the following methods:Query Methods
- kate_queryRows - Query entire rows of the data availability matrix
- kate_queryProof - Query individual cell proofs for data verification
- kate_queryMultiProof - Query optimized multi-proofs for multiple cells
- kate_queryDataProof - Query Merkle proofs for specific transactions
- kate_blockLength - Query block dimensions and parameters
Type Definitions
The Kate RPC API uses the following core types:Rows
Cells
max_cells_size (default 10,000).
Each Cell contains:
row- Row index in the data matrixcol- Column index in the data matrix
Response Types
GRow
GDataProof
- Cell data as a 256-bit scalar
- KZG proof as a 48-byte array
GMultiProof
- Vector of cell data as 256-bit scalars
- Single aggregated KZG proof
GCellBlock
Error Handling
Kate RPC methods return JSON-RPC errors with the following error code:- Error Code 1 (
KateRPCError) - Generic Kate RPC error
"Requested block {hash} is not finalized"- Block must be finalized before querying"Requested block {hash} has empty commitments"- Block contains no data commitments"Cannot query ({n}) more than {max} amount of cells per request"- Exceeds max_cells_size limit"Cannot fetch tx data at tx index {idx} at block {hash}"- Transaction index out of range
Block Finalization Requirement
All Kate RPC methods require the queried block to be finalized. Queries for unfinalized blocks will return an error. This ensures that the returned proofs and commitments are immutable and can be safely relied upon.JSON-RPC Format
All Kate RPC methods use standard JSON-RPC 2.0 format:http://localhost:9944 for HTTP or ws://localhost:9944 for WebSocket connections.
Use Cases
Light Clients
Light clients use Kate RPC to:- Verify data availability without downloading full blocks
- Sample random cells to detect data withholding
- Validate specific transactions using data proofs
Data Availability Sampling
Validators and fishermen use these endpoints to:- Perform DAS (Data Availability Sampling) on committed data
- Generate fraud proofs when detecting invalid commitments
- Reconstruct missing data from available cells
Application-Specific Queries
Applications can:- Query specific transaction data with Merkle proofs
- Verify inclusion of application data in blocks
- Efficiently download only relevant portions of blocks