Skip to main content
Cardano methods handle addresses, transactions, native scripts, and message signing for the Cardano blockchain.

cardanoGetAddress

Retrieves a Cardano address from the device. Supports various address types including base, enterprise, pointer, and reward addresses.
addressParameters
object
required
Address parameters.
protocolMagic
number
required
Protocol magic (764824073 for mainnet).
networkId
number
required
Network ID (1 for mainnet, 0 for testnet).
address
string
Expected address for verification.
showOnTrezor
boolean
Display address on device screen.
derivationType
number
Derivation type: 0=Ledger, 1=Icarus, 2=Icarus-Trezor.
chunkify
boolean
Split large requests into chunks.
address
string
Cardano address (bech32 encoded).
addressParameters
object
Address parameters used.
protocolMagic
number
Protocol magic.
networkId
number
Network ID.
serializedPath
string
Payment key path.
serializedStakingPath
string
Staking key path.
// Base address with payment and staking keys
const result = await TrezorConnect.cardanoGetAddress({
    addressParameters: {
        addressType: 0, // Base address
        path: "m/1852'/1815'/0'/0/0",
        stakingPath: "m/1852'/1815'/0'/2/0",
    },
    protocolMagic: 764824073,
    networkId: 1,
    showOnTrezor: true,
});

// Enterprise address (no staking)
const enterprise = await TrezorConnect.cardanoGetAddress({
    addressParameters: {
        addressType: 2,
        path: "m/1852'/1815'/0'/0/0",
    },
    protocolMagic: 764824073,
    networkId: 1,
});

cardanoGetPublicKey

Retrieves a Cardano public key from the device.
path
string | number[]
required
BIP32 derivation path.
showOnTrezor
boolean
Display public key on device screen.
derivationType
number
Derivation type.
publicKey
string
Public key (hex).
node
object
HD node information.
path
number[]
Derivation path.
serializedPath
string
Path as string.
const result = await TrezorConnect.cardanoGetPublicKey({
    path: "m/1852'/1815'/0'",
});

cardanoSignTransaction

Signs a Cardano transaction. Supports all transaction features including certificates, withdrawals, metadata, and Plutus scripts.
inputs
array
required
Transaction inputs.
outputs
array
required
Transaction outputs.
fee
string
required
Transaction fee in lovelace.
ttl
string
Time to live (slot number).
certificates
array
Stake certificates (registration, delegation, etc.).
withdrawals
array
Reward withdrawals.
validityIntervalStart
string
Validity interval start (slot).
auxiliaryData
object
Auxiliary data (metadata, catalyst voting).
mint
array
Token minting/burning.
scriptDataHash
string
Script data hash for Plutus.
collateralInputs
array
Collateral inputs for Plutus scripts.
requiredSigners
array
Required signers.
collateralReturn
object
Collateral return output.
totalCollateral
string
Total collateral amount.
referenceInputs
array
Reference inputs.
additionalWitnessRequests
array
Additional witness paths.
protocolMagic
number
required
Protocol magic.
networkId
number
required
Network ID.
signingMode
number
required
Signing mode: 0=Ordinary, 1=Pool registration, 2=Multisig, 3=Plutus.
derivationType
number
Derivation type.
includeNetworkId
boolean
Include network ID in transaction body hash.
chunkify
boolean
Split large transactions.
hash
string
Transaction hash.
witnesses
array
Transaction witnesses (signatures).
auxiliaryDataSupplement
object
Auxiliary data supplement.
const result = await TrezorConnect.cardanoSignTransaction({
    inputs: [
        {
            path: "m/1852'/1815'/0'/0/0",
            prev_hash: 'ab3...',
            prev_index: 0,
        },
    ],
    outputs: [
        {
            address: 'addr1...',
            amount: '1000000',
        },
        {
            addressParameters: {
                addressType: 0,
                path: "m/1852'/1815'/0'/0/1",
                stakingPath: "m/1852'/1815'/0'/2/0",
            },
            amount: '4823451',
        },
    ],
    fee: '176549',
    ttl: '89467909',
    protocolMagic: 764824073,
    networkId: 1,
    signingMode: 0,
});

if (result.success) {
    console.log('Transaction hash:', result.payload.hash);
    console.log('Witnesses:', result.payload.witnesses);
}

cardanoSignMessage

Signs a message using CIP-8 format.
path
string | number[]
required
Derivation path for signing key.
payload
string
required
Message payload (hex).
preferHexDisplay
boolean
Display message as hex on device.
networkId
number
Network ID.
protocolMagic
number
Protocol magic.
addressParameters
object
Address parameters for signing.
derivationType
number
Derivation type.
signature
string
Message signature.
pubKey
string
Public key used.
headers
object
COSE headers.
coseSignature
string
COSE signature (CBOR hex).
coseKey
string
COSE key (CBOR hex).
const result = await TrezorConnect.cardanoSignMessage({
    path: "m/1852'/1815'/0'/0/0",
    payload: Buffer.from('Hello Cardano').toString('hex'),
    networkId: 1,
    protocolMagic: 764824073,
});

cardanoGetNativeScriptHash

Computes hash of a Cardano native script.
script
object
required
Native script definition (recursive structure).
displayFormat
number
required
Display format: 0=Hide, 1=Bech32, 2=Policy ID.
derivationType
number
Derivation type.
scriptHash
string
Native script hash.
const result = await TrezorConnect.cardanoGetNativeScriptHash({
    script: {
        type: 1, // All
        scripts: [
            {
                type: 0, // PubKey
                keyPath: "m/1852'/1815'/0'/0/0",
            },
            {
                type: 5, // InvalidHereafter
                invalidHereafter: '89467909',
            },
        ],
    },
    displayFormat: 1,
});

cardanoComposeTransaction

Composes a Cardano transaction by selecting inputs and calculating fees.
outputs
array
required
Desired transaction outputs.
account
object
required
Account information with UTXOs.
certificates
array
Certificates to include.
withdrawals
array
Withdrawals to include.
ttl
string
Time to live.
success
boolean
Whether composition succeeded.
payload
object
Composed transaction or error.
const result = await TrezorConnect.cardanoComposeTransaction({
    outputs: [{ address: 'addr1...', amount: '1000000' }],
    account: accountInfo,
});

Build docs developers (and LLMs) love