You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/use-cases/payments/smart-contracts-uc.md
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -10,10 +10,11 @@ labels:
10
10
11
11
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.
12
12
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.
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.
16
16
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.
17
18
18
19
## Conditionally Held Escrow
19
20
@@ -22,7 +23,12 @@ Smart contracts on the XRP Ledger work through conditionally held escrows.
22
23
23
24
### Create the Escrow
24
25
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
+

29
+
30
+
31
+
The `Condition` and `Fulfillment` fields can be viewed as a lock and key on an escrow.
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.
33
39
40
+

41
+
34
42
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.
35
43
36
44
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
44
52
Smart contracts have a wide range of uses, but some uses include:
45
53
46
54
1. Handling payments on large-value items you would otherwise need lawyers for, such as mortgages.
55
+

47
56
2. Supply-chain management to ensure funds are delivered upon receipt of goods.
48
57
3. Automating certain kinds of insurance claims that can be verified by software.
58
+

49
59
4. Ensuring payments are given for services rendered.
0 commit comments