Skip to content

Commit

Permalink
DASH-1271. Note about private key generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyvEze committed Dec 20, 2024
1 parent b6ac165 commit e03a675
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,11 @@ Use the following steps to determine the fee and pass it to the signed call.
\RegisterFioAddress


# FIO Private/Public Keys?
The SDK provides calls to generate FIO Private/Public Key pairs.
# FIO Public Keys
The SDK provides calls to generate FIO Public Key.

## Generating FIO Keys
Private key generation in the SDK is available for testing purposes only. Do not generate private keys for production application using these methods. Instead pass securely generated private keys or seed phrase to the SDK constructor.
The user's FIO private/public key can be generated by calling these methods on the sdk:

createPrivateKeyMnemonic OR createPrivateKey
Expand Down Expand Up @@ -188,6 +189,7 @@ The user's FIO private/public key can be generated by calling these methods on t
console.log(mnemonic)
console.log("")

// Private key generation in the SDK is available for testing purposes only. Do not generate private keys for production application using these methods. Instead pass securely generated private keys or seed phrase to the SDK constructor.
const privateKeyRes = await fio.FIOSDK.createPrivateKeyMnemonic(mnemonic)
console.log("private key generated:")
console.log((privateKeyRes.fioKey))
Expand Down
1 change: 1 addition & 0 deletions examples/GenerateFioKeys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ async function genKeysFromMnemonic () {
console.log(mnemonic)
console.log("")

// Private key generation in the SDK is available for testing purposes only. Do not generate private keys for production application using these methods. Instead pass securely generated private keys or seed phrase to the SDK constructor.
const privateKeyRes = await fio.FIOSDK.createPrivateKeyMnemonic(mnemonic)
console.log("Private key generated:")
console.log((privateKeyRes.fioKey))
Expand Down
7 changes: 7 additions & 0 deletions src/FIOSDK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ export class FIOSDK {
public static SUFUnit: number = 1000000000

/**
* Private key generation in the SDK is available for testing purposes only.
* Do not generate private keys for production application using this method.
* Instead pass securely generated private keys or seed phrase to the SDK constructor.
*
* @ignore
*/
public static async createPrivateKey(entropy: Buffer): Promise<any> {
Expand All @@ -156,6 +160,9 @@ export class FIOSDK {

/**
* Create a FIO private key.
* Private key generation in the SDK is available for testing purposes only.
* Do not generate private keys for production application using this method.
* Instead pass securely generated private keys or seed phrase to the SDK constructor.
*
* @param mnemonic mnemonic used to generate a random unique private key.
* @example real flame win provide layer trigger soda erode upset rate beef wrist fame design merit
Expand Down

0 comments on commit e03a675

Please sign in to comment.