Reader small image

You're reading from  Ripple Quick Start Guide

Product typeBook
Published inDec 2018
Reading LevelIntermediate
PublisherPackt
ISBN-139781789532197
Edition1st Edition
Languages
Right arrow
Author (1)
Febin John James
Febin John James
author image
Febin John James

Febin John James is presently working on building autonomous lending and borrowing protocol on the Ethereum blockchain. He also works as a tech and marketing consultant to ICOs and blockchain-based start-ups. He has years of experience in building and scaling tech architectures from scratch. His blockchain stories on Medium have gained a lot of popularity and have been translated into multiple languages. He writes for well-known publications such as Hacker Noon and freeCodeCamp. He is also the author of the book, Cloud is a Piece of Cake. Previously, he worked as the CTO of Boutline, a sports start-up. He has also bagged devices, cash prizes, and recognition from companies such as Intel, Blackberry, and Microsoft.
Read more about Febin John James

Right arrow

Creating a conditionally-held escrow

Conditionally-held escrows are similar to time-held escrows. However, you need to send the condition and the fulfillment after the release time for the escrow to be released. Ripple makes use of crypto conditions. For the purpose of this tutorial, we'll be generating a random fulfillment and condition. You need to keep the fulfillment secret, otherwise, anyone with the fulfillment code will be able to release the escrow.

Let's generate a random fulfillment and condition. You'll need to install the five-bells-condition npm library. You can do that using the following command:

npm install five-bells-condition 

Use the following code to generate a random fulfillment and condition:

const cc = require('five-bells-condition')
const crypto = require('crypto')

const preimageData = crypto.randomBytes(32);
const myFulfillment...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Ripple Quick Start Guide
Published in: Dec 2018Publisher: PacktISBN-13: 9781789532197

Author (1)

author image
Febin John James

Febin John James is presently working on building autonomous lending and borrowing protocol on the Ethereum blockchain. He also works as a tech and marketing consultant to ICOs and blockchain-based start-ups. He has years of experience in building and scaling tech architectures from scratch. His blockchain stories on Medium have gained a lot of popularity and have been translated into multiple languages. He writes for well-known publications such as Hacker Noon and freeCodeCamp. He is also the author of the book, Cloud is a Piece of Cake. Previously, he worked as the CTO of Boutline, a sports start-up. He has also bagged devices, cash prizes, and recognition from companies such as Intel, Blackberry, and Microsoft.
Read more about Febin John James