POSTtestmempoolaccept

Bitcoin Mainnethttps://bitcoin-mainnet.nodit.io/

Verifies whether a transaction would be accepted into the mempool without actually submitting it. Use it as a pre-flight check before broadcasting.

Request Body
idintegerrequired
jsonrpcstringrequired
methodstringrequired
paramsoneOf[]required

It contains following parameters in order:

  1. rawtxs: The hex strings of the transactions to validate, as an array. (required)
  2. maxfeerate: The maximum fee rate to allow. (optional, default 0.10)
params[0]string[]

The hex strings of the transactions to validate.

params[1]string

Reject transactions whose fee rate is higher than this value, expressed in BTC/kvB. Fee rates larger than 1 BTC/kvB are rejected. Set to 0 to accept any fee rate.

Responses
txidstring

The transaction id.

wtxidstring

The hash of the serialized transaction, including witness data.

package-errorstring

A package validation error. It can be returned only when more than one transaction was submitted.

allowedboolean

Whether this transaction would be accepted into the mempool and pass the requested maxfeerate.

vsizeinteger

The virtual transaction size as defined in BIP 141. Returned only when allowed is true.

basenumber

The transaction fee, denominated in BTC.

effective-feeratenumber

The effective fee rate used for validation, expressed in BTC/kvB.

effective-includesstring[]

The list of witness hashes of the transactions whose fees and virtual sizes are included in the effective fee rate.

reject-reasonstring

The reason the transaction was rejected. Returned only when allowed is false.

reject-detailsstring

The details of the rejection. Returned only when allowed is false and rejection details exist.

X-API-KEY
RequestCU50
cURL
curl -X POST "https://bitcoin-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "testmempoolaccept",
  "params": [
    [
      "02000000013ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a00000000da00483045"
    ],
    "0.10"
  ]
}'
Response
Example · 200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    {
      "txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
      "wtxid": "9b0fc92260312ce44e74ef369f5c66bbb85848f2eddd5a7a1cde251e54ccfdd5",
      "allowed": true,
      "vsize": 144,
      "fees": {
        "base": 0.00002538,
        "effective-feerate": 0.00017625,
        "effective-includes": [
          "9b0fc92260312ce44e74ef369f5c66bbb85848f2eddd5a7a1cde251e54ccfdd5"
        ]
      }
    }
  ]
}