Lesson 1: How the XRP Ledger came to be
Creating a sustainable blockchain for the world's payments
Key takeaway
- The original architects of the XRP Ledger wanted to create a blockchain that could handle the speed of every day payments without damaging the environment.
- Over a decade later, the XRPL is meeting that goal by being the world's first major global carbon neutral blockchain while maintaining settlement times of 3-5 seconds.
The XRP Ledger (XRPL) is a decentralized, permissionless, open-source blockchain that anyone can contribute to and build on. It offers powerful utility and flexibility that you can access with any of the supported Python, Java, or JavaScript libraries.
History
The creation of Bitcoin in 2009 marked the birth of decentralized currencies-money that is not controlled by a central authority. Though this was a big step for individuals' financial freedom and person-to-person payments, there were some drawbacks to the Bitcoin network which still persist today. The biggest issues were the slow speed of transactions and the high computing power needed to process them.
In 2011, developers David Schwartz, Jed McCaleb, and Arthur Britto joined forces to achieve a collective goal: to create a digital asset that was more sustainable, scalable, and able to process transactions much faster than Bitcoin. Thus, the cryptocurrency XRP and the blockchain on which it runs-the XRP Ledger (XRPL)-were born.
The XRPL has been live since then! With a decade of uptime, the XRPL has been a reliable backbone of a variety of use cases including payments, tokenization, DeFi, and more. Let's dive deeper into the reasons the XRPL is useful and powerful enough to bootstrap a new economy.
Key benefits
Fast transactions
Payments moving across the XRPL can settle in roughly 3-5 seconds at a global scale.
To get a sense of that, sending a transaction on the XRPL takes less time than it should
take you to read this sentence.
Low-cost fees
The XRPL is remarkably cheap to use. The transaction fee on the network costs less than one cent, starting at just 0.00001 XRP-which is very low compared to other blockchains.
Sustainable
Many blockchains require large amounts of energy to process transactions and maintain the network. The XRPL is designed to use as little energy as possible.
Its unique consensus algorithm (the way it validates transactions) doesn't require mining. This means that there's no need for energy-hungry servers that use up a lot of electricity.
In fact, the cryptocurrency XRP uses 0.0079 kWh of energy per transaction, which is 100,000 times smaller than the 951.58 kWh per transaction using Bitcoin. Annually this amounts to a savings of over 50 billion kWh of energy. The negligible amount of energy that XRPL does use is offset through carbon credits, making it the world's first major, global, carbon-neutral, public blockchain.
Robust community
The XRPL has one of the most passionate and engaged communities in the blockchain space. The community is constantly developing new applications and working on ways to make the XRPL even better. You're invited to join!
Additional Resources
Lesson 2: How the XRP Ledger works
Key takeaway:
Once 80% of trusted validators agree that a transaction is valid, it's added to the ledger.
- Transactions change the state of the ledger and must be agreed upon by 80% of validators.
- Validators indicate trust by adding other validators to their Unique Node List (UNL).
- Thanks to the XRP Ledger's unique consensus protocol, transaction fees usually cost less than a hundredth of a penny at the time this was written.
Achieving consensus quickly without a central authority
The XRP Ledger (XRPL) uses a unique consensus algorithm that is distinct from proof-of-work and proof-of-stake mechanisms that other blockchains use.
Before diving in, you should understand transactions on the XRPL. Transactions are statements which change the ledger. For example, if you are buying vegetables at a marketplace, you can send a payment transaction to move money from one account to another. Transactions are always sent from an account and must be cryptographically signed to prove that the sender is who they say they are. That way, only you, the account owner, can send transactions to handle their money.
Let's take a closer look at how transactions flow through the XRPL.
Validating Transactions
The XRPL reaches consensus through agreement between a group of diverse and independent servers called validator nodes, or 'validators' for short.
Each validator node is responsible for checking whether transactions follow the rules of the network, and then try to reach consensus. After checking transactions, validators will propose a list of transactions (also known as a 'ledger') to be included in the permanent history of the network. Other validators that trust this validator will then compare the proposed ledger against their results, sending out revised proposals in response. Once a supermajority (80%) of the network agrees on a proposed ledger, it is validated and included as part of the permanent history.
With each transaction on the XRPL, these steps happen within seconds:
- Transactions are on the XRPL are sent to individual validators.
- The validators check if the transactions follow the rules of the ledger.
- The validators share them in their next proposed ledger, comparing it with those of other validators they trust, checking each new transaction for validity.
- If there's an agreement, the transaction is confirmed and added to the ledger.
If they don't agree, validators modify their proposals to more closely match the other validators they trust, repeating the process in several rounds until they reach a consensus.
Validators indicate that they trust another validator's results by ading them to their unique
node list (UNL). Valiators will only receive proposed ledgers from valiators on their UNL, And
these lists are inependently controlled.
Validators can remove nodes from their UNL if they go offline, of if they are no longer reliable.
This maintains the overall health of the network by preventing unreliable valiators from meaninglessly
voting against ledgers during the consensus process.
Transactions fees
To defen the XRPL against span and denial-of-servvice assualts, each transactions automatically burns
a small amout of XRP, which starts at 0.00001 XRP (10 drops)
This transaction cost is designed to increase in parallel with the load on the network,making
it expensive to deliberately or inadvertently overload the network.
Those who want to use the network for legitimate purposes don't have to worry about the fees to use
the XRPL, as it costs fractions of a penny for a transaction, making the XRPL extremely efficient to use.
Who runs validators?
Anyone can run their own validator to check the perfomance of the network. Validators on the
default UNL are run by developers, universities,businesses, and many other innovations around
the world. Whether they praticipate because they are active users of the ledger, conduct research
or simply because they believe in the power of the blockchain, the diversity of XRPL's node operators
helps ensure the long-term heath, security, and decentralization of the XRPL.
Additional Resources
Lesson 3: Accounts on the XRP Ledger
A digital wallet only you can access
Key takeaway
- Your public address is how the world sends you money. Your private key guarantees only you can use it.
- You can create a new account on the ledger by sending the reserve requirment to an address you have the private key for.
To start using the XRP Ledger (XRPL), your first step is to create an account, also known as a wallet.
Public addresses and private keys
All accounts have a public address and a private key.
- The public address is how your account is located on the XRPL and is derived from the private key. It's similar to a bank account number and is used to receive funds.
- The private key is like a password and ensures only you, account holder, can access the account and make transactions.
You can think of the public address as your account identifier and your private key is what allows only you to use your account.
Private keys are meant to be just thatL private. Anyone with access to your private key has control over your account and any funds associated with it,
so it's important to keep it safe and secure.
Accounts can hold multiple currencies and asset types at once
An XRPL account can hold multiple currencies and asset types at once. This means you don't need to create multiple account/wallets to hold different types of funds,
whether that's XRP, USD, EUR, or any other type of token.
Creating an account
A small XRP deposit (currently 10 XRP) is required to open an account on the XRPL. This is called
the 'account reserve,' which is used to prevent spam on the network and ensure that all accounts are genuine.
When you close your account, a portion of the account reserve is returned.
Destination tags
Companies that manage wallets for multiple people often uses a single address with a destination tag
to specify the user's address. That allows them to represent that the account is an exchange wallet
without requiring an account reserve. You can think of the destination tags like apartment numbers
for each tenant. If you send a letter to that apartment it will always go to the same address, but
only the tenant will be able to open the mailbox for their unit.
Key rotation
For accounts that require access by more than one person, key rotation allows an entity that
owns an address, to enable different people to alternately hold the key for the address. So if
one person leaves, their key can be removed and their successor's key can be added. This way
the account doesn't go with the person leaving, it stays with the entity.
Additional resources
Lesson 4: Issuing tokens and currencies
Digitally representing value
Key takeaway
- Tokens are digital versions of assets, such as works of art, loyalty points, or money (like US).
- The issuer really matters - a digital representation of a dollar created by a bank is more trustworthy than a random person.
- Trust lines ensure that you'll never receive tokens you don't explicitly indicate you want.
- Issued tokens can be traded using the built-in decentralized exchange
Did you know that you can issue your own tokens and currencies on the XRP Ledger (XRPL)? In fact, the XRPL was the first blockchain to support the tokenization of various assets.
Tokens are digital assets that can be used to represent anything of value on the ledger. This means that you can use tokens to represent real-world assets, whether that's a stablecoin like the US dollar, piece of art, or a physical commodity.
Universial Token Creation
You can create a token on the ledger without needing smart contracts or special programming language. Here's a quick quide on how to issue your own token
- You need another account to establish a trustline with you for this new token.
- Make sure both accounts have enough XRP reserve.
- Send a payment transaction to the account that you establish a trustlline with.
It's that simple to bring new tokens into existence on the XRPL.
A trustline is important because it's a way for a potential user of a token to express confidence in the account issuing the token. On the XRPL, you will never receive a token you don't trust.
Note that the account matters a lot in this case-for example, you will probably feel better holding dollars tokenized by a bank than dollars tokenized by "Dave."
If you want to create a loyalty program for your customers, issue a currency, create a token for voting, and soon, turn your drawing into an NFT, you can do it all on the XRPL.
Now that you understand the basics of token creation on the XRP Ledger, let's dive into a few common token scenarios-like stablecoins or governance tokens.
Example: fiat-backed stablecoin
One common use of tokens is stablecoins. You may work for a bank's stablecoin initiative that will create USD tokens on XRPL backed by customer's deposits.
In order to have an easier time checking how many tokens exist at all times. instead of just having the issuer account and the recipient account, you may want to use an in-between account often called a hot account. Tokens would be created through a payment between 2 accounts under your control. These two accounts are often called 'cold' and 'hot.'
- The cold account will issue tokens by sending them through a payment transaction to the hot account. The created tokens will be sitting in the hot account as a reserve.
- The hot account will be in charge of sending the tokenized dollars to fiat depositors' accounts as deposits occur.
If the system is hacked, the real issuer of tokens remains unaffected (that's why it's called a cold account). One thing to not here is that token holders need to establish a turstline with the issuing (cold) account in order to be able to receive, hold, and use the token.
Example: fixed supply token for governance purposes
You can limit the supply by first distributing your tokens and then permanently removing access to your account. This is done by changing the keys than can access your account to one that no one knows the private key for, and then disabling your original private key. There are some well-known XRPL accounts that no knows the private key for called blackhole addresses which you can use to publicly show that your issuing account is no longer accessible.
For a technical guide for how to issue your own tokens on the XRPL, please check out this tutorial
Trading on XRPL's decentralized exchange (DEX)
Once your token has been created, you can use the DEX to trade it with other assets (you will learn more about the DEX in the next lesson). You can also hold your token in a wallet, send it to others, or even use it to power application built on the XRPL.
Additional resources
Lesson 5: Trading value on the XRPL's decentralized exchange(DEX)
Swap what you have for what you want
Key takeaway
- The XRPL was the first blockchain to feature a built-in decentralized exchange.
- You can make offers to trade any type of token without a middleman.
- Autobridging and pathfinding let you find better deals by finding trades with multiple tokens in a row.
Just having tokens ins't very useful unless you can trade them. Luckily, the XRP Ledger was the first blockchain to feautre a built-in decentralized exchange (DEX). This means you can trade XRP or tokens without having to send them to a centralized exchange.
The XRPL DEX is trustless-you don't have to worry about losing assets to hacks or thefts. The DEX is also non-custodial, meaning that you retain full control of your assets at all times.
So, what can you trade on the XRPL DEX?
You can trade any asset that is held inside your XRP wallet, including, but not limited to:
- XRP
- Issued Tokens
- Stablecoins
Example: you have a learning club and decide to tokenize memberships
This means you will exchange a one hour session for 1 LEARN token. You only want to trade LEARN tokens for USD but you receive an offer to purchase the membership with tokenized gold. The XRPL is able to facilitate this transaction using 'auto bridging' or 'pathfinding'.
Auto briding uses XRP as an intermediary asset to find the best exchange rate. This is most helpful when an asset does not have enought liquidity to transact at competitive rates.
Pathfinding uses a series of assets to 'hop' from one currency or form of value to another, finding the best path with the best route to go from one form of value to the other. For example, if a sellter wanted to trade their XRP for tokenized gold, pathfinding may find that the best solution is to first trade XRP for USD, and then trade that USD for gold.
'Bids' and 'Asks'
Just like a centralized exchange, the XRP DEX uses a 'bid' and 'ask' system.
- Bid: A buyer can specify a price they want to buy at or below
- Ask: A seller can specify a pricae they want to sell at or above
Example: Let's assue the currenct price of of XRP is $0.50. If a seller wants to sell their XRP for $0.60, they would place an ask order at $0.60 on the DEX. If a buyer wanted to buy XRP for $0.40, they would place a bid order at $0.40 on the DEX.
All bids and asks for each asset are tracked in an order book on the XRP ledger. This feature improves market transparency and allows you to quickly see the best prices available for each asset.
Additional resouces
- Explainer video: Exchange
- Documentation: Decentralized Exchange
Lesson 6: Nuanced ways to move money on the XRPL
More ways to move your money
Key takeaway
- Escrows let you lock up money until a specific time or condition is met.
- Multi-signing allows you to split control of an account across multiple passwords.
- Payment channels let you send a stream of payments and settle at the end instead of settling after every transaction.
- Checks allow the receiver to accept or deny a payment, which can be useful for compliance.
Sometimes basic payments are not enought. Let's dive into a couple features of the XRP Ledger (XRPL) to handle situations where you need more control over how your assets move on the ledger.
Escrow: when sending XRP depends on timing requirments
XRPL's escrow feature allows you to hold funds in a secure account until certain conditions are met or a specified time period has elapsed. In other words, instead of advancing the money directly to the seller when you are purchasing something, you can create an escrow account that will hold the payment funds until you confirm the product or service has been successfully delivered. You can also use escrow for moving funds from one blockchain to another.
More details on Escorows: https://xrpl.org/escrow-object.html#escrow
Multi-signature accounts: when you don't want a single account to have full power
XRPL's multi-signature capability is a secure feature that requires multiple signatures to authorize a transaction. Think of an organization receiving a lot of donations. With multiple people required to sign transactions and move those funds, the account is less vulnerable to security breaches.
More details on Mult-Signing: https://xrpl.org/multi-signing.html#multi-signing
Payment channles: When an ultra-fast blockchain is still too slow
Not all transactions involve a merchaint selling a product to a client. In mordern economy your business may have to make hundreds of micropayments to a specific supplier-think hundreds of thousands of transactions that even 3 to 5 seconds of latency is too much. Enter 'payment channles'
Payment channels allow you to batch many small payments into a single transactions to be validated on the ledger. Payments made this way are eventually bundled and validated by the ledger as one large transaction once the recipient claims the funds, which normally happens once the payment channel has sent all the funds it initially indicated it could send. This allows you to save on transaction fees, but requires more trust since only the final claim is validated on the ledger. Additionally, this can help avoid congestions on the XRPL for use cases that require this high volume of small payments. #about
More details on Payment Channles: https://xrpl.org/payment-channels.html#payment-channels
Checks: when you need more control of when to receive funds
Similar to paper checks, XRPL's check feautre authorizes an account to claim funds at a later date.
Example:
you could create a check to give someone else the ability to claim funds (both XRP or issued tokens) from your account at any times in the future. The beneficiary claiming the funds has more control over if/when the funds enter their account.
This can be useful for banks who want to ensure no illicit third parties send them money for compliance reasons. By receiving most payments in checks, they can go through compliance procedures before receiving any assets.
More details on Checks: https://xrpl.org/checks.html#checks
Additional resources
Lesson 7: Intro to new innovations on the XRPL
Key takeaway:
- With its democratic amedment process for adding or removing features through validator voting, the XRPL is continously evolving.
- Hooks would allow for smart-contract like functionality, while maintaining the speed and efficiency of the XRPL network.
- Non Fungible Tokens (NFTS) would allow unique assets to be tokenized and traded on the XRPL.
- Sidechains allow for expirmentation with ledger-level code changes in a way that can interact with the XRPL.
Exciting ways that the XRPL is evolving
The XRP Ledger (XRPL) is powered by a global community of builders, developers, creators, validators, and innovators. As such, the XRPL is contantly evolving with the new innovations that align with the values of decentralization, security, sustainability, and scalability.
New features are added to the XRPL through the amendment process, which uses the core consensus process of the network to approvoe any changes by showing continous support before those changes go into effect. An amendment requires 80% support for two weeks before it is applied
Check out three initiatives to expand the XRPL below that have the community excited.
Hooks
Hooks is a proposal that would add smart contract functionality to the XRPL if it is accepted. Hooks are small pieces of code that allow logic to be executed before and/or after transactions.
Example: a bank could add a hook to only accept payments from a specific list of addresses to ensure that it only receives money from known entities in order to be compliant with regulations.
More into about Hooks can be found here: https://xrpl-hooks.readme.io/
NFTs
You've probably heard of NFTs-they are all the rage these days. With the now approved NonFungibleTokensV1_1 amedment, anyone is now able to mint, trade, or burn NFTs (and more) on the XRP Ledger Mainnet, as well as test code on the TestNet or Devnet.
The NFT-Devnet is a test network running experimental code to support NFTs natively on the XRPL. Here, developers can expirment with advanced features before they become active on the Mainnet (XRPL).
The great thing about NFTs on the XRPL is that they're built on top of the existing infrastructure, which makes them secure, as well as economically and environmentally sustainable.
In the next course, you can learn how to mint and trade NFTs on the XRPL.
Sidechains
A sidechain is a separate network that runs in parallel to the main network (XRPL). Sidechains are connected to the main network through a two-way peg, which allows for assets to be moved back and forth between the two networks with ease.
Once fully developed,businesses will be able to use sidechains to create their own custom ledger while still interoperating with the XRPL.
More info about sidechains can be found here: https://xrpl.org/federated-sidechains.html#federated-sidechains
Additional resouces
Lesson 8: XRPL and sustainability
Key takeaway
The XRPL is a great example of how blockchain is helping to drive a more sustainable future.
Global payments and more without causing global warming
It's no secret that the blockchain industry has historically faced issues around sustainability. In fact, some blockchains consume as much energy as entire countries.
The XRP ledger (XRPL) is commited to being sustainable and eco-friendly blockchain that doesn't sacrifice security,decentralization, or scalability in the process. It is the world's first major global carbon-neutral public blockchain.
What makes the XRPL sustainable?
XRPL's unique consensus mechanism doesn't require mining to settle transactions. The negligible amout of energy it does consume is then offset with carbon credits through EW Zero, an open-source tool that allows any blockchain to decarbonsize by purchasing renewable energy from local carbon markets across the world.
How can developers connect and contribute?
If sustainability, security, and decentralization are important to you, you're invited to joing the XRPL community in its quest to build a better world. Here are some ways to get involved:
- Check out the XRPL dev blog to stay up-to-date on the latest innovations and developments in the XRPL community.
- Attend meetups, hackathons, and conferences to meet other memebers of the community
- View the Github repositories to find projects to see how you can contribute.
- Join the conversation on social media using #XRPLCommunity
Additional resources