Cardano

Unified API + Cardano Integration Workflow

This guide explains how to integrate the cardano chain using the Unified API. The Cardano integration aligns with the general Unified API process but with network-specific parameters.

Get an authentication token to start using the Unified API.

Request examples are provided using cURL.

To check the integration guides for other chains, refer to the Networks section.

📘

Key Cardano-specific details

  • chain — always set to cardano for Cardano-related requests.
  • network — environment in which the transaction is processed (mainnet only).
  • stakerAddress — account address initiating staking, unstaking or withdrawal transactions.
  • amount — amount of tokens in ADA.

Staking Flow

1. Create Staking Request

Send a POST request to /api/v1/unified/staking/stake.

Example request:

curl --request POST \
     --url https://api-test.p2p.org/api/v1/unified/staking/stake \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <token>' \
     --data '{
    "chain": "cardano",
    "network": "mainnet",
    "stakerAddress": "addr1q847hfazcye3f4g4f4fwf6l386tud6lp6lqvfawzvcartzvg73xawnxm8wvflhpt8kkm5kg4nlv8a0fx6ezxgv6r2nrqcl6wxm",
    "amount": 5
}'
  • chain — blockchain network, always set to cardano for Cardano-related requests.
  • network — environment in which the transaction is processed (mainnet only).
  • stakerAddress — Cardano account address initiating the staking transaction.
  • amount — amount of tokens to stake in ADA, minimum amount is 5.

Example response:

{
    "error": null,
    "result": {
        "amount": 5,
        "stakerAddress": "addr1q847hfazcye3f4g4f4fwf6l386tud6lp6lqvfawzvcartzvg73xawnxm8wvflhpt8kkm5kg4nlv8a0fx6ezxgv6r2nrqcl6wxm",
        "unsignedTransactionData": "84a400d9010281825820a7aec4e68399fd4668ac034cccc3fbb726a40fac88f0e5fd74be702ce2f2d93a00018182583901ebeba7a2c13314d5154d52e4ebf13e97c6ebe1d7c0c4f5c2663a358988f44dd74cdb3b989fdc2b3dadba59159fd87ebd26d64464334354c61a003517dd021a0002a96104d901028282008200581c88f44dd74cdb3b989fdc2b3dadba59159fd87ebd26d64464334354c683028200581c88f44dd74cdb3b989fdc2b3dadba59159fd87ebd26d64464334354c6581cc29c92f8319150962650bc8a5e24d918491e8a7b3ac43525afe76baaa0f5f6",
        "createdAt": "2025-05-15T20:23:20.088Z",
        "extraData": {
            "transactionId": "2de012ab-72d8-4971-a570-9771f3530fca",
            "stakeId": "b3d6c077-a59b-4585-a0df-85ae16c0d3af",
            "gasEstimate": {
                "amount": "0.165149000000000000",
                "gasLimit": ""
            }
        }
    }
}
  • amount — amount of tokens to stake in ADA.
  • stakerAddress — address initiating the staking transaction.
  • unsignedTransactionData — unsigned transaction in CBOR, Base64 encrypted format. Sign the transaction and submit it to the blockchain to perform the called action.
  • createdAt — timestamp of the transaction in the ISO 8601 format.
  • extraData — additional transaction details:
    • transactionId — unique identifier of the transaction within this staking session.
    • stakeId — unique identifier of the staking request.
    • gasEstimate — estimated gas usage details:
      • amount — estimated transaction fee in ADA.
      • gasLimit — maximum gas limit for the transaction; option is not used in Cardano and reserved for compatibility (can be left empty or ignored).

2. Sign and Send Transaction

Use unsignedTransactionData to sign the transaction.

To broadcast the signed transaction to the Cardano network, send a POST request to /api/v1/unified/transaction/broadcast.

Example request:

