# Communication I: Understanding XRPL(d) RPC Architecture

### Module Overview

The RPC (Remote Procedure Call) layer is the primary interface through which applications, wallets, and developers interact with the XRP Ledger: without it, querying balances, submitting transactions, or monitoring network state would be impossible.

In this module you dissect how rippled handles RPC requests (handler architecture, request flow, authentication, error handling) and gain the foundational knowledge needed to implement custom RPC handlers in the next module. By the end you will understand how API requests traverse the system from entry point to response.

***

### Explore the Topics

This deep dive is organized into focused topics, each exploring a critical component of the RPC architecture. Click on any topic below to dive deeper into the concepts, codebase structure, and practical implementations.

***

### What You Will Learn

By completing this module, you will be able to:

* Understand RPC handler architecture and how handlers are registered, discovered, and dispatched
* Trace the complete journey of an RPC request from entry point through processing to response
* Comprehend authentication and authorization with role-based access control (ADMIN, USER, IDENTIFIED, PROXY, FORBID)
* Analyze error handling patterns and how Rippled validates input and returns proper error responses
* Navigate the RPC codebase and locate key components within the RPC system

These skills are essential for building applications on XRPL, debugging RPC issues, and contributing to the Rippled codebase.

***

#### 📋 RPC Handler Architecture

**Understanding Handler Registration and Dispatch**

Learn how RPC handlers are registered in Rippled's central handler table, how requests are routed to the appropriate handler, and how versioning enables protocol evolution.

**Key Topics**: Handler registration, central dispatcher, request routing, handler table management

**Codebase**: `src/xrpld/rpc/detail/Handler.cpp`

[Explore RPC Handler Architecture →](/core-dev-bootcamp/module06/rpc-handler-architecture.md)

***

#### 🔄 Request and Response Flow

**From Entry Point to Response**

Master the complete journey of an RPC request, from HTTP/WebSocket/gRPC entry points through parsing, validation, context construction, processing, and response serialization.

**Key Topics**: Entry points, request parsing, context objects, response formatting, request lifecycle

**Codebase**: `src/xrpld/rpc/`

[Explore Request and Response Flow →](/core-dev-bootcamp/module06/request-response-flow.md)

***

#### 🔐 Authentication and Authorization

**Role-Based Access Control**

Discover how Rippled determines user roles, enforces permissions, applies resource limits, and implements IP-based restrictions to secure the RPC interface.

**Key Topics**: Role determination, permission enforcement, resource charging, IP restrictions, security patterns

**Codebase**: `src/xrpld/core/Config.h`, `src/xrpld/rpc/`

[Explore Authentication and Authorization →](/core-dev-bootcamp/module06/authentication-authorization.md)

***

#### ⚠️ Error Handling and Validation

**Robust Error Management**

Understand how Rippled handles errors comprehensively, maps errors to HTTP status codes, sanitizes input, masks sensitive data, and formats error responses.

**Key Topics**: Error codes, HTTP status mapping, input sanitization, data masking, error response formats

**Codebase**: `src/xrpld/rpc/detail/RPCErrors.h`

[Explore Error Handling and Validation →](/core-dev-bootcamp/module06/error-handling-validation.md)

***

## Knowledge Check

**Review and Reinforce Your Understanding**

Take a few minutes to review key concepts from this module.

From handler registration and request flow to authentication patterns and error handling, this short quiz will help you confirm your understanding of XRPL's RPC architecture.

[Ready? Let's Quiz →](https://xrpl.at/cdbc-quiz06)

***

## Questions

If you have any questions about the module or would like us to review your work, feel free to contact us.

[Submit Feedback →](https://docs.google.com/forms/d/e/1FAIpQLSe7qIbqepUKGVJxmWFHv0rs1zsBAzk8G6y5-bfz0Yd5rqW_5A/viewform)

***

➡️ **Next Module**: Communication II - [Building and Integrating Custom RPC Handlers →](/core-dev-bootcamp/module07.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.xrpl-commons.org/core-dev-bootcamp/module06.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
