Home

signrawtransactionwithkey

POST
https://btc-testnet.nownodes.io/

Authorizations

ApiKeyAuthApiKeyAuth

api-key string

NOWNodes API key passed in the api-key header.

Signs inputs for a raw transaction using explicitly provided private keys, without needing access to a local wallet. Useful for offline signing or stateless transaction construction.

Body

application/json

Signs inputs for a raw transaction using explicitly provided private keys, without needing access to a local wallet. Useful for offline signing or stateless transaction construction.

Request payload containing the documented method parameters and client request identifier.

jsonrpcstringrequired

JSON-RPC protocol version.

idstringrequired

Client-provided request identifier echoed in the response.

methodstringsignrawtransactionwithkeyrequired

JSON-RPC method name.

paramsArray<string | Array<string> | Array<object>>required

Parameters:

  1. hexstring (string, required): The raw transaction hex string.
  2. privkeys (array of strings, required): Array of WIF private keys.
  3. prevtxs (array, optional): Array of previous output details for inputs to sign.
Show child attributes

Single entry in the params array.

One of

JSON-RPC method parameters.

string
Array<string>
Array<object>
Show child attributes
txidstring

Transaction ID of the UTXO being spent.

voutinteger

Output index.

scriptPubKeystring

Script of the UTXO.

redeemScriptstring

(optional) Redeem script for P2SH inputs.

witnessScriptstring

(optional) Witness script for P2WSH inputs.

amountnumber

Amount in BTC of the UTXO.

Response

200OK

Transaction signed successfully

401Unauthorized

Unauthorized: API key is present but rejected by the NOWNodes gateway.

405Method Not Allowed

Method Not Allowed. Returned by the NOWNodes gateway for malformed or unsupported gateway-level requests.

422Unprocessable Entity

Missing API key. The NOWNodes gateway returns plain text for this error.

500Internal Server Error

Internal Server Error