Skip to main content
Version: 19.0.0

Sapling Spending Key Instantiation

Warning

Storing private keys in memory is suitable for development workflows but risky for production use-cases! Use the InMemorySpendingKey appropriately given your risk profile

From Mnemonic

Instantiation of a InMemorySpendingkey from Mnemonic does not require a password as it is only used to change an unencrypted sask... to an encrypted MMXj... spending key or vice versa

Params:

  • mnemonic list of words
  • derivationPath tezos current standard 'm/'

Returns:

  • InMemorySpendingKey class instantiated
const SaplingKeyProvider = await InMemorySpendingKey.fromMnemonic(
'leopard crouch simple blind castle they elder enact slow rate mad blanket saddle tail silk fury quarter obscure interest exact veteran volcano fabric cherry',
'm/'
) // derivationPath by current standard is 'm/'

From Encrypted Spending Key

If the spending key is encrypted prefixed with MMXj... then a password is required to decrypt to a unencrypted Spending Key sask...

Params:

  • spendingKey unencrypted sask... or encrypted MMXj...
  • password required for MMXj encrypted keys
const SaplingKeyProvider = new InMemorySpendingKey(
'MMXjN99mhomTm1Y5nQt8NfwEKTHWugsLtucX7oWrpsJd99qxGYJWP5aMb3t8zZaoKHQ898bLu9dwpog71bnjiDZfS9J9hWnTLCGm4fAjKKYeRuwTgCRjSdsP9znCPBUpCvyxeEFvUfamA5URrp8c7AaooAkobLW1PjNh2vjHobtiyNVTEtyTUWTLcjdxaiPbQWs3NaWvcb5Qr6z9MHhKrYNBHmsd9HBeRB2rVnvvL7pMc8f8zqyuXtmAuzMhiqPz3B4BRzuc8a2jkkoL14',
'test'
)

Provide detailed feedback