Skip to content

Commit fbc5565

Browse files
authored
Merge pull request #2585 from XRPLF/update_smart_contract
Update Smart Contracts Use Case for style and consistency
2 parents 5dd8d6f + d308d69 commit fbc5565

File tree

6 files changed

+13
-3
lines changed

6 files changed

+13
-3
lines changed
254 KB
Loading
Loading

docs/img/uc-smart-contract.png

126 KB
Loading

docs/img/uc-the-oracle.png

162 KB
Loading
87 KB
Loading

docs/use-cases/payments/smart-contracts-uc.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ labels:
1010

1111
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.
1212

13-
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.
13+
![Smart Contract](/docs/img/uc-smart-contract.png)
1414

15-
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.
15+
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.
1616

17+
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 force them to comply.
1718

1819
## Conditionally Held Escrow
1920

@@ -22,7 +23,12 @@ Smart contracts on the XRP Ledger work through conditionally held escrows.
2223

2324
### Create the Escrow
2425

25-
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.
26+
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.
27+
28+
![Escrow with lock and key](/docs/img/uc-yescrow-holding-lock-and-key.png)
29+
30+
31+
The `Condition` and `Fulfillment` fields can be viewed as a lock and key on an escrow.
2632

2733
See: [`EscrowCreate`](../../references/protocol/transactions/types/escrowcreate.md).
2834

@@ -31,6 +37,8 @@ See: [`EscrowCreate`](../../references/protocol/transactions/types/escrowcreate.
3137

3238
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.
3339

40+
![The Oracle](/docs/img/uc-the-oracle.png)
41+
3442
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.
3543

3644
The oracle gives the condition hex value to the escrow creator, enabling them to set up the escrow initially.
@@ -44,6 +52,8 @@ See: [Generate a condition and fulfillment](../../tutorials/how-tos/use-speciali
4452
Smart contracts have a wide range of uses, but some uses include:
4553

4654
1. Handling payments on large-value items you would otherwise need lawyers for, such as mortgages.
55+
![Real Estate and Supply Chain](/docs/img/uc-smart-contract-real-estate-supplies.png)
4756
2. Supply-chain management to ensure funds are delivered upon receipt of goods.
4857
3. Automating certain kinds of insurance claims that can be verified by software.
58+
![Insurance and Payments](/docs/img/uc-smart-contract-insurance.png)
4959
4. Ensuring payments are given for services rendered.

0 commit comments

Comments
 (0)