Jump to
Ctrl
+
/

Prepare Transaction From Address UTXO

POST
/prepare-transactions/utxo/{blockchain}/{network}/native-coins

Through this endpoint customers can prepare an unsigned UTXO-based transaction from a single funding address. The service selects the necessary UTXOs from that address, estimates the fee by the chosen priority, and returns the unsigned inputs (with the sighashes to sign) and outputs. The funding address pays the fee and receives the change.


This is a paid endpoint and it works for both mainnet and testnet networks.

Path Parameters

blockchain string Required

Represents the specific blockchain protocol name, e.g. Bitcoin.

network string Required

Represents the name of the blockchain network used; e.g. "mainnet" is the live network with actual data while "testnet" is a test network.

Query Parameters

context string Optional

In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

Request Body Schema application/json

context string Optional

In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

data object Required
item object Required
additionalData string Optional

Represents an optional free-text note attached to the transaction request (embedded as OP_RETURN data).

locktime integer Optional

Represents the earliest time or block a transaction may be added to the blockchain.

fromAddress string Required

Represents the single funding address. It funds the outputs, pays the transaction fee and receives the change.

recipients array Items (object) Required

Object array representation of the transaction's recipients. Each item specifies a recipient address and the amount it should receive.

address string Required

Represents the specific recipient's address.

amount string Required

Represents the specific amount the recipient receives, in the main denomination (BTC).

feeOptions object Required

Specifies the fee details for the transaction.

priority string Optional

Represents the fee priority of the transaction, i.e. how quickly it should be mined.

exactAmount string Optional

Represents an exact fee amount to use, in the main denomination. When set, it overrides the priority-based estimate.

prepareStrategy string Optional

Represents the UTXO-selection strategy.

replaceable boolean Optional

Represents whether the transaction is replaceable (BIP-125 Replace-By-Fee).

Default : false

Response Schema

apiVersion string Required

Specifies the version of the API that incorporates this endpoint.

2024-12-12
requestId string Required

Defines the ID of the request. The requestId is generated by Crypto APIs and it's unique for every request.

601c1710034ed6d407996b30
context string Optional

In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

yourExampleString
data object Required
item object Required
fee object Optional

The total fee of the transaction.

amount string Optional

The total fee amount, in the main denomination.

0.0000035
unit string Optional

The denomination of the fee amount.

BTC
feePerByte object Optional

The fee per byte used to compute the total fee.

amount string Optional

The fee-per-byte amount, in the main denomination.

0.00000001
unit string Optional

The denomination of the fee-per-byte amount.

BTC
size integer Optional

The estimated size of the transaction in bytes.

314
version integer Optional

The transaction's version number.

2
locktime integer Optional

The transaction's locktime.

0
additionalData string Optional

The optional free-text note attached to the transaction.

yourAdditionalDataHere
inputs array Items (object) Optional

Object array of the transaction's selected inputs, each with the hash (sighash) that must be signed.

address string Optional

The address the input is spent from.

tb1q7cer5fh3w656jpe30gudzjg05j0kmd48jwxhzh
outputIndex integer Optional

The index of the referenced output in the source transaction.

1
satoshis integer Optional

The value of the input, in satoshis.

76772
script string Optional

The locking script of the referenced output.

0014f6323a26f176a9a907317a38d1490fa49f6db6a7
sighash string Optional

The hash that must be signed for this input.

737a05f70bb0ff41adb2328585374804675da49d19d72a346569a01c180083db
transactionId string Optional

The id of the source transaction of the input.

8347b87d6956dc5c0bccf7f40227c7570d1bd66480fc38e660079a18c3bc21e1
outputs array Items (object) Optional

Object array of the transaction's outputs (recipients plus the change back to the sender).

address string Optional

The recipient (or change) address of the output.

tb1qsf7w5q7pnrumkm6r9zct4ls7504gxl4re9fag0
satoshis integer Optional

The value of the output, in satoshis.

50000
script string Optional

The locking script of the output.

0014827cea03c198f9bb6f4328b0bafe1ea3ea837ea3

Credits Cost

Blockchain protocol Credits for 1 Results
Default Cost 530
Bitcoin 520
Litecoin 583
Dogecoin 583
Dash 583
Zcash 689
Bitcoin Cash 689
Was this page helpful?
Yes
No
Powered by
Language
URL

{
    "apiVersion": "2024-12-12",
    "requestId": "601c1710034ed6d407996b30",
    "context": "yourExampleString",
    "data": {
        "item": {
            "fee": {
                "amount": "0.0000035",
                "unit": "BTC"
            },
            "feePerByte": {
                "amount": "0.00000001",
                "unit": "BTC"
            },
            "size": 314,
            "version": 2,
            "locktime": 0,
            "additionalData": "yourAdditionalDataHere",
            "inputs": [
                {
                    "address": "tb1q7cer5fh3w656jpe30gudzjg05j0kmd48jwxhzh",
                    "outputIndex": 1,
                    "satoshis": 76772,
                    "script": "0014f6323a26f176a9a907317a38d1490fa49f6db6a7",
                    "sighash": "737a05f70bb0ff41adb2328585374804675da49d19d72a346569a01c180083db",
                    "transactionId": "8347b87d6956dc5c0bccf7f40227c7570d1bd66480fc38e660079a18c3bc21e1"
                }
            ],
            "outputs": [
                {
                    "address": "tb1qsf7w5q7pnrumkm6r9zct4ls7504gxl4re9fag0",
                    "satoshis": 50000,
                    "script": "0014827cea03c198f9bb6f4328b0bafe1ea3ea837ea3"
                }
            ]
        }
    }
}