Bip32

From ArdorDocs
Jump to: navigation, search
This page contains changes which are not marked for translation.

Derive Account From Master Public Key

Derives an account from their serialized master public key.

Request:

  • requestType is deriveAccountFromMasterPublicKey
  • serializedMasterPublicKey (S) is the serialized master public key for deriving the child account
  • childIndex is a the account index to be returned

Response

  • accountRS (S) is the Reed-Solomon address of the account
  • publicKey (S) is the public key of the account
  • requestProcessingTime (N) is the API request processing time (in millisec)
  • account (S) is the account ID

Derive Account From Master Public Key Example

http://localhost:27876/nxt?
  requestType=deriveAccountFromMasterPublicKey&
  serializedMasterPublicKey=d742d493920af3a7a9371af0caf70a5f0f3d008abd9ae8f60689a780156cfd8f39318b99bfca9aa43dc2db516a00bad1ef303d147a14bffc7ddc381caa3af8848e625618&
  childIndex=0
{
    "accountRS": "ARDOR-6533-8UKV-WPVT-D53RV",
    "publicKey": "fe31a184e24d1f9b6cc5aec7efaa8ca8670f749ccea84af0009e126d67fca76b",
    "requestProcessingTime": 15,
    "account": "13680848485626285089"
}


Derive Account From Seed

Derives an account from a seed.

Request:

  • requestType is deriveAccountFromSeed
  • mnemonic (S) is a list of words which store all the information needed
  • passphrase (S) is the passphrase to be combined with the mnemonic
  • bip32Path (S) it defines how to derive private and public keys from the mnemonic and an ordered set of indices.

Response

  • privateKey (S) is the privateKey of the derived account
  • seed (S) is the (hex) seed
  • chainCode (S) is a 256 bits entropy for computing subkeys.
  • accountRS (S) is the Reed-Solomon address of the account
  • bip32Path (S) it defines how to derive private and public keys from the mnemonic and an ordered set of indices.
  • masterPublicKey (S) is the master public key for deriving the child accounts
  • publicKey (S) is the public key of the account
  • requestProcessingTime (N) is the API request processing time (in millisec)
  • privateKeyRight (S)
  • account (S) is the account ID


Derive Account From Seed Example

http://localhost:27876/nxt?
  requestType=deriveAccountFromSeed&
  mnemonic=rack bundle eye document century upgrade orient upper gas lottery infant attend melt glide mammal ship couch spy&
  bip32Path=m/44'/16754'/0'/1'/0
{
    "privateKey": "00f83df3d7237253a3b5c7e3e789b92deb0e12ee449e845695f7190a89d5c342",
    "seed": "216d614810238abd2b482a7b6abdfd2b871b31cabaa3934cd180fa922ed0a636bb85be8db4180a7812d0929a20ee3ea069533e6e2513dc108513f095560a58a3",
    "chainCode": "80985596b59a8cf910ab08e1c31e3d6ef231a619a6053a182d7ce896760a146d",
    "accountRS": "ARDOR-GASH-XEMA-G3MH-7LTBA",
    "bip32Path": "m/44'/16754'/0'/1'/0",
    "masterPublicKey": "95093a0aacdccea7f4bdc58af8c6dc296e3505ce3f6f73cccb7bf28cd92f00e1",
    "publicKey": "de225c3ebc46aacb9124a9e143cceb4b64f5a19d7ccc4a633fc622119f4f3575",
    "requestProcessingTime": 19,
    "privateKeyRight": "b8df48729cd324eb9cde2409b523b015643ee19a6dc52e7688af2ec1c61d6115",
    "account": "6063871408822756111"
}


Get Ledger Master Public Key

It returns the hardware Ledger master public key. It requires the hardware wallet to be connected.

Request:

  • requestType is getLedgerMasterPublicKey
  • bip32Path (S) it defines how to derive private and public keys from the mnemonic and an ordered set of indices.

Response

  • chainCode (S) is a 256 bits entropy for computing subkeys.
  • accountRS (S) is the Reed-Solomon address of the account
  • bip32Path (S) it defines how to derive private and public keys from the mnemonic and an ordered set of indices.
  • masterPublicKey (S) is the master public key for deriving the child accounts
  • publicKey (S) is the public key of the account
  • requestProcessingTime (N) is the API request processing time (in millisec)
  • account (S) is the account ID

Get Ledger Master Public Key Example

http://localhost:27876/nxt?
  requestType=deriveAccountFromSeed&
  mnemonic=rack bundle eye document century upgrade orient upper gas lottery infant attend melt glide mammal ship couch spy&
  bip32Path=m/44'/16754'/0'/1'/0
{
    "chainCode": "14efba6597718a4a7f5d9bfbd0f7f2177216068d90ced2475a52e06caf82759f",
    "accountRS": "ARDOR-ATW3-48WT-SHPC-2K85M",
    "bip32Path": "m/44'/16754'/0'/1'/0",
    "masterPublicKey": "ee55d3df4b01376561b70a249155cfa8a388740ca8eaa5a8879a070a001bfb14",
    "publicKey": "3e604f4ee11bea4dc8628c8af2215e764ee2e344aa14f4ca11048fa144f8c11c",
    "requestProcessingTime": 3693,
    "account": "688154717139003265"
}