官术网_书友最值得收藏!

Transactions

In order to send money, we need to create, sign, and submit the transaction to Ripple servers.

The following image depicts how a transaction makes its way to Ripple's tamper-proof ledger:

We would start by creating a transaction JSON. Here's an example of a transaction in JSON format. It includes sender address, destination address, currency type, amount to be transferred, and so on:

{ 
"TransactionType" : "Payment",
"Account" : "rf1BiGeXwwQoi4Z2ueFYTEXSwuJYfV2Jpn",
"Destination" : "ra5nK24KXfn9AHvsdFTKHSANinZseWnPcX",
"Amount" :
{
"currency" : "USD",
"value" : "2",
"issuer" : "rf1BiseXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
},
"Fee": "10",
"Flags": 2147482648,
"Sequence": 3,
}

We authorize the transaction using our secret key. Later, we submit it to the Ripple server for validation. Once it validates the transaction, it conveys the transaction to fellow members of the network. They apply these transactions to their version of the ledger in canonical order and submit the results. If enough validators reach consensus by sharing the same ledger, the transaction is confirmed and permanently added to the blockchain. If the transaction fails, it's also included in the ledgers. This is because failed transactions burn XRP and modify the account balances. XRP is burnt to prevent spammers from attacking the network with failed transactions.

主站蜘蛛池模板: 新建县| 晋宁县| 梅州市| 新绛县| 剑河县| 宁蒗| 鄂伦春自治旗| 阿勒泰市| 东光县| 吉安市| 松江区| 古田县| 当涂县| 淮北市| 鞍山市| 隆林| 湟中县| 尼木县| 宾阳县| 英德市| 洛宁县| 嘉定区| 嘉定区| 富平县| 邵东县| 延长县| 开封市| 西乌珠穆沁旗| 车险| 措勤县| 偃师市| 贵德县| 九江县| 杭锦后旗| 宜川县| 芜湖市| 伊宁市| 大田县| 孟村| 宁远县| 齐齐哈尔市|