Tezos
Unified API + Tezos Integration Workflow
In the following guide, the integration process for the xtz
chain is covered. The Tezos 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 Tezos-specific details
chain
— always set toxtz
for Tezos-related requests.network
— environment in which the transaction is processed (mainnet
only).stakerAddress
— Tezos account address (tz1...
).amount
— amount to delegate (in XTZ/TEZ).- Unbonding period: 4 days. Minimum stake: 5 XTZ.
- Tezos accounts can have only 1 delegate at a time.
Staking Flow
1. Create Reveal Transaction (Optional, for New Accounts)
Send a POST request to /api/v1/unified/staking/stake.
Example request (for mainnet
network):
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": "xtz",
"network": "mainnet",
"stakerAddress": "tz1Nfu7TmHj7GWARYHrxdVZ75BgcHwUnr3PM",
"amount": "5",
"extra": {
"operationType": "reveal",
"additionalAddresses": {
"tezosPubKey": "edpkvUh57bdTwgaHBE9bYVPLRv3myqzoD8RLsiRNnQs5TxvhdLswQ9"
}
}
}'
chain
— blockchain network, always set toxtz
for Tezos-related requests.network
— environment in which the transaction is processed (mainnet
only).stakerAddress
— Tezos account address (tz1...
).amount
— amount to reveal/delegate (in XTZ).extra.operationType
—"reveal"
for reveal operation (optional, only for new accounts).extra.additionalAddresses.tezosPubKey
— public key to reveal.
Example response:
{
"error": null,
"result": {
"amount": 5,
"stakerAddress": "tz1Nfu7TmHj7GWARYHrxdVZ75BgcHwUnr3PM",
"unsignedTransactionData": "5d601c0133d2cba0c9345fb5...",
"createdAt": "2025-06-03T23:36:22.450Z",
"extraData": {
"transactionId": "c23982ec-07aa-426b-a867-013cdacbd281",
"stakeId": "7ba5b6c6-e0e3-481c-8388-57ea3d15cacc",
"gasEstimate": {
"amount": "0.000279000000000000",
"gasLimit": ""
}
}
}
}
amount
— amount to delegate/reveal (in XTZ).stakerAddress
— account address initiating the transaction.unsignedTransactionData
— hex-encoded unsigned transaction (to be signed by the wallet).createdAt
— timestamp in ISO 8601 format.extraData.transactionId
— internal transaction identifier.extraData.stakeId
— internal stake operation ID.extraData.gasEstimate.amount
— estimated transaction fee (in XTZ).extraData.gasEstimate.gasLimit
— estimated gas limit (may be empty).
2. Sign and Send Transaction
Use unsignedTransactionData
to sign the transaction.
To broadcast the signed transaction to the Tezos 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": "xtz",
"network": "mainnet",
"signedTransaction": "{\"bytes\":\"024c70799bc16c1c95db0091ef51441bd6b8d2bf105a4a17793c776d530f82a16e002142e1ae4c4456b6f3742dd6510ea6dc7d2c11f48c029bf5ad4fa8010000\",\"sig\":\"sigWhmkraxYHSmd1SQS156Y1MvuBBzZ9sK9qFjiGoRDufGpEL6kXRyjmDx4rbGcUzzNatCUWipLvs7cQATocmqDFdVxjJ4n8\",\"prefixSig\":\"edsigtgXEsuorpDdogCRha2vHVJeSg1GvXnjuXX1UScoQEFgE84GhFRM4ppTs7TD4hxBLp8MpQ2WBBYptMCCfTm7oQJhbqPj5AJ\",\"sbytes\":\"024c70799bc16c1c95db0091ef51441bd6b8d2bf105a4a17793c776d530f82a16e002142e1ae4c4456b6f3742dd6510ea6dc7d2c11f48c029bf5ad4fa8010000429d6cadd75dcbc026097e94d90e6145bf477e9bd8a1ffa2948b81509f522ff1f30148bf227c6d83b1c3d98e9cd8f8e71177152b6dca938fe82da73bfaac8603\"}",
"stakerAddress": "tz1Nfu7TmHj7GWARYHrxdVZ75BgcHwUnr3PM",
"extra": {
"transactionId": "7977e904-e9bb-43d8-9c09-83812a15e8a8"
}
}'
chain
— blockchain network.network
— environment.signedTransaction
— signed transaction as a JSON string, includingbytes
,sig
,prefixSig
, andsbytes
fieldsstakerAddress
— account address initiating the transaction.extra.transactionId
— transaction ID from the previous step (required for tracking).
Example response:
{
"error": null,
"result": {
"extraData": {
"transactionHash": "oo3mw16oJqrBair2s31dvDhKjTXjKNcRPjJthKKN1qMnvjE7eCz"
}
}
}
extraData.transactionHash
— transaction hash on the Tezos network (can be used in tzkt.io explorer).
3. Create Stake Transaction (Delegation)
Send a POST request to /api/v1/unified/staking/stake.
Example request (for mainnet
network):
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": "xtz",
"network": "mainnet",
"stakerAddress": "tz1Nfu7TmHj7GWARYHrxdVZ75BgcHwUnr3PM",
"amount": "5",
"extra": {
"additionalAddresses": {
"tezosPubKey": "edpkvUh57bdTwgaHBE9bYVPLRv3myqzoD8RLsiRNnQs5TxvhdLswQ9"
}
}
}'
chain
— blockchain network.network
— environment.stakerAddress
— account address initiating delegation.amount
— amount to delegate (in XTZ).extra.additionalAddresses.tezosPubKey
— public key (may be required for non-revealed accounts).
Example response:
{
"error": null,
"result": {
"amount": 5,
"stakerAddress": "tz1Nfu7TmHj7GWARYHrxdVZ75BgcHwUnr3PM",
"unsignedTransactionData": "74aec234a40c4adfe6d68c5dbd104d04f0804e0e...",
"createdAt": "2025-06-03T23:36:36.439Z",
"extraData": {
"transactionId": "0a471c05-0714-4249-a4a0-e83d4a648fc0",
"stakeId": "d7ac3d47-d2ee-4704-8c5c-ea174ef7bc0b",
"gasEstimate": {
"amount": "0.000279000000000000",
"gasLimit": ""
}
}
}
}
amount
— amount to delegate (in XTZ).stakerAddress
— account address.unsignedTransactionData
— unsigned transaction (hex, to be signed).createdAt
— ISO 8601 timestamp.extraData.transactionId
— transaction identifier.extraData.stakeId
— stake operation ID.extraData.gasEstimate.amount
— estimated transaction fee (in XTZ).extraData.gasEstimate.gasLimit
— estimated gas limit.
4. Sign and Send Transaction
Use unsignedTransactionData
to sign and send the transaction following the Tezos-specific signing logic.
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": "xtz",
"network": "mainnet",
"stakerAddress": "tz1Nfu7TmHj7GWARYHrxdVZ75BgcHwUnr3PM",
"extra": {
"amount": 5
}
}'
chain
— blockchain network.network
— environment.stakerAddress
— account address.extra.amount
— amount to unstake (in XTZ).
Example response:
{
"error": null,
"result": {
"amount": 5,
"stakerAddress": "tz1Nfu7TmHj7GWARYHrxdVZ75BgcHwUnr3PM",
"unsignedTransactionData": "024c70799bc16c1c95db0091ef51441bd6b8d2bf105a4a17793c776d530f82a1...",
"createdAt": "2025-06-05T12:09:40.751Z",
"extraData": {
"transactionId": "b2757302-8e89-4227-a841-461936ccd971",
"stakeId": "a78b76b6-e866-4dd3-9a7d-3a89f5937ec7",
"gasEstimate": {
"amount": "0.000248000000000000",
"gasLimit": ""
}
}
}
}
amount
— amount of XTZ to be unstaked.stakerAddress
— Tezos account address initiating the transaction.unsignedTransactionData
— unsigned transaction (hex-encoded, to be signed).createdAt
— ISO 8601 timestamp of creation.extraData.transactionId
— transaction identifier.extraData.stakeId
— stake operation ID (used for subsequent actions, e.g., withdrawal).extraData.gasEstimate.amount
— estimated transaction fee (in XTZ).extraData.gasEstimate.gasLimit
— estimated gas limit (may be empty).
2. Sign and Send Transaction
Use unsignedTransactionData
to sign and send the transaction following the Tezos-specific signing logic.
What's Next?
Updated 1 day ago