Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Ripple Quick Start Guide

You're reading from  Ripple Quick Start Guide

Product type Book
Published in Dec 2018
Publisher Packt
ISBN-13 9781789532197
Pages 160 pages
Edition 1st Edition
Languages
Author (1):
Febin John James Febin John James
Profile icon Febin John James

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 chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime}