> For the complete documentation index, see [llms.txt](https://docs.b14g.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.b14g.xyz/user-guide/for-btc-holders/guide-btc-staking-core-chain/user-guide-non-custodially-btc-staking-via-script.md).

# 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="https://6440208-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWz8HjUaKRx2ncDQW1eR6%2Fuploads%2F5NCgDo97RuySbtJ1nL48%2FMerge%20Marketplace%20Bitcoin%20restaking%20userguide%202.png?alt=media&amp;token=805b7e0a-d291-4ea5-87ef-69b8c04c8736" alt=""><figcaption><p>Merge Marketplace screen</p></figcaption></figure>

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

<figure><img src="https://6440208-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWz8HjUaKRx2ncDQW1eR6%2Fuploads%2FxZHxre7wHnlfl1qCAa7D%2FUserguide%20(2).png?alt=media&amp;token=236efe87-a84a-4414-a81b-c6c2b4e0ad25" 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.\
*<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="https://6440208-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWz8HjUaKRx2ncDQW1eR6%2Fuploads%2FtAw2ycO0tpNTI7LuLtfN%2FUserguide.png?alt=media&amp;token=2db835dc-e023-446f-9d8a-30046fa37abf" 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 %}
