Skip to content

Commit a16dec3

Browse files
Merge pull request #83 from MarryamZulfiqar/main
Added Updated Docs and Content
2 parents c9e7469 + 9da7fa6 commit a16dec3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+829
-26
lines changed

docs/FAQs/ledger-core-faqs.md

Lines changed: 250 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,250 @@
1+
---
2+
sidebar_label: Hardware Wallet Integration FAQs
3+
hide_table_of_contents: false
4+
sidebar_position: 2
5+
---
6+
7+
# Hardware Wallet Integration on Core FAQs
8+
---
9+
10+
### 1. Why does my Ledger wallet keep creating new addresses?
11+
12+
Ledger devices automatically generate a new address each time you connect them. This behavior can cause redemption transactions to fail because the redemption process requires the original staking address that was used to initiate the BTC staking transaction. Therefore, it is recommended always to record the Bitcoin address you used for staking.
13+
14+
### 2. How can I find my original staking address?
15+
16+
There are multiple ways to locate your original Bitcoin staking address.
17+
18+
1. Navigate to your BTC staking records on the [My Staking](https://stake.coredao.org/my-staking#btc) dashboard on the [Core Staking Website](https://stake.coredao.org/staking).
19+
20+
2. Copy the Bitcoin Staking Transaction hash. Clicking on it will navigate the user to transaction details on the [Mempool.Space Bitcoin Explorer](https://mempool.space/).
21+
22+
<p align="center" style={{zoom:"40%"}}>
23+
![copt-tx-hash](../../static/img/ledger-core/staking-tx-copy.png)
24+
</p>
25+
26+
3. Navigate to [Core Scan Block Explorer](https://scan.coredao.org/). From the top navigation menu, click "**More**" and from the drop-down menu select "[BTC Staking Tx Decoder](https://scan.coredao.org/btc-stake-txn-decoder)".
27+
28+
<p align="center" style={{zoom:"60%"}}>
29+
![core-scan-explorer](../../static/img/ledger-core/btc-tx-decoder.png)
30+
</p>
31+
32+
5. Paste the copied Bitcoin Staking transaction hash and click "**Decode**".
33+
34+
<p align="center" style={{zoom:"40%"}}>
35+
![core-scan-explorer](../../static/img/ledger-core/btc-tx-decoder-2.png)
36+
</p>
37+
38+
6. Under the "**Decoded Results**" section, "**Input Address**" is the BTC staking address you have used for initiating the staking transaction. Note that this is **not your public key**, just the specific address used when the timelock transaction was created.
39+
40+
<p align="center" style={{zoom:"40%"}}>
41+
![core-scan-explorer](../../static/img/ledger-core/btc-tx-decoder-3.png)
42+
</p>
43+
44+
### 3. Why does my redemption transaction fail?
45+
46+
If you input a new receiving address instead of the **original staking address**, the redemption transaction will not complete. To successfully redeem your timelock expired BTC ensure that the "**BTC Receiving Address**" you provide during redemption matches the **original Bitcoin staking address**, the address that initiated the staking transaction. You can confirm the address by checking your transaction details on the [mempool.space](https://mempool.space/) or using the [Core Bitcoin Tx Decoder](https://scan.coredao.org/btc-stake-txn-decoder).
47+
48+
### 4. Is staking and redemption possible directly with the Ledger device?
49+
50+
Yes, both staking and redemption are possible, provided you use the same BTC receiving address for redemption as you used for staking. Also, the **_only_** Segwit Native Bitcoin Address type is supported.
51+
52+
### 5. When I connect my ledger device, why is the balance shown incorrect on the UI?
53+
54+
When you connect your Ledger device to UI, the platform only shows the balance of your **primary staking address**. It does **not** read your
55+
total balance under your Ledger public key. If you have multiple BTC addresses, only the balance in the primary Bitcoin addresses is fetched
56+
and displayed.
57+
58+
### 6. Do users earn rewards after the lock period ends if they don't redeem their BTC?
59+
60+
No, once the lock period ends, rewards stop accruing. Users can either **redeem their BTC** manually or if desired, re-delegate manually to
61+
timelock BTC again and start accruing rewards.
62+
63+
### 7. Why do I see "Transaction Error Occurred -- Ledger device: Invalid data received (0x6a80)" during redemption?
64+
65+
<p align="center" style={{zoom:"60%"}}>
66+
![redeem-error-image](../../static/img/ledger-core/redeem-tx-error.png)
67+
</p>
68+
69+
This error typically happens when redeeming BTC after the staking period ends. It means that something in your setup doesn't match the
70+
requirements for a successful redemption. Below are the **known causes** and how to fix them:
71+
72+
1. **Incorrect Ledger App**
73+
74+
- Make sure you are using the **Core app** on your Ledger device, not Bitcoin, Ethereum, or any other app.
75+
- Update Ledger Live and your device firmware to the latest/supported version. Make sure to restore all your accounts after updating.
76+
77+
2. **Wrong BTC Receiving Address Used**
78+
79+
- The "BTC Receiving Address" must be the **original staking address** you used when you first staked your BTC.
80+
81+
- Using a new or different address will result in this error.
82+
83+
- **How to find your original address:** Check your transaction history in Ledger Live, on a block explorer (like [mempool.space](https://mempool.space/)) or using the [Core Bitcoin Tx Decoder](https://scan.coredao.org/btc-stake-txn-decoder).
84+
85+
3. **Not the Primary Staking Address**
86+
87+
- If you have multiple BTC accounts under your Ledger wallet, the system will only detect your **primary (original)** staking address.
88+
89+
- Be sure to connect to the same account and address used during the original staking.
90+
91+
4. **Unsynced Ledger or Browser Cache Issues**
92+
93+
- Refresh the staking site and reconnect your Ledger.
94+
95+
- Clear your browser cache or try using a different browser.
96+
97+
### 8. How do you set up a Bitcoin address on a Ledger device using Ledger Live?
98+
99+
1. In Ledger Live, click "**My ledger"** tab and connect your Ledger drive
100+
101+
2. Search and install the Bitcoin app on your Ledger device.
102+
103+
3. Navigate to the **Accounts** tab and click **Add Account**.
104+
105+
<p align="center" style={{zoom:"40%"}}>
106+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-1.png)
107+
</p>
108+
109+
4. Search "**Bitcoin**" and select "**Bitcoin (BTC)**". Press continue.
110+
111+
<p align="center" style={{zoom:"32%"}}>
112+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-2.png)
113+
</p>
114+
115+
5. Approve the connection for Ledger Live on the Bitcoin app through your Ledger device.
116+
117+
6. Select the **Native Segwit** account type.
118+
119+
<p align="center" style={{zoom:"60%"}}>
120+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-3.png)
121+
</p>
122+
123+
7. You have successfully added a Bitcoin account to your ledger device using the Bitcoin app. For more details on setting up your first Bitcoin Account on a Ledger device, refer [here](https://support.ledger.com/article/115005195945-zd).
124+
125+
<p align="center" style={{zoom:"60%"}}>
126+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-4.png)
127+
</p>
128+
129+
### 9. How do you set up a Bitcoin address on a Ledger device using Xverse Wallet?
130+
131+
1. Connect your Ledger device to the Ledger Live application on your computer. Click on the Account title on the Xverse wallet.
132+
133+
<p align="center" style={{zoom:"40%"}}>
134+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-5.png)
135+
</p>
136+
137+
2. Click on the **Add hardware wallet account**.
138+
139+
<p align="center" style={{zoom:"40%"}}>
140+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-6.png)
141+
</p>
142+
143+
3. Select **Connect Ledger** from the listed devices.
144+
145+
<p align="center" style={{zoom:"40%"}}>
146+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-7.png)
147+
</p>
148+
149+
4. Navigate through the setup wizard for setting up the account. Click **Get Started**.
150+
151+
<p align="center" style={{zoom:"40%"}}>
152+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-8.png)
153+
</p>
154+
155+
5. From the **Select Asset** model, select the **Bitcoin, Runes & Oridnals** option. Click Continue.
156+
157+
<p align="center" style={{zoom:"40%"}}>
158+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-9.png)
159+
</p>
160+
161+
6. Proceed by selecting **I am using Ledger Live with this device**.
162+
163+
<p align="center" style={{zoom:"40%"}}>
164+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-10.png)
165+
</p>
166+
167+
7. Acknowledge the Risk Notification.
168+
169+
<p align="center" style={{zoom:"40%"}}>
170+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-11.png)
171+
</p>
172+
173+
8. Make sure your device is unlocked and the Bitcoin app is open. Click **Connect**. Select your device from the device list.
174+
175+
<p align="center" style={{zoom:"40%"}}>
176+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-12.png)
177+
</p>
178+
179+
9. Choose to add a Bitcoin wallet by clicking on **Add new account**.
180+
181+
<p align="center" style={{zoom:"40%"}}>
182+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-13.png)
183+
</p>
184+
185+
10. User will be prompted to confirm the Ordinals address on their Ledger device.
186+
187+
<p align="center" style={{zoom:"40%"}}>
188+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-14.png)
189+
</p>
190+
191+
11. Continue on the ledger device to confirm the address
192+
193+
<p align="center" style={{zoom:"90%"}}>
194+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-15.png)
195+
</p>
196+
197+
12. User will be prompted to verify the Bitcoin receiving address on their Ledger device.
198+
199+
<p align="center" style={{zoom:"40%"}}>
200+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-16.png)
201+
</p>
202+
203+
13. Continue on the ledger device to confirm the address
204+
205+
<p align="center" style={{zoom:"80%"}}>
206+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-17.png)
207+
</p>
208+
209+
14. Once confirmed, the user will be prompted for successful set of wallets
210+
211+
<p align="center" style={{zoom:"40%"}}>
212+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-18.png)
213+
</p>
214+
215+
15. Specify the wallet name that you want the account to appear on Xverse.
216+
217+
<p align="center" style={{zoom:"40%"}}>
218+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-19.png)
219+
</p>
220+
221+
16. Click "Confirm" to proceed. The ledger device's Bitcoin address is now added to your Xverse wallet by the name you specified in the
222+
previous step. Note this name is just for Xverse and will not be reflected in Ledger.
223+
224+
<p align="center" style={{zoom:"40%"}}>
225+
![setup-ledger-live-bitcoin-address](../../static/img/ledger-core/Xverse_screenshots/xverse-add-account-20.png)
226+
</p>
227+
228+
### 10. I have multiple Bitcoin addresses on my Ledger device. How to identify the primary account?
229+
230+
1. Connect your Ledger device to the Ledger Live application on your computer. Navigate to the "**Accounts**" tab.
231+
232+
2. By default, the accounts are listed in the order of creation.
233+
234+
4. Alternatively, from the listed accounts, click on the Bitcoin account.
235+
236+
5. Click on the "**Settings**" icon in the top right corner of the account details page.
237+
238+
6. Click "**Advanced**" on the "**Edit Account**" modal.
239+
240+
7. If the "**Index**" value is set to 0, the account is your primary account.
241+
242+
<p align="center" style={{zoom:"40%"}}>
243+
![identify-bitcoin-primary-address](../../static/img/ledger-core/bitcoin-address-identificaiton.png)
244+
</p>
245+
246+
247+
### 11. Can we use any other wallet other than Xverse to set up a Bitcoin address on Ledger devices for staking Bitcoin on Core?
248+
249+
Currently, only Bitcoin addresses generated through Ledger Live and Xverse Wallet have been thoroughly tested and verified for compatibility. Addresses created using other wallets have not yet been tested, and functionality cannot be guaranteed. Users choosing to
250+
proceed with untested wallets should do so at their own risk.
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
sidebar_label: Rev+ Compatibility Guide
3+
description: Compatibility Guide for Rev+
4+
hide_table_of_contents: false
5+
sidebar_position: 2
6+
---
7+
8+
# Rev+ Enabled Contracts: Compatibility Guide
9+
---
10+
11+
This guide outlines best practices and configuration steps to ensure compatibility between popular Ethereum development frameworks, including Foundry and Hardhat, as well as frontend libraries like **`ethers.js`**, when interacting with Rev+ enabled contracts.
12+
13+
## Foundry
14+
15+
**Foundry** is a high-performance toolkit for EVM development, featuring tools such as Forge for scripting and testing smart contracts. When working with Rev+ enabled contracts, gas usage may be slightly higher because the contract includes revenue allocation logic for Rev+ participants.
16+
17+
#### Adjust Gas Estimates with `--gas-estimate-multiplier`
18+
19+
Rev+ introduces additional gas overhead not automatically handled by Foundry’s default gas estimation logic.
20+
21+
* Use the `--gas-estimate-multiplier` flag to increase the estimated gas.
22+
* **Recommended Range**: `200–500`, depending on the complexity of the contract and the nature of the Rev+ integration.
23+
* Use the `--legacy` flag with Foundry for better compatibility.
24+
25+
**Example:**
26+
27+
```shell
28+
forge script script/MyScript.s.sol --rpc-url <URL> --gas-estimate-multiplier 500 --broadcast --legacy
29+
```
30+
31+
#### Thoroughly Test with Multiple Gas Values
32+
33+
Because gas usage can vary due to runtime execution paths and Rev+ logic, it’s essential to:
34+
35+
* Start with a higher gas multiplier (e.g., 500\)
36+
* Test progressively lower values to determine the optimal multiplier
37+
* Ensure robustness against out-of-gas failures
38+
39+
## Hardhat
40+
41+
**Hardhat** is a widely used framework for developing EVM-based smart contracts. It supports interaction with Rev+ enabled contracts but requires manual configuration for gas.
42+
43+
#### Manual Gas Estimation
44+
45+
For Rev+ enabled contracts, `eth_estimateGas` provides a reliable gas estimate that includes the additional logic. No multiplier is required; just pass the estimated value as `gasLimit`.
46+
47+
**Example:**
48+
49+
```javascript
50+
const estimatedGas = await contract.estimateGas.myMethod(...args);
51+
52+
await contract.myMethod(...args, {
53+
gasLimit: estimatedGas,
54+
});
55+
```
56+
57+
## Frontend Integration with Rev+ Enabled Contracts
58+
59+
When integrating Rev+ enabled contracts into frontend applications (e.g., using **ethers.js**, **wagmi**, or **web3.js**), similar practices to those of Hardhat must be followed to ensure reliable transaction execution.
60+
61+
### Best Practices
62+
63+
* **Gas Estimation**: Use the `.estimateGas.method()` to estimate gas usage.
64+
* **No Multiplier Needed**: Use the estimated value directly.
65+
* **Error Handling**: Implement fallbacks for `out-of-gas errors` to enhance the user experience.
66+
67+
**Example (ethers.js):**
68+
69+
```javascript
70+
const estimatedGas = await contract.estimateGas.myMethod(...args);
71+
72+
const tx = await contract.myMethod(...args, {
73+
gasLimit: estimatedGas,
74+
gasPrice: ethers.utils.parseUnits("50", "gwei"),
75+
});
76+
```
77+
78+
## Conclusion
79+
80+
When interacting with Rev+ enabled contracts:
81+
82+
* **Adjust gas estimates in Foundry using the `--gas-estimate-multiplier`** flag.
83+
* **Use legacy transaction formatting** in Foundry
84+
* **Manually estimate the gas** and pass the estimated value explicitly when interacting through the **frontend** or **Hardhat**
85+
* **Test extensively** under different runtime conditions to ensure robustness.

0 commit comments

Comments
 (0)