For the complete documentation index, see llms.txt. This page is also available as Markdown.

construction/derive - Cardano

Example code for the construction/derive JSON-RPC method. Complete guide on how to use construction/derive JSON-RPC in GetBlock Web3 documentation.

This endpoint derives the account address associated with a public key. It is an offline step in the transaction construction flow.

Parameters

The request body is a JSON object with the following fields.

Field
Type
Required
Description

network_identifier

object

Yes

The network to derive for

public_key

object

Yes

The public key, with hex_bytes and curve_type

metadata

object

No

Optional derivation metadata, such as address type

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/construction/derive' \
--header 'Content-Type: application/json' \
--data-raw '{
    "network_identifier": {
        "blockchain": "cardano",
        "network": "mainnet"
    },
    "public_key": {
        "hex_bytes": "b3c2a1d0e9f8...ed25519-public-key-hex",
        "curve_type": "edwards25519"
    },
    "metadata": {}
}'
example.js
const response = await fetch(
    'https://go.getblock.io/<ACCESS-TOKEN>/construction/derive',
    {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({"network_identifier": {"blockchain": "cardano", "network": "mainnet"}, "public_key": {"hex_bytes": "b3c2a1d0e9f8...ed25519-public-key-hex", "curve_type": "edwards25519"}, "metadata": {}})
    }
);
console.log(await response.json());

Response

Response Parameters

Field
Type
Description

account_identifier

object

The derived account, with an address field

Use Cases

  • Address Derivation: Derive an address from a public key offline

  • Wallet Setup: Generate receive addresses for a key

  • Verification: Confirm an address matches a known key

  • Offline Flows: Derive addresses on an air-gapped device

Error Handling

Error Code
Message
Description

1

Invalid request

A required construction field is missing or malformed

6

Transaction decode failed

The supplied transaction could not be decoded

14

Invalid signature

A supplied signature is malformed or does not match

5

Internal error

The node failed to process the construction step

Was this helpful?