> For the complete documentation index, see [llms.txt](https://dev-docs.dcentwallet.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev-docs.dcentwallet.com/dcent-biometric-wallet-for-pc/dcent-web-connector/bitcoin.md).

# Bitcoin

## Sign Transaction

The D'CENT Web SDK provides functions for signing transaction of coins.

### **getBitcoinSignedTransaction()**

#### Supported Coin Type

* BITCOIN
* MONACOIN

#### Parameters :

* transaction: this value generated by `getBitcoinTransactionObject()`

#### Usage:

```javascript
// generate Bitcoin Transaction object
let transaction = DcentWebConnector.getBitcoinTransactionObject(dcent.coinType.BITCOIN)
// Set input parameter(previous tx) in Bitcoin Transaction object
transaction = DcentWebConnector.addBitcoinTransactionInput(transaction,
    '0100000001e297417c46........293fce63b88ac00000000', //  full of previous tx data
    1, // index of previous tx output to be sent
    dcent.bitcoinTxType.p2pkh, // bitcoin tx type for this UTXO
    "m/44'/0'/0'/1/0") // signing key path
transaction = DcentWebConnector.addBitcoinTransactionInput(transaction,
    '0100000001e297417c46.........93fce63b88ac00000000',
    0,
    dcent.bitcoinTxType.p2pkh,
    "m/44'/0'/0'/0/7")
// Set output parameter(spending information) in Bitcoin Transaction object
transaction = DcentWebConnector.addBitcoinTransactionOutput(transaction,
        dcent.bitcoinTxType.p2pkh, // transaction type or this field can indicate output as a “change”
        '10000', // amount of coin to spend. Satoshi unit.
        ['1traqiFvydVk2hWdCj3WGRJbe4CGtfyHA']) // Base58Check encoded address of the receiver.
    result = await DcentWebConnector.getBitcoinSignedTransaction(transaction)
```

#### Returned response object:

```json
{
    "header": {
        "version": "1.0",
        "response_from": "erc20",
        "status": "success"
    },
    "body": {
        "command": "transaction",
        "parameter": {
            "signed": "0100000002233ee1fbcf.....71e088ac00000000"
        }
    }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://dev-docs.dcentwallet.com/dcent-biometric-wallet-for-pc/dcent-web-connector/bitcoin.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
