# User Guide: Non-custodially BTC Staking (via Script)

## Step 1: Create a Merge Order via Web UI

Go to [Merge Marketplace](https://app.b14g.xyz/marketplace) and connect your EVM wallet (OKX wallet).

<figure><img src="/files/mwsfWmaitORlgSIbnXOP" alt=""><figcaption><p>Merge Marketplace screen</p></figcaption></figure>

On the main screen, find and click the **‘Create Order’** button.

<figure><img src="/files/FbwVsk3k5FhRhmZc1en1" alt=""><figcaption></figcaption></figure>

{% stepper %}
{% step %}

### Set reward sharing allocation and Create order

Enter the percentage of rewards you want to keep, and the remainder will go to future CORE holders.\
\&#xNAN;*<mark style="color:green;">Please keep in mind that the reward shared portion only applies to the additional rewards gained through CORE dual-staking. Your original BTC staking rewards stay yours and aren’t affected.</mark>*
{% endstep %}

{% step %}

### Copy Reward Address

Reward Address on Core chain (aka **Order address**) will be used to add to BTC staking script in the next step.
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
Each order corresponds to one BTC lock. If you want to execute multiple BTC locks, you'll need to create multiple orders.
{% endhint %}

<figure><img src="/files/A53A0XxrJsmfUca8821k" alt=""><figcaption></figcaption></figure>

## Step 2: Run BTC Staking Script

Staking on b14g follows Core’s non-custodial BTC staking model. You can use CoreDAO’s BTC staking tool here: <https://github.com/coredao-org/btc-staking-tool>.

{% hint style="info" %}
Just make sure to **replace the reward address with the order address in Step 1.**
{% endhint %}

{% code overflow="wrap" %}

```
// BTC Staking Script

node dist/index.js stake --account tb1qzdvhlak7y8kz0v5hu2tw7qae3969jzrt7rj7n5 --privatekey ${private key} --amount 1000000 --bitcoinnetwork 1 --corenetwork 1 --locktime 1712847585 --rewardaddress ${Order Address} --validatoraddress ${Validator Address}
```

{% endcode %}

{% hint style="success" %}
**That’s it!** Your order is now live. Wait for CORE holders to match with your BTC to enable dual-staking.
{% endhint %}

{% hint style="info" %}
**Why haven't my merge order shown up in marketplace?**

As with all blockchain transactions, it's not instantaneous. Bitcoin deposits take about 6 blocks to confirm. Once confirmed, your order will appear in the marketplace.

Visit the **‘My Portfolio’** tab to view your created orders.
{% endhint %}

{% hint style="info" %}
**Disclaimer**

This document is provided *as is* for educational and testing purposes only. It is **not** intended for production use.

If you choose to run BTC staking via script (without using our web UI), you do so **at your own risk**. The authors, contributors, and maintainers are **not responsible** for any damage, data loss, or legal consequences resulting from its use or misuse.

⚠ **Use with Caution:** The reference repository (Core BTC-staking-tool) may contain bugs, security vulnerabilities, or incomplete features that could affect stability, security, or performance. Always test and review the software in a **safe, controlled environment** before using it elsewhere. **Do not** deploy it in a production setting unless explicitly stated otherwise.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.b14g.xyz/user-guide/for-btc-holders/guide-btc-staking-core-chain/user-guide-non-custodially-btc-staking-via-script.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
