Read the code. Run the idea.
A practical XRPL workspace for developers who want to see the JSON, execute the safe parts, and understand what the open-source server does next.
Change an input. Run the code. Inspect the result.
These examples execute in your browser. The live ledger sample makes a read-only request to a public XRPL server; none of the examples signs or submits a transaction.
const DROPS_PER_XRP = 1_000_000n;
function xrpToDrops(xrp) {
const [whole, fraction = ""] = xrp.split(".");
return (
BigInt(whole) * DROPS_PER_XRP +
BigInt(fraction.padEnd(6, "0"))
).toString();
}
xrpToDrops("12.345678");Run a sample to see its output.From API request to validated ledger.
The production server is primarily C++. These links point into the public repository so an example can be followed into the implementation.
Application wiring
src/xrpld/app/mainThe server constructs the application and connects its network, ledger, database, job-queue, and API subsystems.
RPC boundary
src/xrpld/rpcRead-only and transaction-facing API methods validate parameters, apply access rules, and route requests into server services.
Transaction engine
src/xrpld/app/txTransactions are checked, preflighted, authorized, applied against a ledger view, and assigned result codes.
Consensus
src/xrpld/consensusServers compare candidate transaction sets and close-time proposals; validators additionally publish signed proposals and validations.
Ledger lifecycle
src/xrpld/app/ledgerThe open ledger accepts candidates, consensus establishes the next closed ledger, and validations identify the durable shared history.
What happens after your code runs?
- 01
Construct
Your application creates a case-sensitive transaction object. XRP values are integer drops, and tags are unsigned integers.
- 02
Autofill and sign
A client or wallet adds account state such as Sequence, Fee, and an expiration ledger, then signs locally. Secrets never belong in sample code.
- 03
Submit and apply
An XRPL server checks the signed transaction and tentatively applies it to its open-ledger view. The first response is not final.
- 04
Reach consensus
Servers agree on the candidate set and canonical order for the next ledger; validators publish signed validations.
- 05
Verify
Your application looks up the transaction until validated is true, then reads TransactionResult and delivered_amount from metadata.
Primary references
Examples are intentionally small. Production integrations should follow maintained documentation, handle server failures and pagination, and use a reliable submission process.
Build from a verified foundation.
Continue into the developer curriculum for APIs, subscriptions, pagination, simulation, metadata, and result codes.