Book Image

Ripple Quick Start Guide

By : Febin John James
Book Image

Ripple Quick Start Guide

By: Febin John James

Overview of this book

This book starts by giving you an understanding of the basics of blockchain and the Ripple protocol. You will then get some hands-on experience of working with XRP. You will learn how to set up a Ripple wallet and see how seamlessly you can transfer money abroad. You will learn about different types of wallets through which you can store and transact XRP, along with the security precautions you need to take to keep your money safe. Since Ripple is currency agnostic, it can enable the transfer of value in USD, EUR, and any other currency. You can even transfer digital assets using Ripple. You will see how you can pay an international merchant with their own native currency and how Ripple can exchange it on the ?y. Once you understand the applications of Ripple, you will learn how to create a conditionally-held escrow using the Ripple API, and how to send and cash checks. Finally, you will also understand the common misconceptions people have about Ripple and discover the potential risks you must consider before making investment decisions. By the end of this book, you will have a solid foundation for working with Ripple's blockchain. Using it, you will be able to solve problems caused by traditional systems in your respective industry.
Table of Contents (7 chapters)

Creating a time-held escrow

We'll again go with the same step of steps as before to create a time-held escrow:

  1. Prepare transaction: Here, we define the destination account to which money should be released, escrow release time, amount, and so on.
  2. Sign transaction: You need to sign the transaction cryptographically with your secret key. This proves that you own the source account.
  3. Submit transaction: Once you sign the transaction, you need to submit it to the Ripple network for validation. The escrow would be only created when the validators approve the transaction.

We prepare the create escrow transaction with the following code. As you can see, we've defined the destination and amount and passed the release time to "allowExecuteAfter" parameter:

const sender = 'r41sFTd4rftxY1VCn5ZDDipb4KaV5VLFy2';
const secret = 'sptkAoSPzHq8mKLWrjU33EDj7v96u...