Re-level non-docs content to top of repo and rename content→docs

This commit is contained in:
mDuo13
2024-01-31 16:24:01 -08:00
parent f841ef173c
commit c10beb85c2
2907 changed files with 1 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
---
html: payments-uc.html
parent: use-cases.html
top_nav_grouping: Article Types
metadata:
indexPage: true
seo:
description: Practical examples for using different types of payment on the XRP Ledger.
---
# Payments
Practical examples for using different types of payment on the XRP Ledger.
{% child-pages /%}

View File

@@ -0,0 +1,54 @@
---
html: peer-to-peer-payments-uc.html
parent: payments-uc.html
seo:
description: Use the XRP Ledger to handle your day-to-day payments without a third party.
labels:
- Transactions
---
# Peer-to-Peer Payments
The XRP Ledger provides an efficient and borderless solution to handling payments. Unlike traditional payment methods, you don't need a financial institution to hold your assets and transfer value. If you have access to the internet, you can make direct payments on the XRP Ledger as easily as handing someone cash. Whether between friends, or a buyer and merchant, the XRP Ledger enables you to handle direct (peer-to-peer) payments quickly and with low network fees.
## Wallets
Before jumping into using the XRP Ledger to handle direct payments, you should settle on a crypto wallet to use. Crypto wallets make it easier to interact with the ledger and manage your funds; there are many to choose from, depending on your needs, and you can even create your own. See: [Crypto Wallets](../../introduction/crypto-wallets.md).
## Account Creation
Before creating an account, you must decide which XRP Ledger network to use. There are multiple networks for different use cases, but native XRP transactions only happen on `Mainnet`. See: [Parallel Networks](../../concepts/networks-and-servers/parallel-networks.md)
Most publicly available wallets offer the ability to create an account for you and can generate a public and private key. If they don't, you can create an account yourself, so long as it's mathematically valid. See: [Creating Accounts](../../concepts/accounts/accounts.md#creating-accounts).
## Fund Your Account
An account isn't active on the XRP Ledger until it's been funded and meets the minimum reserve requiremen. See: [Reserves](../../concepts/accounts/reserves.md).
If the wallet you're using doesn't offer the option to purchase XRP, you'll need to find a third party exchange to do so and send it to your account. Alternatively, someone you know can also send XRP to your account. See: [Payment](../../references/protocol/transactions/types/payment.md).
After funding your account, you should verify on the XRP Ledger itself that your account exists and is funded. You can do this with the:
- [XRPL Explorer](https://livenet.xrpl.org/).
- [`account_info` command](../../references/http-websocket-apis/public-api-methods/account-methods/account_info.md).
## Handling Payments
### Direct XRP Payments
XRP payments are the simplest way to pay someone on the XRP Ledger. You can use checks or escrows, but these require multiple transactions to complete. A direct XRP payment require only one transaction, making this option great for day-to-day activity. If you're a merchant handling large volumes of transactions, this may be the right choice for you due to it being quick, simple, and having the lowest fees. See: [Direct XRP Payments](../../concepts/payment-types/direct-xrp-payments.md).
To make a direct XRP payment work, you only need to know the address of the receiver.
### Cross-Currency Payments
The XRP Ledger enables you to make cross-currency payments of XRP and tokens. Cross-currency payments within the XRP Ledger are fully atomic, meaning the payment fully executes or no part of the payment executes at all.
Cross-currency payments deliver a fixed amount to their destination, but the sender can have a variable fee cost, depending on the paths taken to make the transaction work on the network. See: [Cross-currency Payments](../../concepts/payment-types/cross-currency-payments.md).
This is a great payment option if you or the receiver prefer a specific token instead of the native XRP currency.

View File

@@ -0,0 +1,71 @@
---
html: restricting-deposits-uc.html
parent: payments-uc.html
seo:
description: Checks enable users to create deferred payments similar to personal paper checks.
labels:
- Transactions
---
# Restricting Deposits
To comply with banking regulations, financial institutions must provide documentation about the sources of funds they receive. These regulations seek to prevent illicit activity by requiring institutions to track the source and destination of all payments they process. On the XRP Ledger, payments can be sent and received without any interaction from the receiver. This default behavior can be problematic, but you can enable deposit authorization so you only receive funds you explicitly approve.
Accounts with deposit authorization enabled can only receive funds through:
- Preauthorized Accounts
- Checks
- Escrow
<!-- - Payment Channels -->
## Set Up Deposit Authorization
To enable deposit authorization, use the `AccountSet` transaction to set the `asfDepositAuth` flag. See: [Deposit Authorization](../../concepts/accounts/depositauth.md).
## Preauthorized Accounts
When you enable deposit authorization, your account blocks all incoming transactions unless you specifically _okay_ them. This may be what you're looking for, but it can be cumbersome if you're working with high volumes of transactions. If you have trusted vendors or accounts, you can preauthorize them so that you don't have to approve transactions from them.
Preauthorized accounts are currency-agnostic, meaning you can't specify which currencies to authorize. It's all or nothing.
See: [DepositPreauth](../../references/protocol/transactions/types/depositpreauth.md).
## Accepting Deposits from Unauthorized Accounts
You can still work with unauthorized accounts, even after enabling deposit authorization. There are several payment methods that enable you to do so.
### Checks
Checks are a straightforward, familiar, and flexible way to transfer funds when deposit authorization is enabled. Checks are a two-part payment method. The sender creates the check, and then the receiver has to cash the check. Cashing the check is your explicit approval of the deposit.
While this method is the simplest, it doesn't guarantee the funds. Checks are deferred payments, meaning funds aren't moved until the moment you try to cash the check. It's possible for the sending account to not have the necessary funds at the time the check is cashed, which can cause delays or other headaches, depending on your business.
See: [Use Checks](../../tutorials/use-specialized-payment-types/use-checks/use-checks.md).
### Escrow
If you require a guarantee of funds at the time of deposit, another option is to have deposits made with an escrow. Like regular escrows, a sender sets aside funds on the ledger, effectively locking them up until certain conditions are met. This guarantees the funds will be available when you close the escrow to release the funds.
See: [Use Escrows](../../tutorials/tasks/use-specialized-payment-types/use-escrows/index.md).
<!-- Need a better understanding of Payment Channels use cases.
### Payment Channels
Payment Channels are an advanced feature for sending asynchronous XRP payments that can be divided into very small increments and settled later.
The XRP for a payment channel is set aside temporarily. The sender creates _Claims_ against the channel, which the recipient verifies without sending an XRP Ledger transaction or waiting for a new ledger version to be approved by consensus. (This is an _asynchronous_ process because it happens separate from the usual pattern of getting transactions approved by consensus.) At any time, the recipient can _redeem_ a Claim to receive an amount of XRP authorized by that Claim. Settling a Claim like this uses a standard XRP Ledger transaction, as part of the usual consensus process. This single transaction can encompass any number of transactions guaranteed by smaller Claims.
Because Claims can be verified individually but settled in bulk later, payment channels make it possible to conduct transactions at a rate only limited by the participants' ability to create and verify the digital signatures of those Claims. This limit is primarily based on the speed of the participants' hardware and the complexity of the signature algorithms. For maximum speed, use Ed25519 signatures, which are faster than the XRP Ledger's default secp256k1 ECDSA signatures. Research has demonstrated the ability to create over Ed25519 100,000 signatures per second and to verify over [70,000 per second](https://ed25519.cr.yp.to/ed25519-20110926.pdf) on commodity hardware in 2011.
Learn about [Payment Channels](payment-channels.html) on the XRP Ledger.
you may have circumstances where you want to go into contract with a contractor, but don't know the exact amount. This is common in situations such as home improvement projects where an estimate can be provided, but unforeseen circumstances can increase the final amount due. In these situations you can create a payment channel, which allocates (currently only XRP) to a payment channel. This amount would be the estimate the contractor gives you and can serve as their budget for the project. Each item they require payment for, you would submit a claim to the payment channel.
Repeating this process, you would eventually settle on the final amount due, where the contractor (payee) claims the final amount from the payment channel. This method of payment serves as a great way to track invdividual items payed for in large projects.
-->

View File

@@ -0,0 +1,49 @@
---
html: escrow-uc.html
parent: payments-uc.html
seo:
description: Transactions allow accounts to modify the XRP Ledger.
labels:
- Ledgers
---
# Smart Contracts
A smart contract is a blockchain-based program that handles the conditions and executes the fulfillment of an agreement between two parties. Broken into its simplest components, a smart contract _does_ something if _something else_ happens.
The benefit of encoding a smart contract into a blockchain is that it enables contracts to be securely carried out without traditional third-parties, like financial or legal institutions. Instead, the contract is supervised by the distributed, decentralized network of computers that run the blockchain.
This enables you to transact with anybody without having to trust they'll uphold their end of a deal; the conditions of the smart contract will force them to.
## Conditionally Held Escrow
Smart contracts on the XRP Ledger work through conditionally held escrows.
### Create the Escrow
A conditionally held escrow is similar to a normal escrow: you set aside funds with an escrow to guarantee funds are available to a recipient. The difference is that a conditionally held escrow on the ledger has a `Condition` attached to it, which serves as a lock on the funds. The ledger won't release those funds until an `EscrowFinish` transaction is submitted with the corresponding `Fulfillment` field. The `Condition` and `Fulfillment` fields can be viewed as a lock and key on an escrow.
See: [`EscrowCreate`](../../references/protocol/transactions/types/escrowcreate.md).
### Establish the Oracle
An oracle is a neutral third-party agent that can verify real-world events to either fulfill or invalidate a smart contract. Oracles are vital to making conditional escrows work by generating the condition and fulfillment, and keeping the fulfillment secret until the terms of the contract are met.
In the context of smart contracts, an oracle will most likely be software that can read real-world data. The oracle would be programmed with the terms of the contract between parties and generate the condition and fulfillment hex values.
The oracle gives the condition hex value to the escrow creator, enabling them to set up the escrow initially.
After the oracle's programming detects the conditions are met, it gives the fulfillment hex value to the escrow recipient. It does nothing else after this point, such as finishing the escrow. The recipient of the escrow would most likely finish the escrow.
See: [Generate a condition and fulfillment](../../tutorials/use-specialized-payment-types/use-escrows/send-a-conditionally-held-escrow.md#1-generate-condition-and-fulfillment).
## Examples
Smart contracts have a wide range of uses, but some uses include:
1. Handling payments on large-value items you would otherwise need lawyers for, such as mortgages.
2. Supply-chain management to ensure funds are delivered upon receipt of goods.
3. Automating certain kinds of insurance claims that can be verified by software.
4. Ensuring payments are given for services rendered.