curl --request POST \
     --url https://api-test.p2p.org/api/v1/unified/transaction/broadcast \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <token>' \
     --data '{
    "chain": "cardano",
    "network": "mainnet",
    "signedTransaction": "84a400d9010281825820a7aec4e68399fd4668ac034cccc3fbb726a40fac88f0e5fd74be702ce2f2d93a00018182583901ebeba7a2c13314d5154d52e4ebf13e97c6ebe1d7c0c4f5c2663a358988f44dd74cdb3b989fdc2b3dadba59159fd87ebd26d64464334354c61a003517dd021a0002a96104d901028282008200581c88f44dd74cdb3b989fdc2b3dadba59159fd87ebd26d64464334354c683028200581c88f44dd74cdb3b989fdc2b3dadba59159fd87ebd26d64464334354c6581cc29c92f8319150962650bc8a5e24d918491e8a7b3ac43525afe76baaa1008282582020c22b2dbf4eacea4eb791bd9606806bd3428fc336ddcc42f316a55dbfc1aa2f584094b1c1a9c804b8355abd57e8a496bfef1bf42a5d6b3f1377b6d5d9c3cc443e790f0cbcd34ea347801a51a79ca79a4e0cf2d6925383e707c0a7c4246614101f09825820197e920a7fe4ab16264c847f748d15ec82b0cdc126a12373aa20f0bf154aa23458408603bd62494828461177ba2c0ad96ec6b071b7f4c89e3b9c013c50e1027d7b04d49e91168f31d7a9f12f333c566a27f1bc6ed53a4ab5be2aef523751e2fa5507f5f6",
    "stakerAddress": "addr1q847hfazcye3f4g4f4fwf6l386tud6lp6lqvfawzvcartzvg73xawnxm8wvflhpt8kkm5kg4nlv8a0fx6ezxgv6r2nrqcl6wxm",
    "extra": {
        "transactionId": "2de012ab-72d8-4971-a570-9771f3530fca"
    }
}'
  • chain — blockchain network.
  • network — environment in which the transaction is processed.
  • signedTransaction — signed transaction in Base64 encrypted format, which contains all transaction details (e.g., accounts, instructions, and signatures) required to broadcast the transaction to the network.
  • stakerAddress — staking account address receiving the staked tokens.
  • extra — additional request parameters:
    • transactionId — unique identifier of the transaction within this staking session.

Example response:

{
    "error": null,
    "result": {
        "extraData": {
            "transactionHash": "0a98464fa4eb52c666a03f8f9f1673db7a905c32e475e1e76f33ad0af506b6f9"
        }
    }
}
  • extraData — additional transaction details:
    • transactionHash — hash of the block in which the transaction has been included.

Unstaking Flow

1. Create Unstaking Request

Send a POST request to /api/v1/unified/staking/unstake.

Example request:

curl --request POST \
     --url https://api-test.p2p.org/api/v1/unified/staking/unstake \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <token>' \
     --data '{
    "chain": "cardano",
    "network": "mainnet",
    "stakerAddress": "addr1q847hfazcye3f4g4f4fwf6l386tud6lp6lqvfawzvcartzvg73xawnxm8wvflhpt8kkm5kg4nlv8a0fx6ezxgv6r2nrqcl6wxm",
    "extra": {
        "amount": 5
    }
}'
  • chain — blockchain network.
  • network — environment in which the transaction is processed.
  • stakerAddress — account address initiated the staking transaction.
  • extra — additional request parameters:
    • amount — amount of tokens to withdraw in ADA.

Example response:

{
    "error": null,
    "result": {
        "amount": 5,
        "stakerAddress": "addr1q847hfazcye3f4g4f4fwf6l386tud6lp6lqvfawzvcartzvg73xawnxm8wvflhpt8kkm5kg4nlv8a0fx6ezxgv6r2nrqcl6wxm",
        "unsignedTransactionData": "84a400d90102818258200a98464fa4eb52c666a03f8f9f1673db7a905c32e475e1e76f33ad0af506b6f900018182583901ebeba7a2c13314d5154d52e4ebf13e97c6ebe1d7c0c4f5c2663a358988f44dd74cdb3b989fdc2b3dadba59159fd87ebd26d64464334354c61a0050fdfc021a00029e6104d901028182018200581c88f44dd74cdb3b989fdc2b3dadba59159fd87ebd26d64464334354c6a0f5f6",
        "createdAt": "2025-05-15T20:24:32.851Z",
        "extraData": {
            "transactionId": "ce8f7141-114a-4f72-b2ae-155edbf8da43",
            "stakeId": "23b263c3-3994-442b-8f18-d73b568ecf12",
            "gasEstimate": {
                "amount": "0.171617000000000000",
                "gasLimit": ""
            }
        }
    }
}
  • amount — amount of tokens to withdraw in ADA.
  • stakerAddress — account address initiated the staking transaction.
  • unsignedTransactionData — unsigned transaction in Base64 encrypted format. Sign the transaction and submit it to the blockchain to perform the called action.
  • createdAt — timestamp of the transaction in the ISO 8601 format.
  • extraData — additional transaction details:
    • transactionId — unique identifier of the transaction within this withdrawal session.
    • stakeId — unique identifier of the withdrawal request.
    • gasEstimate — estimated gas usage details:
      • amount — estimated transaction fee in ADA.
      • gasLimit — maximum gas limit for the transaction; option is not used in Cardano and reserved for compatibility (can be left empty or ignored).

2. Sign and Send Transaction

Use unsignedTransactionData to sign and send the transaction following the Cardano-specific signing logic.

What's Next?