1
0
mirror of https://github.com/bigchaindb/js-bigchaindb-driver.git synced 2024-12-28 15:47:50 +01:00

Added sentence to inform that a seed is not obligatory

This commit is contained in:
michielmulders 2017-09-28 13:33:19 +02:00
parent 25054cc136
commit 49fe2e879e

View File

@ -357,10 +357,10 @@ Recap: Asset Creation & Transfer
.then(() => conn.searchAssets('Bicycle Inc.'))
.then(assets => console.log('Found assets with serial number Bicycle Inc.:', assets))
Seed Functionality Ed25519Keypair
Ed25519Keypair Seed Functionality
---------------------------------
BigchainDB JavaScript driver allows you to create a keypair based on a seed.
BigchainDB JavaScript driver allows you to create a keypair based on a seed.
The constructor accepts a 32 byte seed. One of the ways to create a seed from
a string (e.g. a passphrase) is the one used by ``bip39``, specifically the function ``mnemonicToSeed``.
@ -375,6 +375,11 @@ As our constructor ``Ed25519Keypair()`` only accepts a seed of 32 bytes, we slic
var keypair = new driver.Ed25519Keypair(bip39.mnemonicToSeed("yourString").slice(0, 32))
You can use the ``Ed25519Keypair()`` constructor as well without seed.
.. code-block:: js
var keypair = new driver.Ed25519Keypair()
Divisible Assets
----------------