Skip to main content

Bitcoin Cash (BCH)

UTXO-based signing, same payload shape as Bitcoin. Provide the previous transactions for the inputs you spend; the device signs each input by its keyPath. Bitcoin Cash is legacy-only (P2PKH) — there is no SegWit or Taproot.

FieldValue
FamilyBitcoin (UTXO)
coinType145
keyPathm/44'/145'/<accountIdx>'/0/0
amount unitsatoshi
chainIdbip122:000000000000000000651ef99cb9fcbe/slip44:145

Supported Methods​

MethodSupported
getAddress✓
signTransaction✓
signMessage✗
signTypedData✗
signData✗

Requirements​

Minimum firmware for each method. The two models are on different version lines, so DCENT Biometric Wallet and DCENT X are listed separately (the numbers are not comparable across models). Below this the request returns the firmware-update error (5005) and the bridge prompts to update.

MethodDCENT Biometric WalletDCENT X
getAddress1.5.1 or higher1.0.0 or higher
signTransaction1.5.1 or higher1.0.0 or higher

addressFormat​

FormatPathStatus
CashAddr P2PKH (bitcoincash:q…) — no addressFormat value; omit it (legacy is accepted and ignored; ledger / standard are rejected)m/44'/145'/0'/0/0Only format
warning

CashAddr only — addressFormat has no effect. Bitcoin Cash is a single-format chain: the encoding values of addressFormat are ignored (ledger / standard are rejected with param_error), and on DCENT X getAddress returns a CashAddr P2PKH address (bitcoincash:q…), never a 1… base58 form; and addressFormat:'cashaddr' is not a recognised value — the bridge rejects it with param_error. No SegWit / no Taproot: inputs are always p2pkh and the derivation purpose is always 44'.

getAddress — account address​

Retrieves the Bitcoin Cash account address — on DCENT X a CashAddr P2PKH address (bitcoincash:q…). Bitcoin Cash is single-format — omit addressFormat.

FieldTypeRequiredSourceNotes
chainIdstringRequiredAppFull CAIP-19 — bip122:000000000000000000651ef99cb9fcbe/slip44:145
keyPathstringRequiredAppBIP-44, default m/44'/145'/0'/0/0
addressFormatenumOptionalAppNo effect — Bitcoin Cash has a single format (CashAddr on DCENT X). Omit it. (cashaddr, ledger and standard are rejected with param_error; legacy is accepted but has no effect.)

Request

await dcent.getAddress({
chainId: 'bip122:000000000000000000651ef99cb9fcbe/slip44:145',
keyPath: "m/44'/145'/0'/0/0"
})

Response

FieldTypeNotes
body.commandstringAlways getAddress
body.parameter.addressstringCashAddr P2PKH (bitcoincash:q…) on DCENT X
header.statusstringsuccess on completion
{
"header": {
"version": "1.0",
"status": "success",
"response_from": "getAddress"
},
"body": {
"command": "getAddress",
"parameter": {
"address": "bitcoincash:q…"
}
}
}

signTransaction — <payload.transaction>​

payload.transaction:

{
"inputs": [
{
"rawTransaction": "<prev tx hex>",
"index": 0,
"txType": "p2pkh",
"keyPath": "m/44'/145'/0'/0/0",
"sequence": 4294967295
}
],
"outputs": [
{
"txType": "p2pkh",
"amount": "100000",
"addresses": [
"bitcoincash:q…"
]
}
]
}
FieldTypeRequiredSourceUnitDescription
inputs[].rawTransactionhexRequired-RealWallet—Full prev-tx hex of the UTXO being spent; must be device-owned
inputs[].indexnumberRequiredApp—UTXO output index (utxo_idx)
inputs[].txTypeenumRequiredApp—Always p2pkh on Bitcoin Cash
inputs[].keyPathstringRequired-RealWallet—Path that signs this input (default m/44'/145'/0'/0/0)
inputs[].sequencenumberOptionalApp—When omitted, no sequence is sent and DCENT X then uses 0xffffffff (only Bitcoin mainnet defaults to 0xfffffffd, opt-in RBF). Also note the first input's value applies to the whole transaction (a first-input value of 0 is not sent, so the device's default applies).
outputs[].txTypeenumRequiredApp—p2pkh for a P2PKH recipient. The destination script type is taken from the recipient address (addresses[0]); txType is only checked against the allowed values (p2pkh / p2sh / p2wpkh / p2wsh / change) and marks the change output. p2tr, or a Taproot recipient address (bc1p… / tb1p…), is rejected with -32602
outputs[].amountstringRequiredAppsatoshiOutput value in satoshi (1 BCH = 1e8 satoshi)
outputs[].addressesstring[]Required-RealApp—CashAddr with the bitcoincash: prefix, or legacy base58 (DCENT X rejects a prefix-less q… address). Only addresses[0] is signed (later entries are not signed, but a Bitcoin Taproot address (bc1p… / tb1p…) among them is rejected with -32602 — send a single address), and exactly one non-change output is allowed — more than one destination is rejected with param_error. Use a second output with txType: 'change' for change. The change output's addresses[0] is a BIP-32 derivation path on your own account (for example m/44'/145'/0'/1/0), not an address — the device derives the change address from that path itself. Use a path on the account you are signing with; the full rule is on the Bitcoin page.

Request

await dcent.sign({
method: 'signTransaction',
chainId: 'bip122:000000000000000000651ef99cb9fcbe/slip44:145',
payload: {
keyPath: "m/44'/145'/0'/0/0",
transaction: {
inputs: [
{
rawTransaction: '0100000001abcdef…88ac00000000',
index: 0,
txType: 'p2pkh',
keyPath: "m/44'/145'/0'/0/0",
sequence: 4294967295
}
],
outputs: [
{
txType: 'p2pkh',
amount: '100000',
addresses: [
'bitcoincash:q…'
]
}
]
}
}
}) // → body.parameter.signature

Response

FieldTypeNotes
body.parameter.signaturehexThe broadcast-ready serialized signed transaction — the full Bitcoin Cash raw tx hex, not a bare signature. Push it to a BCH node / broadcast API as-is.
body.commandstringAlways signTransaction
header.statusstringsuccess on completion
{
"header": {
"version": "1.0",
"status": "success",
"response_from": "signTransaction"
},
"body": {
"command": "signTransaction",
"parameter": {
"signature": "<signed raw tx hex>"
}
}
}

Variant — multi-step builder​

As an alternative to the single-call form, the same UTXO builder used for Bitcoin is available (the playground drives it via btx:new / btx:addInput / btx:addOutput / btx:buildAndSign):

const tx = dcent.getBitcoinTransactionObject()
dcent.addBitcoinTransactionInput(tx, prevTxHex, utxoIndex, 'p2pkh', "m/44'/145'/0'/0/0")
dcent.addBitcoinTransactionOutput(tx, 'p2pkh', 100000, 'bitcoincash:q…')
// then sign

Common Mistakes​

danger

Using a SegWit path or txType — Bitcoin Cash has no SegWit. The path must use purpose 44' with coinType 145 (never m/84' or m/49'). Expecting a base58 1… address — DCENT X returns only CashAddr (bitcoincash:q…); there is no 1… output and addressFormat does not change it. Convert client-side if a receiver requires legacy base58. Missing change output — any input value not assigned to an output becomes the miner fee. Amounts not in satoshi — amount is an integer in satoshi (1 BCH = 1e8).