API Reference for HD Wallet Service (1.0)

Download OpenAPI specification:Download

Hierarchical Determinisitc Wallets signs transactions using a large number of keys derived from the same root key but appear to be independent.

Each account inside an HD Wallet is identified by an index, ranging from 0 to 2,147,483,648. The recommended usage of HD Wallet accounts is to use a different index for every signed transaction, making the transactions seem to have been signed by completely indepdent accounts, thus masking the true identity holding the master secret for this wallet.

hdwallet

Authentication

app_creds

Kaleido API for marketplace services are authenticated using application credentials. The username and password must be created in the environment containing the service instance as "Application Credentials". For more details see the documentation on App Credentials.

Security scheme type: HTTP
HTTP Authorization Scheme basic

Wallets

Get the list of HD Wallets hosted inside the service

Authorizations:

Responses

200

Wallets Retrieved

get /wallets

Each Kaleido service instance gets assigned a unique hostname. The service URL can be obtained from the /status endpoint for that service. E.g: https://console.kaleido.io/api/v1/c/{consortia_id}/e/{environment_id}/services/{service_id}/status

https://service_host/api/v1/wallets

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Create a new HD Wallet to be hosted inside the service

Authorizations:
Request Body schema: application/json
secret
string

Optional. The 12-word root secret for the HD Wallet. If not specified, a random root secret will be generated and returned in the response

Responses

200

HD Wallet instance created

post /wallets

Each Kaleido service instance gets assigned a unique hostname. The service URL can be obtained from the /status endpoint for that service. E.g: https://console.kaleido.io/api/v1/c/{consortia_id}/e/{environment_id}/services/{service_id}/status

https://service_host/api/v1/wallets

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "secret": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Accounts

Get the account at index in the HD Wallet instance

Authorizations:
path Parameters
wallet_id
required
string

ID of the Wallet in the service

account_index
required
string

Index of the account in the wallet. Range is 0 to 2,147,483,648.

Responses

200

Wallet account Retrieved

get /wallets/{wallet_id}/accounts/{account_index}

Each Kaleido service instance gets assigned a unique hostname. The service URL can be obtained from the /status endpoint for that service. E.g: https://console.kaleido.io/api/v1/c/{consortia_id}/e/{environment_id}/services/{service_id}/status

https://service_host/api/v1/wallets/{wallet_id}/accounts/{account_index}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Sign the transaction payload using the account at the specified index and return the payload ready to submit to the node

Authorizations:
path Parameters
wallet_id
required
string

ID of the Wallet in the service

account_index
required
string

Index of the account in the wallet. Range is 0 to 2,147,483,648.

Request Body schema: application/json
nonce
string

0x prefixed Hexadecimal string for the next nonce value available to this account

gasPrice
string

0x prefixed Hexadecimal string for the offered gas price, in the case of Kaleido blockchains, gas price should be set to zero (0x0)

gasLimit
string

0x prefixed Hexadecimal string for the offer gas unit. Recommended practice is to use web3 estimateGas() call to get an accurate value from the target node

to
string

0x prefixed Hexadecimal string for the address of the target smart contract, or in the case of smart contract deployment, this property should be omitted

value
string

For Kaleido blockchains, the value should always be set to 0x0

data
string

0x prefixed Hexadecimal string for the RLP encoded transaction payload

Responses

201

Transaction Signed

post /wallets/{wallet_id}/accounts/{account_index}/sign

Each Kaleido service instance gets assigned a unique hostname. The service URL can be obtained from the /status endpoint for that service. E.g: https://console.kaleido.io/api/v1/c/{consortia_id}/e/{environment_id}/services/{service_id}/status

https://service_host/api/v1/wallets/{wallet_id}/accounts/{account_index}/sign

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "nonce": "string",
  • "gasPrice": "string",
  • "gasLimit": "string",
  • "to": "string",
  • "value": "string",
  • "data": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "serializedTx": "string"
}