Skip to content

A repository for learning and experimenting with development on the XRP Ledger

Notifications You must be signed in to change notification settings

ibourn/xrpl-training

Repository files navigation

XRPL Training

Exploring XRPL during a two-day development training session thanks to XRP-Commons.
See also: xrpl-evmSidechain.

Table of Contents

Introduction to XRPL

In 2011, David Schwartz, Jed McCaleb, and Arthur Britto, inspired by Bitcoin, aimed to create a superior blockchain that addressed its limitations. They were joined by Chris Larsen, launched the XRP Ledger, and founded the company NewCoin (later renamed OpenCoin, and now known as Ripple) in 2012. The founders endowed Ripple with 80 billion XRP, the native currency of XRPL, most of which is now in escrow. The XRPL Foundation, established on September 24, 2020, is a nonprofit organization dedicated to supporting the development and adoption of the decentralized XRPL. It was initially funded by donations exceeding $6.5M from Coil, Ripple, and Gatehub.

Key Features

  • No Mining Required: All supply is pre-minted. Validators have no rewards but incentives tied to network security or their own service needs.
  • Consensus Mechanism: XRPL utilizes a unique Proof of Association (PoA) consensus mechanism. Currently, there are approximately 120 validators, and anyone can become a validator. Each operator maintains their own Unique Node List (UNL), which is a curated list of trusted validators (35 is the minimum recommended) they believe will not engage in fraudulent activities. An 80% majority of this UNL is necessary to achieve consensus and determine the new XRPL version (new block), including transaction and amendment votes. Approval for UNL status is granted by the independent XRPL Foundation, which evaluates validators' abilities and reliability to prevent system downtime..
  • Performance: Transactions are fast (3-5 seconds to settle), low-cost ($0.0002 per transaction), and scalable (1,500 transactions per second).
  • Eco-Friendliness: The energy-efficient design reduces the environmental impact, addressing the long transaction times, high costs, and excessive intermediaries typical in traditional financial systems.

Operational Specifics

  • There are no rewards on XRPL; however, the network uses calibrated fees that increase with load to prevent spam. These fees are burned rather than collected.
  • Additionally, the creation of an account requires locking 10 XRP as an "account reserve," a security measure to deter spam by making it costly to create multiple accounts.
  • XRPL operates without smart contracts but includes native functionalities.

Developing with XRPL

Developers interact with XRPL through an API, submitting transactions or queries to change or check the ledger state.

XRPL supports various programming languages including Java, PHP, Go, and JavaScript, and protocols like HTTP and WebSocket. Numerous libraries ease the integration of XRPL into applications.

Typical Application Workflow

  1. Creating a Client: Initialize communication with the network.
  2. Connecting to the Network: Establish an active session with XRPL.
  3. Submitting Transactions or Queries: Modify the ledger state as needed.
  4. Disconnecting: Close the session.

Built-in Features

  • CLOB (Central Limit Order Book): Manages liquidity efficiently, operational for over 10 years.
  • AMM (Automated Market Maker): A newer feature complementing CLOB, it helps manage low liquidity situations and facilitates price discovery, giving access to a native DEX for secure peer-to-peer exchanges.
  • Auto Bridging: Utilizes XRP as an intermediary currency to find the best exchange rate between two assets.
  • Path Finding: Finds the best route between assets for the final exchange.
  • Rippling: Describes a process of atomic net settlement between multiple connected parties who have trust lines for the same token. Rippling allows users who hold tokens to send those to each other with the issuer as a passive intermediary, facilitating a passive, two-way exchange order with a 1:1 exchange rate for two tokens with the same currency code but different issuers.

Available Functionalities

  • Fungible tokens, including stablecoins and NFTs
  • Multisig: Enhances security by requiring multiple parties to sign a transaction.
  • Payment Channel: Batches many small payments into one transaction.
  • Tickets and Checks: Allow for deferred payments.
  • Memo and Tags: Include additional information in transactions.
  • Trustlines: Ensure transactions between specific parties for precise or limited amounts with defined tokens.
  • ...and many more.

Amendments Underway

  • Integration of DID and the EVM Sidechain: Aiming to expand the functionalities and utility of the XRPL ecosystem.

Content of the Repo

This repository contains several code examples:

  • app-create-and-send: A small Vite project for creating accounts and exchanging XRP.
  • create-amm: A TypeScript project to create and use an AMM, add liquidity, swap, etc.
  • issue-token: Create a token and establish a trust line.
  • monitor-payments-websocket: Monitor payments using WebSockets.
  • multisigning: Use multisig for transactions.
  • secure-signing: Use off-chain signing.
  • send-a-memo: Include a memo in a transaction.
  • trade-in-the-dex: Perform operations with the DEX.

Resources

Documentation:

Wallet:

Explorers:

About

A repository for learning and experimenting with development on the XRP Ledger

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published