diff --git a/blog/2025/06-02-2025-welcome.mdx/06-02-2025-welcome.mdx b/blog/2025/06-02-2025-welcome.mdx/06-02-2025-welcome.mdx
new file mode 100644
index 00000000..2f6f901d
--- /dev/null
+++ b/blog/2025/06-02-2025-welcome.mdx/06-02-2025-welcome.mdx
@@ -0,0 +1,8 @@
+---
+title: Babylon Dev Blogs
+date: 2025-06-02
+---
+
+# Babylon Dev Blogs
+
+Welcome to Babylon deveveloper blogs. This is where you can find the latest news and technical updates from the Babylon Labs team.
\ No newline at end of file
diff --git a/docs/developers/bsns/cosmos_chains/cosmos_chains.mdx b/docs/developers/bsns/cosmos_chains/cosmos_chains.mdx
index 982ea3b9..481ba4d6 100644
--- a/docs/developers/bsns/cosmos_chains/cosmos_chains.mdx
+++ b/docs/developers/bsns/cosmos_chains/cosmos_chains.mdx
@@ -22,11 +22,13 @@ for example, X→ Y means "Y queries data from X and the data flows from X to Y"
dark: useBaseUrl('/img/cosmos-integration.png'),
}}
/>
+
The design involves the following main components:
-- **Finality Provider:** a daemon program that receives BTC stake and keeps submitting
-finality signatures over blocks to the BSN chain.
+### Finality Provider
+
+A daemon program that receives BTC stake and keeps submitting finality signatures over blocks to the BSN chain.
- It connects to a BSN chain node to query block metadata.
- It connects to the Babylon contracts on the BSN chain for querying voting
power and submitting finality signatures.
@@ -38,8 +40,9 @@ Upon a new block in the BSN chain, it:
voting power at this height.
- If yes, sign and submit a finality signature to the Babylon contracts.
-- **Babylon Contracts:** a set of CosmWasm smart contracts that maintains IBC channels
-with Babylon and handles finality signatures submitted from Finality Providers
+### Babylon Contracts
+
+A set of CosmWasm smart contracts that maintains IBC channels with Babylon and handles finality signatures submitted from Finality Providers
- It will be deployed on the BSN chain.
- It establishes an IBC channel with Babylon. The IBC channel relays information
about BTC light clients, BTC timestamps and BTC staking.
@@ -53,8 +56,9 @@ Upon a finality signature, the Babylon contracts verify it:
packet to Babylon. Then Babylon emits an event so anyone can slash the Finality
Provider and the BTC stake under it.
-- **Babylon-SDK:** a small Cosmos SDK module serving as a thin layer between Babylon
-contracts and Cosmos SDK level of the BSN chain.
+### Babylon-SDK
+
+A small Cosmos SDK module serving as a thin layer between Babylon contracts and Cosmos SDK level of the BSN chain.
- It sends a sudo message to the Babylon contracts upon each `BeginBlock` , so that
Babylon contracts can update voting power table and tally blocks.
- It moves a part of the reward from the fee collector account to Babylon contracts,
diff --git a/docs/developers/bsns/op_stack_chains/op_stack_chains.mdx b/docs/developers/bsns/op_stack_chains/op_stack_chains.mdx
index 9e681c8b..3bb06136 100644
--- a/docs/developers/bsns/op_stack_chains/op_stack_chains.mdx
+++ b/docs/developers/bsns/op_stack_chains/op_stack_chains.mdx
@@ -21,10 +21,12 @@ The design involves the following main components:
light: useBaseUrl('/img/op-stack-integration.png'),
dark: useBaseUrl('/img/op-stack-integration.png'),
}}
-/>;
+/>
+
-- **Finality Provider:** a daemon program that receives BTC stake and keeps
-submitting finality signatures over L2 blocks to the finality contract on Babylon.
+### Finality Provider
+
+A daemon program that receives BTC stake and keeps submitting finality signatures over L2 blocks to the finality contract on Babylon.
- It connects to a Babylon node to query its voting power.
- It connects to the finality contract via the Babylon node for submitting
finality signatures.
@@ -35,7 +37,10 @@ Upon a new L2 block in the OP-stack chain, It:
- Gets the L2 block metadata.
- Queries Babylon Genesis to determine whether it has voting power at this L2 block height.
- If yes, sign and submit a finality signature to the finality contract.
-- **Finality contract:** a CosmWasm smart contract that maintains all finality signatures submitted from OP-stack Finality Providers.
+
+### Finality Contract
+
+A CosmWasm smart contract that maintains all finality signatures submitted from OP-stack Finality Providers.
- It will be deployed on Babylon Genesis.
- It will query Babylon Genesis to determine the Finality Provider’s status and voting power.
@@ -44,7 +49,10 @@ Upon a finality signature, the finality contract verifies it and identifies equi
- If invalid, reject.
- If valid and non-conflicting with any existing ones, accept.
- If valid but conflicting with an existing finality signature, it emits an event so anyone can slash the Finality Provider and the BTC stake under it.
-- **Finality gadget**: a daemon program that keeps tallying all finality signatures for L2 blocks and serves RPC to allow querying the BTC-voting quorum of those blocks.
+
+### Finality Gadget
+
+A daemon program that keeps tallying all finality signatures for L2 blocks and serves RPC to allow querying the BTC-voting quorum of those blocks.
- It connects to a Babylon node for querying the voting power of Finality Providers.
- It connects to the finality contract via the Babylon node for querying finality signatures.
- It connects to an RPC of the OP stack chain to get L2 block metadata.
@@ -55,7 +63,10 @@ Upon a new L2 block in the OP-stack chain, it:
- Queries Babylon to get all Finality Providers’ BTC delegations for this chain and use the L2 block’s timestamp to determine the voting power distribution among all its Finality Providers at the time of this block.
- Tallies finality signatures and determines whether the L2 block receives a quorum.
- If this L2 block receives a quorum and its parent block is also BTC staking-finalized, marks it as BTC staking-finalized and stores it in the finality gadget’s local database.
-- **OP node with finality gadget:** a modified OP node that enforces BTC-voting quorum before finalizing L2 blocks.
+
+### OP Node with Finality Gadget
+
+A modified OP node that enforces BTC-voting quorum before finalizing L2 blocks.
- It connects to the finality gadget for querying consecutive BTC-voting quorums to determine the finalization status of the L2 blocks.
- It notifies OP-geth about the L2 blocks’ finalization status to move the L2 finalized block head.
@@ -74,13 +85,13 @@ We have finished the reference implementation. The codebases include:
- [btc-staker](https://github.com/babylonlabs-io/btc-staker/tree/base/consumer-chain-support): The BTC Staker program
- [babylon-contract](https://github.com/babylonlabs-io/babylon-contract): The CosmWasm contracts, including the finality contract for OP-stack chains.
- [finality-gadget](https://github.com/babylonlabs-io/finality-gadget): The finality gadget program. It can be used by OP node or user as an SDK or run as a standalone daemon program.
-- [optimism](https://github.com/babylonlabs-io/optimism/tree/feat/babylon-rfc): The fork of OP Stack codebase that installs finality-gadget.
+- [optimism](https://github.com/babylonlabs-io/op-finality-gadget): The fork of OP Stack codebase that installs finality-gadget.
## Local deployments
We have developed local deployment scripts for the OP stack integration.
- https://github.com/Snapchain/babylon-deployment for spinning up an OP stack chain integrating with Babylon Euphrates devnet
-- https://github.com/Snapchain/op-chain-deployment for spinning up the entire stack (OP stack chain + ETH L1 + Babylon + Bitcoin)
+- https://github.com/Snapchain/op-chain-deployment for spinning up the entire stack (OP stack chain + ETH L1 + Babylon Genesis + Bitcoin)
---
diff --git a/docs/guides/architecture/babylon_genesis_modules/btc_checkpointing.mdx b/docs/guides/architecture/babylon_genesis_modules/btc_checkpointing.mdx
index acaa0105..865165b0 100644
--- a/docs/guides/architecture/babylon_genesis_modules/btc_checkpointing.mdx
+++ b/docs/guides/architecture/babylon_genesis_modules/btc_checkpointing.mdx
@@ -12,9 +12,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/babylon/refs/heads/main/x/btccheckpoint/README.md";
diff --git a/docs/guides/architecture/babylon_genesis_modules/btc_lightclient.mdx b/docs/guides/architecture/babylon_genesis_modules/btc_lightclient.mdx
index f599b5b9..025e19e0 100644
--- a/docs/guides/architecture/babylon_genesis_modules/btc_lightclient.mdx
+++ b/docs/guides/architecture/babylon_genesis_modules/btc_lightclient.mdx
@@ -12,9 +12,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/babylon/refs/heads/main/x/btclightclient/README.md";
diff --git a/docs/guides/architecture/babylon_genesis_modules/btc_staking.mdx b/docs/guides/architecture/babylon_genesis_modules/btc_staking.mdx
index a0baaddc..9a5f28ff 100644
--- a/docs/guides/architecture/babylon_genesis_modules/btc_staking.mdx
+++ b/docs/guides/architecture/babylon_genesis_modules/btc_staking.mdx
@@ -12,9 +12,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/babylon/refs/heads/main/x/btcstaking/README.md";
diff --git a/docs/guides/architecture/babylon_genesis_modules/checkpointing.mdx b/docs/guides/architecture/babylon_genesis_modules/checkpointing.mdx
index 6202eef1..115e1fee 100644
--- a/docs/guides/architecture/babylon_genesis_modules/checkpointing.mdx
+++ b/docs/guides/architecture/babylon_genesis_modules/checkpointing.mdx
@@ -12,9 +12,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/babylon/refs/heads/main/x/checkpointing/README.md";
diff --git a/docs/guides/architecture/babylon_genesis_modules/epoching.mdx b/docs/guides/architecture/babylon_genesis_modules/epoching.mdx
index 4c5a2ebd..78c1ee08 100644
--- a/docs/guides/architecture/babylon_genesis_modules/epoching.mdx
+++ b/docs/guides/architecture/babylon_genesis_modules/epoching.mdx
@@ -12,9 +12,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/babylon/refs/heads/main/x/epoching/README.md";
diff --git a/docs/guides/architecture/babylon_genesis_modules/finality.mdx b/docs/guides/architecture/babylon_genesis_modules/finality.mdx
index 6f8540e0..882abc6f 100644
--- a/docs/guides/architecture/babylon_genesis_modules/finality.mdx
+++ b/docs/guides/architecture/babylon_genesis_modules/finality.mdx
@@ -12,9 +12,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/babylon/refs/heads/main/x/finality/README.md";
diff --git a/docs/guides/architecture/btc_staking_program/btc_reorg_procedure.mdx b/docs/guides/architecture/btc_staking_program/btc_reorg_procedure.mdx
index a5be361d..75a7980d 100644
--- a/docs/guides/architecture/btc_staking_program/btc_reorg_procedure.mdx
+++ b/docs/guides/architecture/btc_staking_program/btc_reorg_procedure.mdx
@@ -13,9 +13,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/babylon/refs/heads/main/x/btcstaking/docs/btc-reorg.md";
diff --git a/docs/guides/architecture/btc_staking_program/finality_providers.mdx b/docs/guides/architecture/btc_staking_program/finality_providers.mdx
index d9eed305..91c1cd50 100644
--- a/docs/guides/architecture/btc_staking_program/finality_providers.mdx
+++ b/docs/guides/architecture/btc_staking_program/finality_providers.mdx
@@ -11,9 +11,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/finality-provider/refs/heads/main/README.md";
\ No newline at end of file
diff --git a/docs/guides/architecture/consumer_zone_programs/babylon_contracts.mdx b/docs/guides/architecture/consumer_zone_programs/babylon_contracts.mdx
index e8334940..fa49500d 100644
--- a/docs/guides/architecture/consumer_zone_programs/babylon_contracts.mdx
+++ b/docs/guides/architecture/consumer_zone_programs/babylon_contracts.mdx
@@ -32,10 +32,7 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/babylon-contract/refs/heads/main/README.md";
diff --git a/docs/guides/architecture/consumer_zone_programs/zone_concierge.mdx b/docs/guides/architecture/consumer_zone_programs/zone_concierge.mdx
index 9b8e388c..51e4d4ca 100644
--- a/docs/guides/architecture/consumer_zone_programs/zone_concierge.mdx
+++ b/docs/guides/architecture/consumer_zone_programs/zone_concierge.mdx
@@ -12,9 +12,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/babylon/refs/heads/main/x/zoneconcierge/README.md";
diff --git a/docs/guides/baby_stakers/baby_staking_cli.mdx b/docs/guides/baby_stakers/baby_staking_cli.mdx
index 019b33a7..84b7f2eb 100644
--- a/docs/guides/baby_stakers/baby_staking_cli.mdx
+++ b/docs/guides/baby_stakers/baby_staking_cli.mdx
@@ -1,6 +1,6 @@
---
sidebar_class_name: baby_staking_cli_sidebar
-sidebar_position: 4
+sidebar_position: 5
---
# BABY Staking CLI Guide
diff --git a/docs/guides/baby_stakers/baby_staking_integration.mdx b/docs/guides/baby_stakers/baby_staking_integration.mdx
index c79e2fce..4e19fcce 100644
--- a/docs/guides/baby_stakers/baby_staking_integration.mdx
+++ b/docs/guides/baby_stakers/baby_staking_integration.mdx
@@ -1,7 +1,7 @@
---
title: BABY Staking Integration
sidebar_label: BABY Staking Integration
-sidebar_position: 4
+sidebar_position: 6
---
# BABY Staking Integration
diff --git a/docs/guides/baby_stakers/baby_staking_via_mintscan.mdx b/docs/guides/baby_stakers/baby_staking_via_mintscan.mdx
new file mode 100644
index 00000000..6058cb24
--- /dev/null
+++ b/docs/guides/baby_stakers/baby_staking_via_mintscan.mdx
@@ -0,0 +1,160 @@
+---
+sidebar_class_name: baby_staking_cli_sidebar
+sidebar_position: 4
+---
+import useBaseUrl from '@docusaurus/useBaseUrl';
+import ThemedImage from '@theme/ThemedImage';
+
+# BABY Staking via Mintscan
+A step-by-step guide to staking BABY tokens on the Babylon Genesis mainnet using
+Mintscan.
+
+## Prerequisites
+Before you start, make sure you have:
+- a crypto wallet compatible with Mintscan installed on your browser
+- a Babylon Genesis mainnet wallet created
+- acquired BABY tokens
+
+## Step by Step guide
+
+### 1. Access Mintscan
+
+Open the Mintscan website: [Mintscan](https://www.mintscan.io).
+
+### 2. Navigate to the Staking Page
+
+2.1. On the homepage, click on **"Stake"** from the left navigation bar. This will
+take you to the staking page.
+
+
+
+### 3. Connect Your Wallet
+
+3.1. On staking page it will prompt you to **connect your wallet**. Click on the
+option to connect your wallet.
+
+
+3.2. Select the digital wallet you prefer to use using. As an example **Keplr** is
+used in this guide.
+
+3.3. Follow the prompts to complete the connection on your wallet.
+
+
+### 4. Select BABY Token
+
+4.1. After connecting your wallet, you will need to select BABY token for staking.
+
+
+
+### 5. Choose a Validator
+
+5.1. Browse through validators list and select the one you want to delegate to. You
+can refer to Mintscan's [Validator Summary](https://www.mintscan.io/babylon/validators)
+page to get more information about their ranking and performances. Higher commission
+rate means less BABY staking rewards for you.
+
+
+
+### 6. Enter the Staking Amount
+
+6.1. Enter the amount of BABY tokens you want to stake.
+
+
+
+### 7. Submit the Transaction
+
+7.1. After entering the staking amount, click the **"Stake"** button to submit the
+transaction.
+
+
+
+2. A success message will appear on the next page, confirming that your
+transaction has been successfully submitted.
+
+
+
+### 8. Monitor Your Investment
+
+8.1. You can return to the staking page to view the status of your staking. Staking
+information is also listed on Mintscan's [Babylon page](https://www.mintscan.io/babylon).
+
+8.2. Regularly check your rewards and staking activities to ensure everything is in
+order.
+
+
+
+### 9. Claim rewards
+
+9.1. The reward will be accumulated over time per Babylon Genesis block.You can
+claim your rewards by clicking the **"Claim"** button on your crypto wallet.
+
+### Conclusion
+
+By following these steps, you can easily stake on Mintscan. By doing this, you are
+contributing to the security and stability of the Babylon Genesis mainnet and you
+also earn staking rewards in BABY.
+
+If you have any questions or need further assistance, please contact us on
+[Discord](https://discord.com/invite/babylonglobal) or contact the maintainer
+[Cosmostation](https://cosmostation.io) at [support@cosmostation.io](mailto:support@cosmostation.io)
+for support!
\ No newline at end of file
diff --git a/docs/guides/btc_stakers/btc_staking_tools.mdx b/docs/guides/btc_stakers/btc_staking_tools.mdx
index 2304e4b8..e27b9211 100644
--- a/docs/guides/btc_stakers/btc_staking_tools.mdx
+++ b/docs/guides/btc_stakers/btc_staking_tools.mdx
@@ -51,7 +51,7 @@ import HardwareBadge from '@site/src/components/badge/hardware';
| Xverse | ❌ | ❌ |
| Gate wallet | ✅ | ✅ |
| Unisat Wallet | ✅ | ✅ |
- | Keplr | ❌ | ❌ |
+ | Keplr | ✅ | ✅ |
| Cosmostation | ✅ | ✅ |
| Leap wallet | ✅ | ✅ |
| Imtoken | ❌ | ❌ |
diff --git a/docs/guides/btc_stakers/native_staking/web_staking.mdx b/docs/guides/btc_stakers/native_staking/web_staking.mdx
index 36d85332..d508ed1c 100644
--- a/docs/guides/btc_stakers/native_staking/web_staking.mdx
+++ b/docs/guides/btc_stakers/native_staking/web_staking.mdx
@@ -195,7 +195,7 @@ will be active.
| OneKey | ✅ | ✅ |
| BitGet | ✅ | ✅ |
| Leap | ✅ | ✅ |
-| Keplr | ❌ | ❌ |
+| Keplr | ✅ | ✅ |
| Cosmostation | ✅ | ✅ |
| Tomo | ✅ | ✅ |
| Xverse | ❌ | ❌ |
diff --git a/docs/guides/networks/phase-1/mainnet/covonent_committee/covonent_committee.mdx b/docs/guides/networks/phase-1/mainnet/covonent_committee/covonent_committee.mdx
index b85a8147..77da0f87 100644
--- a/docs/guides/networks/phase-1/mainnet/covonent_committee/covonent_committee.mdx
+++ b/docs/guides/networks/phase-1/mainnet/covonent_committee/covonent_committee.mdx
@@ -14,11 +14,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/networks/refs/heads/main/bbn-1/covenant-committee/README.md";
diff --git a/docs/guides/networks/phase-1/mainnet/finality_provider_registration.mdx b/docs/guides/networks/phase-1/mainnet/finality_provider_registration.mdx
index 0a44eef4..cc2e4f0e 100644
--- a/docs/guides/networks/phase-1/mainnet/finality_provider_registration.mdx
+++ b/docs/guides/networks/phase-1/mainnet/finality_provider_registration.mdx
@@ -13,9 +13,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/networks/refs/heads/main/bbn-1/finality-providers/README.md";
diff --git a/docs/guides/networks/phase-1/mainnet/global_parameters.mdx b/docs/guides/networks/phase-1/mainnet/global_parameters.mdx
index 9b51069d..aae00933 100644
--- a/docs/guides/networks/phase-1/mainnet/global_parameters.mdx
+++ b/docs/guides/networks/phase-1/mainnet/global_parameters.mdx
@@ -13,9 +13,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/networks/refs/heads/main/bbn-1/parameters/README.md";
diff --git a/docs/guides/networks/phase-1/testnet/covonent_committee/covonent_committee.mdx b/docs/guides/networks/phase-1/testnet/covonent_committee/covonent_committee.mdx
index 7a545ec8..1c0362c8 100644
--- a/docs/guides/networks/phase-1/testnet/covonent_committee/covonent_committee.mdx
+++ b/docs/guides/networks/phase-1/testnet/covonent_committee/covonent_committee.mdx
@@ -14,9 +14,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonchain/networks/refs/heads/main/bbn-test-4/covenant-committee/README.md";
diff --git a/docs/guides/networks/phase-1/testnet/finality_provider_registration.mdx b/docs/guides/networks/phase-1/testnet/finality_provider_registration.mdx
index 15e975b0..d8cb6246 100644
--- a/docs/guides/networks/phase-1/testnet/finality_provider_registration.mdx
+++ b/docs/guides/networks/phase-1/testnet/finality_provider_registration.mdx
@@ -13,9 +13,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonchain/networks/refs/heads/main/bbn-test-4/finality-providers/README.md";
diff --git a/docs/guides/networks/phase-1/testnet/global_parameters.mdx b/docs/guides/networks/phase-1/testnet/global_parameters.mdx
index b1d4e775..e3f4583f 100644
--- a/docs/guides/networks/phase-1/testnet/global_parameters.mdx
+++ b/docs/guides/networks/phase-1/testnet/global_parameters.mdx
@@ -13,9 +13,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonchain/networks/refs/heads/main/bbn-test-4/parameters/README.md";
diff --git a/docs/guides/networks/phase-2/mainnet/mainnet.mdx b/docs/guides/networks/phase-2/mainnet/mainnet.mdx
index 821e4ce0..b7234af5 100644
--- a/docs/guides/networks/phase-2/mainnet/mainnet.mdx
+++ b/docs/guides/networks/phase-2/mainnet/mainnet.mdx
@@ -13,10 +13,7 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/networks/refs/heads/main/bbn-1/README.md";
diff --git a/docs/guides/networks/phase-2/testnet/testnet.mdx b/docs/guides/networks/phase-2/testnet/testnet.mdx
index ed7a4854..cc766070 100644
--- a/docs/guides/networks/phase-2/testnet/testnet.mdx
+++ b/docs/guides/networks/phase-2/testnet/testnet.mdx
@@ -13,10 +13,7 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/networks/refs/heads/main/bbn-test-5/README.md";
diff --git a/docs/guides/networks/phase-3/devnet/devnet.mdx b/docs/guides/networks/phase-3/devnet/devnet.mdx
index 3126c851..9d060df0 100644
--- a/docs/guides/networks/phase-3/devnet/devnet.mdx
+++ b/docs/guides/networks/phase-3/devnet/devnet.mdx
@@ -13,9 +13,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/networks/refs/heads/jenks/add-phase-3-devnet-parameters/euphrates-0.5.0/README.md";
diff --git a/docs/guides/overview/phases_of_the_launch/phase-2/eligibility.mdx b/docs/guides/overview/phases_of_the_launch/phase-2/eligibility.mdx
index 9e039380..3ea9edc3 100644
--- a/docs/guides/overview/phases_of_the_launch/phase-2/eligibility.mdx
+++ b/docs/guides/overview/phases_of_the_launch/phase-2/eligibility.mdx
@@ -13,9 +13,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/babylon/refs/heads/main/x/btcstaking/docs/registration-eligibility.md";
\ No newline at end of file
diff --git a/docs/guides/overview/phases_of_the_launch/phase-2/registration.mdx b/docs/guides/overview/phases_of_the_launch/phase-2/registration.mdx
index 5ae98b9a..5f0738ae 100644
--- a/docs/guides/overview/phases_of_the_launch/phase-2/registration.mdx
+++ b/docs/guides/overview/phases_of_the_launch/phase-2/registration.mdx
@@ -13,9 +13,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/babylon/refs/heads/main/docs/register-bitcoin-stake.md";
\ No newline at end of file
diff --git a/docs/guides/security/audit_reports.mdx b/docs/guides/security/audit_reports.mdx
index 71a17ee9..f3284212 100644
--- a/docs/guides/security/audit_reports.mdx
+++ b/docs/guides/security/audit_reports.mdx
@@ -103,4 +103,31 @@ Audits for the Babylon Genesis Chain are conducted by [Coinspect](https://www.co
+### Babylon Genesis v2 Audits
+Audits for the [Babylon Genesis v2 Upgrade](https://babylonlabs.io/blog/babylon-genesis-v2-upgrade) are conducted by [Oak Security GmbH](https://oaksecurity.io/) and [Informal Systems](https://informal.systems/).
+
+
+
+ {() => (
+
+ )}
+
+
+ {() => (
+
+ )}
+
+
diff --git a/docs/guides/specifications/bitcoin_staking_scripts.mdx b/docs/guides/specifications/bitcoin_staking_scripts.mdx
index 523f2e38..2762b064 100644
--- a/docs/guides/specifications/bitcoin_staking_scripts.mdx
+++ b/docs/guides/specifications/bitcoin_staking_scripts.mdx
@@ -7,323 +7,16 @@ sidebar_position: 3
# Bitcoin Staking Scripts
-## Introduction
-
-Babylon's BTC staking protocol turns Bitcoin into a staking asset with the aim
-to enhance the economic security of Babylon Genesis. Bitcoin holders can stake
-their Bitcoin by locking them using a special transaction on the Bitcoin chain.
-The locked Bitcoin contributes to Babylon Genesis's economic security and generates
-yields for the Bitcoin stakers.
-The protocol has the following important properties:
-
-1. Staking is trustless and self-custodial, meaning it does not require
- bridging, wrapping, 3rd-party custody/multi-sig, or oracles.
-2. The stake voting power is delegatable, a common feature of Delegated PoS
- (DPoS) protocols.
-3. Stake security: the staked Bitcoin is slashed if and only if the BTC Staker
- itself (and in the case of delegation, its delegatee) is malicious. This implies
- that, even if Babylon Genesis is compromised and taken over by malicious
- actors, as long as the BTC Staker itself (and the validator it delegates to
- in case of delegation) is not malicious, its bitcoin stake is secure.
-4. The protocol supports fractional slashing, meaning the protocol can be
- configured so that when slashing happens, only a fraction of the staked
- bitcoins are slashed, and the rest is returned to the staker.
-5. The protocol allows stakers to on-demand unbond. On-demand unbonding; means
- the BTC staker can withdraw from staking with an unbonding delay.
-6. Atomic slashing; means that if a delegator is slashed, then all the
- delegators of the same delegatee, including the delegatee's self-delegation,
- will be subject to slashing. In other words, the delegatee cannot
- selectively harm any specific delegator.
-7. (WIP) Restakable; means that the same Bitcoin can be staked to secure
- multiple PoS chains and earn multiple PoS yields
-
-In the entire Bitcoin staking process, two parties are involved: one is called
-the Bitcoin Staker, and the other is called the Finality Provider.
-
-- **Bitcoin Staker**: A Bitcoin Staker is an entity identified by ``
-in staking scripts. Note that a staking transaction can be funded from
-arbitrary UTXO, including those owned by multisig/MPC/threshold accounts.
-Thus, `` is not necessarily the address of the source of the fund.
-Rather, it is the controller and beneficiary of the stake after its creation.
-- **Finality Provider**: A Finality Provider is an entity that votes
-in the finality round to provide security assurance to the PoS chain.
-
-The Bitcoin Staker can choose a specific Finality Provider to delegate
-their voting power derived from their locked Bitcoin.
-
-The key to making all these possible is the special construction of BTC
-transactions using BTC scripts.
-
-## Preliminary
-
-Babylon interaction with Bitcoin is heavily based on Bitcoin's
-[Taproot upgrade](https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki).
-This design choice was made due to the heavy usage of
-[Schnorr signatures](https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki)
-that were introduced through the Taproot upgrade.
-
-## Staking Flow
-
-The following diagram shows how different transactions described in the following
-paragraphs create and spend different Bitcoin outputs:
-
-```mermaid
-stateDiagram-v2
- active: Staking output
- unbonding: Unbonding output
- state stake_slashing <>
- state unbonding_slashing <>
- burn_staking: Burn address output
- change_staking: Change output
- burn_unbonding: Burn address output
- change_unbonding: Change output
-
- [*] --> active: Staking transaction
-
- active --> unbonding: Unbonding transaction
-
- unbonding --> [*]: Unbonding withdrawal transaction
-
- unbonding --> unbonding_slashing: Slashing transaction
- unbonding_slashing --> burn_unbonding
- unbonding_slashing --> change_unbonding
- change_unbonding --> [*]: Withdrawal transaction
-
- active --> [*]: Staking withdrawal transaction
-
- active --> stake_slashing: Slashing transaction
-
- stake_slashing --> burn_staking
- stake_slashing --> change_staking
- change_staking --> [*]: Withdrawal transaction
-```
-
-Withdrawal transactions are BTC transactions which transfer Bitcoins to the BTC
-Staker wallet.
-
-## Types of special transactions
-
-There are three special transaction types recognized by Babylon Genesis:
-
-- Staking Transaction
-- Unbonding Transaction
-- Slashing Transaction
-
-### Staking Transaction
-
-The BTC Staker gains voting power by creating a staking transaction. This is a
-Bitcoin transaction that commits a certain amount of to-be-staked Bitcoin to
-Babylon-recognized BTC staking scripts. These scripts lock the stake for a
-chosen amount of BTC blocks and enable other features such as unbonding and
-slashable safety.
-
-The requirements for a valid staking transaction are:
-
-- It can contain an arbitrary number of inputs.
-- It can contain an arbitrary number of outputs. One of those outputs must be
- a Taproot output committing to the BTC staking scripts recognized by Babylon.
- Henceforth known as `Staking Output`.
-
-### Unbonding Transaction
-
-The BTC Staker utilizes the unbonding transaction when they want to unlock
-their stake before their originally committed timelock has expired.
-
-The requirements for a valid unbonding transaction are:
-
-- It contains exactly one input which points to the staking transaction's `Staking
-Output`.
-- It contains exactly one output which must be a Taproot output committing to
- the BTC unbonding scripts recognized by Babylon. Henceforth known as `Unbonding
-Output`.
-
-### Slashing Transaction
-
-The slashing transaction is used to punish a BTC Staker when they (or the
-Finality Provider they have delegated to) perform an offense.
-
-The requirements for a valid slashing transaction are:
-
-- It must have exactly one input pointing to either the staking output or the
- unbonding output.
-- It must have exactly two outputs, the first sending the slashed fraction of
- the funds to a burn address specified in the Babylon Genesis's parameters, and the
- second sending the remaining funds to an output which can be unlocked by the staker
- after the timelock.
-- The fee for the slashing transactions must be larger than or equal to the
- minimal fee specified in Babylon's parameters
-
-## Staking and Unbonding output scripts
-
-In the scripts below, there are three entities, each represented by a BTC public
-key:
-
-- `StakerPK` - BTC Staker public key.
-- `FinalityProviderPk` - Finality Provider public key.
-- `CovenantPk1..CovenantPkN` - public keys of covenant committee members
-There must be no duplicated public keys in created scripts.
-For example, `StakerPK` must never be equal to `FinalityProviderPk`.
-
-### Staking output
-
-The staking output is a Taproot output which can only be spent through a script
-spending path.
-The key spending path is disabled by using the "Nothing Up My Sleeve"
-(NUMS) point as internal key. Chosen point is the one described in
-[BIP341](https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#constructing-and-spending-taproot-outputs)
-i.e,
-
-```
-H = lift_x(0x50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0)
-```
-
-which is a point constructed by taking the hash of the standard uncompressed
-encoding of the secp256k1 base point `G` as the X coordinate.
-
-The staking output can be spent by three script spending paths.
-
-#### 1. Timelock path
-
-The timelock path locks the staker's Bitcoin for a pre-determined number of
-Bitcoin blocks. It commits to a script of the form:
-
-```
- OP_CHECKSIGVERIFY OP_CHECKSEQUENCEVERIFY
-```
-
-where:
-
-- `` is the BTC Staker's public key.
-- `` is the lockup period denoted in Bitcoin blocks. The
- timelock comes into effect after the Bitcoin transaction has been included in a
- mined block. In essence, the script denotes that only the staker can unlock the
- funds after the timelock has passed. It must be lower than `65535`.
-
-#### 2. Unbonding path
-
-The unbonding path allows the staker to on-demand unlock their locked Bitcoin
-before the timelock expires. It commits to a script of the form:
-
-```
- OP_CHECKSIGVERIFY
- OP_CHECKSIG OP_CHECKSIGADD ... OP_CHECKSIGADD
- OP_NUMEQUAL
-```
-
-where:
-
-- `StakerPK` is the BTC staker's public key.
-- `CovenantPk1..CovenantPkN` are the lexicographically sorted public keys of the
- current covenant committee recognized by Babylon Genesis.
-- `CovenantThreshold` is a Babylon parameter specifying how many
- covenant committee member signatures are required.
-
-Signatures from a quorum of the covenant committee are required to ensure that
-this script is not used for on-demand unlocking without the stake going through
-an unbonding period. Reward all covenant members for their work.
-
-#### 3. Slashing path
-
-The slashing path is utilized for punishing Finality Providers and their
-delegators in the case of double signing. It commits to a script:
-
-```
- OP_CHECKSIGVERIFY
- OP_CHECKSIGVERIFY
- OP_CHECKSIG OP_CHECKSIGADD ... OP_CHECKSIGADD
- OP_NUMEQUAL
-```
-
-where:
-
-- `StakerPK` is the BTC Staker's public key.
-- `FinalityProviderPk` is the BTC public key of the Finality Provider to which
- the staker delegates their stake
-- `CovenantPk1..CovenantPkN` are the lexicographically sorted public keys of the
- current covenant committee members recognized by Babylon Genesis.
-- `CovenantThreshold` is a Babylon parameter denoting how many covenant
- committee member signatures are required.
-
-This path can only be executed with the collaboration of the BTC Staker,
-Finality Provider, and covenant committee.
-It is used in following way:
-
-- For stake to become active, staker must publish pre-signed slashing transaction.
-- The covenant committee validates such transaction, and publish its own signatures.
-- The only signature missing to send the slashing transaction is Finality Provider
- signature. If the Finality Provider private key leaks due to infractions, anyone can
- sign slashing transaction and send slashing transaction to Bitcoin network.
-
-#### Difference between Unbonding and Slashing Path
-
-The main difference between the unbonding and slashing paths is the existence of
-`FinalityProviderPk` in the slashing path.
-
-This leads to following system wide repercussions:
-
-- For staking request to become active, BTC Staker needs to provide valid
- unbonding transaction in this staking request. This staking request will become
- active only when the `CovenantThreshold` signatures are received by the Babylon
- chain. The lack of `FinalityProviderPk` in the unbonding path, means that after
- delegation becomes active, staker can send an unbonding transaction at any time
- without asking the Finality Provider for permission.
-- The existence of `FinalityProviderPk` in the slashing path, coupled with the fact that
- BTC Staker needs to provide pre-signed slashing transaction which needs to be
- signed by covenant committee for delegation request to become active, leads to
- situation in which the only signature missing to send slashing transaction to
- BTC is signature of Finality Provider.
-
-### Unbonding output
-
-Unbonding output is a Taproot output which can be only spent through script
-spending path. The key spending path is disabled by using "Nothing Up My Sleeve"
-(NUMS) point as internal key. Chosen point is the one described in BIP341 i.e H
-= lift_x(0x50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0)
-which is point constructed by taking the hash of the standard uncompressed
-encoding of the secp256k1 base point G as X coordinate.
-
-Unbonding output can be spent by two script spending paths.
-
-#### 1. Timelock path
-
-The timelock path locks the staker's Bitcoin for a pre-determined number of
-Bitcoin blocks. It commits to a script of the form:
-
-```
- OP_CHECKSIGVERIFY OP_CHECKSEQUENCEVERIFY`
-```
-
-where:
-
-- `` is BTC Staker public key.
-- `` is unbonding time. It must be lower or equal 65535, but larger
- than `max(MinUnbondingTime, CheckpointFinalizationTimeout)`. `MinUnbondingTime`
- and `CheckpointFinalizationTimeout` are Babylon parameters.
-
-#### 2. Slashing path
-
-The slashing path is utilized for punishing Finality Providers and their
-delegators in the case of double signing. It commits to a script:
-
-```
- OP_CHECKSIGVERIFY
- OP_CHECKSIGVERIFY
- OP_CHECKSIG OP_CHECKSIGADD ... OP_CHECKSIGADD
- OP_NUMEQUAL
-```
-
-where:
-
-- `StakerPK` is the BTC Staker's public key.
-- `FinalityProviderPk` is the BTC public key of the Finality Provider to which
- the staker delegates their stake.
-- `CovenantPk1..CovenantPkN` are the lexicographically sorted public keys of the
- current covenant committee members recognized by Babylon Genesis.
-- `CovenantThreshold` is a Babylon parameter denoting how many covenant
- committee member signatures are required.
-
-#### Existence of Slashing path in Unbonding output
-
-The fact that slashing path exists in unbonding output means that even if staker
-is unbonding, he can be slashed if the finality provider commits an infraction during
-unbonding time.
+import RemoteMD from '@site/src/components/RemoteMD';
+
+export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/babylon/refs/heads/main/docs/staking-script.md";
+
+
\ No newline at end of file
diff --git a/docs/guides/specifications/staking_transactions.mdx b/docs/guides/specifications/staking_transactions.mdx
index 1e10be6a..c3b576c6 100644
--- a/docs/guides/specifications/staking_transactions.mdx
+++ b/docs/guides/specifications/staking_transactions.mdx
@@ -4,378 +4,19 @@ sidebar_label: Staking Transactions
sidebar_position: 1
---
-# Staking Transactions
+# Observable Staking Transactions Specification
-Specification of all the transactions, which is for those who want to construct Bitcoin staking related transactions by themselves instead of using our code or dapps.
+import RemoteMD from '@site/src/components/RemoteMD';
-## Introduction
+export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/babylon/refs/heads/main/docs/transaction-impl-spec.md";
-A lock-only network involves users locking their Bitcoin using the self-custodial
-Bitcoin Staking script without a Babylon Genesis operating.
-In this document, we precisely define how one can construct
-the Bitcoin transactions specified by the Bitcoin Staking protocol.
+
-## Prerequisites
-
-- [Scripts doc](/guides/specifications/bitcoin_staking_scripts) - a document which defines how different
-Bitcoin Staking scripts look like
-- [BIP341](https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki) -
-a document specifying how to spend Taproot outputs
-
-## System parameters
-
-The lock-only staking protocol is governed by a set of parameters that specify
-what constitutes a valid staking transaction. Based on those,
-an observer of the Bitcoin ledger can precisely identify which transactions
-are valid staking transactions and whether they should be considered active stake.
-These parameters are different depending on the Bitcoin height a transaction is
-included in and a constructor of a Bitcoin Staking transaction should take them into
-account before propagating a transaction to Bitcoin.
-For the rest of the document, we will refer to those parameters as `global_parameters`.
-
-More details about parameters can be found in the
-[parameters spec](https://github.com/babylonchain/networks/tree/main/bbn-test-4/parameters).
-
-## Taproot outputs
-
-Taproot outputs are outputs whose locking script is an elliptic curve point `Q`
-created as follows:
-```
-Q = P + hash(P||m)G
-```
-where:
-- `P` is the internal public key
-- `m` is the root of a Merkle tree whose leaves consist of a version number and a
-script
-
-For Bitcoin Staking transactions, the internal public key is chosen as:
-
-```
-P = lift_x(0x50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0)
-```
-
-This key is described in the
-[BIP341](https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#constructing-and-spending-taproot-outputs)
-specification.
-
-The use of this key as an internal public key disables spending from Taproot output
-through the key spending path.
-The construction of this key can be found [here](https://github.com/babylonlabs-io/babylon/blob/main/btcstaking/types.go?plain=1#L27).
-
-## Observable Staking Transactions
-
-### Staking transaction
-
-A staker enters the protocol through the creation of a staking transaction
-which locks Bitcoin in the Bitcoin Staking script.
-
-#### Requirements
-
-For the transaction to be considered a valid staking transaction, it must:
-- Have a Taproot output which has the key spending path disabled
-and commits to a script tree composed of three scripts:
-timelock script, unbonding script, slashing script.
-This output is henceforth known as the `staking_output` and
-the value in this output is known as `staking_amount`
-- Have `OP_RETURN` output which contains: `global_parameters.tag`,
- `version`, `staker_pk`, `finality_provider_pk`, `staking_time`
-- All the values must be valid for the `global_parameters` which are applicable at
-the height in which the staking transaction is included in the BTC ledger.
-
-
-#### OP_RETURN output description
-
-Data in the OP_RETURN output is described by the following struct:
-
-```go
-type V0OpReturnData struct {
- Tag []byte
- Version byte
- StakerPublicKey []byte
- FinalityProviderPublicKey []byte
- StakingTime []byte
-}
-```
-The implementation of the struct can be found [here](https://github.com/babylonlabs-io/babylon/blob/main/btcstaking/identifiable_staking.go?plain=1#L52)
-
-Fields description:
-- `Tag` - 4 bytes, a tag which is used to identify the staking transaction
-among other transactions in the Bitcoin ledger.
-It is specified in the `global_parameters.Tag` field.
-- `Version` - 1 byte, the current version of the OP_RETURN output.
-- `StakerPublicKey` - 32 bytes, staker public key. The same key must be used in
-the scripts used to create the Taproot output in the staking transaction.
-- `FinalityProviderPublicKey` - 32 bytes, finality provider public key. The same key
-must be used in the scripts used to create the Taproot output in the
-staking transaction.
-- `StakingTime` - 2 bytes big-endian unsigned number, staking time.
-The same timelock time must be used in scripts used to create the Taproot
-output in the staking transaction.
-
-
-This data is serialized as follows:
-```
-SerializedStakingData = Tag || Version || StakerPublicKey || FinalityProviderPublicKey || StakingTime
-```
-
-To transform this data into OP_RETURN data:
-
-```
-StakingDataPkScript = 0x6a || 0x47 || SerializedStakingData
-```
-
-where:
-- 0x6a - is byte marker representing OP_RETURN op code.
-- 0x47 - is byte marker representing OP_DATA_71 op code, which pushed 71 bytes onto the stack.
-
-The final OP_RETURN output will have the following shape:
-```
-TxOut {
- Value: 0,
- PkScript: StakingDataPkScript
-}
-```
-
-Logic creating output from data can be found [here](https://github.com/babylonlabs-io/babylon/blob/main/btcstaking/identifiable_staking.go?plain=1#L175)
-
-
-#### Staking output description
-
-Staking output should commit to three scripts:
-- `timelock_script`
-- `unbonding_script`
-- `slashing_script`
-
-Data needed to create `staking_output`:
-- `staker_public_key` - chosen by the user sending the staking transaction. It
-will be used in every script. This key needs to be put in the OP_RETURN output
-in the staking transaction.
-- `finality_provider_public_key` - chosen by the user sending the staking
-transaction. It will be used as `` in the `slashing_script`. In the
-lock-only network, there is no slashing, so this key has mostly informative purposes.
-This key needs to be put in the OP_RETURN output of the staking transaction.
-- `staking_time` - chosen by the user sending the staking transaction. It will
-be used as the locking time in the `timelock_script`. It must be a valid `uint16` number,
-in the range `global_parameters.min_staking_time <= staking_time <= global_parameters.max_staking_time`.
-It needs to be put in the OP_RETURN output of the staking transaction.
-- `covenant_committee_public_keys` - it can be retrieved from
-`global_parameters.covenant_pks`. It is a set of covenant committee public keys which
-will be put in `unbonding_script` and `slashing_script`.
-- `covenant_committee_quorum` - it can be retrieved from
-`global_parameters.covenant_quorum`. It is the quorum of covenant committee
-members required to authorize spending using the `unbonding_script` or `slashing_script`.
-- `staking_amount` - chosen by the user, it will be placed in `staking_output.value`.
-- `btc_network` - the BTC network on which staking transactions will take place.
-
-#### Building OP_RETURN and staking output implementation
-
-The Babylon staking library exposes the [BuildV0IdentifiableStakingOutputsAndTx](https://github.com/babylonlabs-io/babylon/blob/main/btcstaking/identifiable_staking.go?plain=1#L231)
-function with the following signature:
-
-```go
-func BuildV0IdentifiableStakingOutputsAndTx(
- tag []byte,
- stakerKey *btcec.PublicKey,
- fpKey *btcec.PublicKey,
- covenantKeys []*btcec.PublicKey,
- covenantQuorum uint32,
- stakingTime uint16,
- stakingAmount btcutil.Amount,
- net *chaincfg.Params,
-) (*IdentifiableStakingInfo, *wire.MsgTx, error)
-```
-
-It enables the caller to create valid outputs to put inside an unfunded and not-signed
-staking transaction.
-
-The suggested way of creating and sending a staking transaction using
-[bitcoind](https://github.com/bitcoin/bitcoin) is:
-1. Create `staker_key` in the bitcoind wallet.
-2. Create unfunded and not signed staking transaction using
-the `BuildV0IdentifiableStakingOutputsAndTx` function.
-3. Serialize the unfunded and not signed staking transaction to `staking_transaction_hex`.
-4. Call `bitcoin-cli fundrawtransaction "staking_transaction_hex"` to
-retrieve `funded_staking_transaction_hex`.
-The bitcoind wallet will automatically choose unspent outputs to fund this transaction.
-5. Call `bitcoin-cli signrawtransactionwithwallet "funded_staking_transaction_hex"`.
-This call will sign all inputs of the transaction and return `signed_staking_transaction_hex`.
-6. Call `bitcoin-cli sendrawtransaction "signed_staking_transaction_hex"`.
-
-### Unbonding transaction
-
-The unbonding transaction allows the staker to on-demand unbond their
-locked Bitcoin stake prior to its original timelock expiration.
-
-#### Requirements
-
-For the transaction to be considered a valid unbonding transaction, it must:
-- Have exactly one input and one output.
-- Input must be a valid staking output.
-- Output must be a Taproot output. This Taproot output must have disabled
-the key spending path, and committed to script tree composed of two scripts:
-the timelock script and the slashing script. This output is henceforth known
-as the `unbonding_output`.
-- Timelock in the timelock script must be equal to `global_parameters.unbonding_time`.
-- Value in the unbonding output must be equal to `staking_output.value - global_parameters.unbonding_fee`.
-
-#### Building Unbonding output
-
-The Babylon Bitcoin staking library exposes
-the [BuildUnbondingInfo](https://github.com/babylonlabs-io/babylon/blob/main/btcstaking/types.go?plain=1#416)
-function which builds a valid unbonding output.
-It has the following signature:
-
-```go
-func BuildUnbondingInfo(
- stakerKey *btcec.PublicKey,
- fpKeys []*btcec.PublicKey,
- covenantKeys []*btcec.PublicKey,
- covenantQuorum uint32,
- unbondingTime uint16,
- unbondingAmount btcutil.Amount,
- net *chaincfg.Params,
-) (*UnbondingInfo, error)
-```
-
-where:
-- `stakerKey`- must be the same key as the staker key in `staking_transaction`.
-- `fpKeys` - must contain one key, which is the same finality provider key used
-in `staking_transaction`.
-- `covenantKeys`- are the same covenant keys as used in `staking_transaction`.
-- `covenantQuorum` - is the same quorum as used in `staking_transaction`.
-- `unbondingTime` - is equal to `global_parameters.unbonding_time`.
-- `unbondingAmount` - is equal to `staking_amount - global_parameters.unbonding_fee`.
-
-## Spending Taproot outputs
-
-To create transactions which spend from Taproot outputs, either staking output
-or unbonding output, providing signatures satisfying the script is not enough.
-
-The spender must also provide:
-- The whole script which is being spent.
-- The control block which contains: leaf version, internal public key, and proof of
-inclusion of the given script in the script tree.
-
-Given that creating scripts is deterministic for given data, it is possible to
-avoid storing scripts by re-building scripts when the need arises.
-
-### Re-creating script and control block
-
-To build the script and control block necessary to spend from a staking output through the
-timelock script, the following function could be implemented.
-
-```go
-import (
- // Babylon btc staking library
- "github.com/babylonlabs-io/babylon/btcstaking"
-)
-
-func buildTimelockScriptAndControlBlock(
- stakerKey *btcec.PublicKey,
- finalityProviderKey *btcec.PublicKey,
- covenantKeys []*btcec.PublicKey,
- covenantQuorum uint32,
- stakingTime uint16,
- stakingAmount btcutil.Amount,
- netParams *chaincfg.Params,
-) ([]byte, []byte, error) {
-
- stakingInfo, err := btcstaking.BuildStakingInfo(
- stakerKey,
- []*btcec.PublicKey{finalityProviderKey},
- covenantKeys,
- covenantQuorum,
- stakingTime,
- stakingAmount,
- netParams,
- )
-
- if err != nil {
- return nil, nil, err
- }
-
- si, err := stakingInfo.TimeLockPathSpendInfo()
-
- if err != nil {
- return nil, nil, err
- }
-
- scriptBytes := si.RevealedLeaf.Script
-
- controlBlock := si.ControlBlock
-
- controlBlockBytes, err := controlBlock.ToBytes()
- if err != nil {
- return nil, nil, err
- }
-
- return scriptBytes, controlBlockBytes, nil
-}
-
-```
-
-The returned script and control block can be used to either build the witness directly
-or to put them in a PSBT which can be used by bitcoind to create the witness.
-
-### Creating PSBT to get signature for given Taproot path from Bitcoind
-
-To avoid creating signatures/witness manually,
-Bitcoind's [walletprocesspsbt](https://developer.bitcoin.org/reference/rpc/walletprocesspsbt.html)
-can be used. To use this Bitcoind endpoint to get signature/witness the wallet must
-maintain one of the keys used in the script.
-
-Example of creating psbt to sign unbonding transaction using unbonding script from
-staking output:
-
-```go
-import (
- "github.com/btcsuite/btcd/btcutil/psbt"
-)
-
-func BuildPsbtForSigningUnbondingTransaction(
- unbondingTx *wire.MsgTx,
- stakingOutput *wire.TxOut,
- stakerKey *btcec.PublicKey,
- spentLeaf *txscript.TapLeaf,
- controlBlockBytes []byte,
-) (string, error) {
- psbtPacket, err := psbt.New(
- []*wire.OutPoint{&unbondingTx.TxIn[0].PreviousOutPoint},
- unbondingTx.TxOut,
- unbondingTx.Version,
- unbondingTx.LockTime,
- []uint32{unbondingTx.TxIn[0].Sequence},
- )
-
- if err != nil {
- return "", fmt.Errorf("failed to create PSBT packet with unbonding transaction: %w", err)
- }
-
- psbtPacket.Inputs[0].SighashType = txscript.SigHashDefault
- psbtPacket.Inputs[0].WitnessUtxo = stakingOutput
- psbtPacket.Inputs[0].Bip32Derivation = []*psbt.Bip32Derivation{
- {
- PubKey: stakerKey.SerializeCompressed(),
- },
- }
-
- psbtPacket.Inputs[0].TaprootLeafScript = []*psbt.TaprootTapLeafScript{
- {
- ControlBlock: controlBlockBytes,
- Script: spentLeaf.Script,
- LeafVersion: spentLeaf.LeafVersion,
- },
- }
-
- return psbtPacket.B64Encode()
-}
-
-```
-
-Given that to spend through the unbonding script requires more than the
-staker's signature, the `walletprocesspsbt` endpoint will produce a new psbt
-with the staker signature attached.
-
-In the case of a timelock path which requires only the staker's signature,
-`walletprocesspsbt` would produce the whole witness required to send the
-transaction to the BTC network.
diff --git a/docs/operators/babylon_node/installation_guide.mdx b/docs/operators/babylon_node/installation_guide.mdx
index ed94387c..6673076c 100644
--- a/docs/operators/babylon_node/installation_guide.mdx
+++ b/docs/operators/babylon_node/installation_guide.mdx
@@ -8,13 +8,12 @@ sidebar_position: 0
import RemoteMD from '@site/src/components/RemoteMD';
export const testnetUrl="https://raw.githubusercontent.com/babylonlabs-io/networks/refs/heads/main/bbn-test-5/babylon-node/README.md";
-export const mainnetUrl="https://raw.githubusercontent.com/babylonlabs-io/networks/refs/heads/main/bbn-1/babylon-node/README.md";
+export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/networks/refs/heads/main/bbn-1/babylon-node/README.md";
diff --git a/docs/operators/babylon_validators/ibc_relayer_guide.mdx b/docs/operators/babylon_validators/ibc_relayer_guide.mdx
index dad1f196..cbafc05d 100644
--- a/docs/operators/babylon_validators/ibc_relayer_guide.mdx
+++ b/docs/operators/babylon_validators/ibc_relayer_guide.mdx
@@ -12,9 +12,6 @@ export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/babylon/re
A technical guide for implementing IBC relaying on Babylon Genesis.
\ No newline at end of file
diff --git a/docs/operators/babylon_validators/installation_guide.mdx b/docs/operators/babylon_validators/installation_guide.mdx
index 6631d3cd..fb808b9a 100644
--- a/docs/operators/babylon_validators/installation_guide.mdx
+++ b/docs/operators/babylon_validators/installation_guide.mdx
@@ -4,20 +4,18 @@ sidebar_label: Installation Guide
sidebar_position: 1
---
-# Babylon Genesis Validators Installation Guide
# Babylon Genesis Validators Installation Guide
import RemoteMD from '@site/src/components/RemoteMD';
export const testnetUrl="https://raw.githubusercontent.com/babylonlabs-io/networks/refs/heads/main/bbn-1/babylon-validators/README.md";
-export const mainnetUrl="https://raw.githubusercontent.com/babylonlabs-io/networks/refs/heads/main/bbn-1/babylon-validators/README.md";
+export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/networks/refs/heads/main/bbn-1/babylon-validators/README.md";
diff --git a/docs/operators/covenant_emulator/covenant_emulator.mdx b/docs/operators/covenant_emulator/covenant_emulator.mdx
index e3000d66..a767e166 100644
--- a/docs/operators/covenant_emulator/covenant_emulator.mdx
+++ b/docs/operators/covenant_emulator/covenant_emulator.mdx
@@ -13,9 +13,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/covenant-emulator/refs/heads/main/README.md";
diff --git a/docs/operators/finality_providers/finality_providers.mdx b/docs/operators/finality_providers/finality_providers.mdx
index 1b4a00a3..8ef29819 100644
--- a/docs/operators/finality_providers/finality_providers.mdx
+++ b/docs/operators/finality_providers/finality_providers.mdx
@@ -11,9 +11,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/finality-provider/refs/heads/main/README.md";
diff --git a/docs/operators/finality_providers/fp_core_specs.mdx b/docs/operators/finality_providers/fp_core_specs.mdx
index 5d7b9e07..2302ec91 100644
--- a/docs/operators/finality_providers/fp_core_specs.mdx
+++ b/docs/operators/finality_providers/fp_core_specs.mdx
@@ -11,9 +11,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/finality-provider/refs/heads/main/docs/fp-core.md";
diff --git a/docs/operators/finality_providers/fp_finality_votes.mdx b/docs/operators/finality_providers/fp_finality_votes.mdx
index 1d790a1e..a3def1ba 100644
--- a/docs/operators/finality_providers/fp_finality_votes.mdx
+++ b/docs/operators/finality_providers/fp_finality_votes.mdx
@@ -11,9 +11,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/finality-provider/refs/heads/main/docs/send-finality-vote.md";
diff --git a/docs/operators/finality_providers/fp_operations.mdx b/docs/operators/finality_providers/fp_operations.mdx
index 5309b46d..d8a608d3 100644
--- a/docs/operators/finality_providers/fp_operations.mdx
+++ b/docs/operators/finality_providers/fp_operations.mdx
@@ -11,9 +11,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/finality-provider/refs/heads/main/docs/finality-provider-operation.md";
diff --git a/docs/operators/finality_providers/fp_public_randomness.mdx b/docs/operators/finality_providers/fp_public_randomness.mdx
index 90662466..cc6bb53f 100644
--- a/docs/operators/finality_providers/fp_public_randomness.mdx
+++ b/docs/operators/finality_providers/fp_public_randomness.mdx
@@ -11,9 +11,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/finality-provider/refs/heads/main/docs/commit-pub-rand.md";
diff --git a/docs/operators/finality_providers/hmac_security.mdx b/docs/operators/finality_providers/hmac_security.mdx
index c52f35b1..cc57a493 100644
--- a/docs/operators/finality_providers/hmac_security.mdx
+++ b/docs/operators/finality_providers/hmac_security.mdx
@@ -11,9 +11,6 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/finality-provider/refs/heads/main/docs/hmac-security.md";
\ No newline at end of file
diff --git a/docs/operators/finality_providers/slashing_protection.mdx b/docs/operators/finality_providers/slashing_protection.mdx
index e502acf0..c85dafab 100644
--- a/docs/operators/finality_providers/slashing_protection.mdx
+++ b/docs/operators/finality_providers/slashing_protection.mdx
@@ -11,10 +11,7 @@ import RemoteMD from '@site/src/components/RemoteMD';
export const rawUrl="https://raw.githubusercontent.com/babylonlabs-io/finality-provider/refs/heads/main/docs/slashing-protection.md";
diff --git a/docusaurus.config.js b/docusaurus.config.js
index afcff852..2d8982be 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -141,7 +141,11 @@ const config = {
showLastUpdateTime: false,
docItemComponent: '@theme/ApiItem',
},
- blog: false,
+ blog: {
+ path: 'blog',
+ routeBasePath: 'blog',
+ include: ['**/*.{md,mdx}'],
+ },
theme: {
customCss: [
require.resolve('./src/css/custom.css')
diff --git a/package-lock.json b/package-lock.json
index 1ca851d9..05278214 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -31,7 +31,8 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-feather": "^2.0.10",
- "react-medium-image-zoom": "^5.2.14"
+ "react-medium-image-zoom": "^5.2.14",
+ "sanitize-html": "^2.17.0"
},
"devDependencies": {
"@docusaurus/tsconfig": "3.7.0",
@@ -20634,6 +20635,12 @@
"resolved": "https://registry.npmjs.org/parse-numeric-range/-/parse-numeric-range-1.3.0.tgz",
"integrity": "sha512-twN+njEipszzlMJd4ONUYgSfZPDxgHhT9Ahed5uTigpQn90FggW4SA/AIPq/6a149fTbE9qBEcSwE3FAEp6wQQ=="
},
+ "node_modules/parse-srcset": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/parse-srcset/-/parse-srcset-1.0.2.tgz",
+ "integrity": "sha512-/2qh0lav6CmI15FzA3i/2Bzk2zCgQhGMkvhOhKNcBVQ1ldgpbfiNTVslmooUmWJcADi1f1kIeynbDRVzNlfR6Q==",
+ "license": "MIT"
+ },
"node_modules/parse5": {
"version": "7.2.1",
"resolved": "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz",
@@ -25355,6 +25362,29 @@
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
+ "node_modules/sanitize-html": {
+ "version": "2.17.0",
+ "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-2.17.0.tgz",
+ "integrity": "sha512-dLAADUSS8rBwhaevT12yCezvioCA+bmUTPH/u57xKPT8d++voeYE6HeluA/bPbQ15TwDBG2ii+QZIEmYx8VdxA==",
+ "license": "MIT",
+ "dependencies": {
+ "deepmerge": "^4.2.2",
+ "escape-string-regexp": "^4.0.0",
+ "htmlparser2": "^8.0.0",
+ "is-plain-object": "^5.0.0",
+ "parse-srcset": "^1.0.2",
+ "postcss": "^8.3.11"
+ }
+ },
+ "node_modules/sanitize-html/node_modules/is-plain-object": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
+ "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/sass": {
"version": "1.83.1",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.83.1.tgz",
diff --git a/package.json b/package.json
index d0b14f21..840ceba1 100644
--- a/package.json
+++ b/package.json
@@ -46,7 +46,8 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-feather": "^2.0.10",
- "react-medium-image-zoom": "^5.2.14"
+ "react-medium-image-zoom": "^5.2.14",
+ "sanitize-html": "^2.17.0"
},
"devDependencies": {
"@docusaurus/tsconfig": "3.7.0",
diff --git a/plugins/fetch-remote-docs.cjs b/plugins/fetch-remote-docs.cjs
index 32be2b47..dc450828 100644
--- a/plugins/fetch-remote-docs.cjs
+++ b/plugins/fetch-remote-docs.cjs
@@ -4,7 +4,6 @@ const fetch = require('node-fetch');
const parser = require('@babel/parser');
const traverse = require('@babel/traverse').default;
-// Recursively scan all `.mdx` files
function scanMdxFiles(dir, result = []) {
fs.readdirSync(dir).forEach((name) => {
const filePath = path.join(dir, name);
@@ -22,11 +21,14 @@ function extractJsAndRemoteMD(content) {
const codeLines = [];
let inFrontmatter = false;
let inRemoteMD = false, remoteMdBlock = [];
+
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
+
if (line.trim() === '---' && !inFrontmatter) { inFrontmatter = true; continue; }
if (line.trim() === '---' && inFrontmatter) { inFrontmatter = false; continue; }
if (inFrontmatter) continue;
+
if (line.includes(' {
const key =
prop.key.type === 'Identifier'
@@ -77,78 +82,107 @@ function extractNetworkVersions(objNode, variables) {
: prop.key.type === 'StringLiteral'
? prop.key.value
: '';
+
versions[key] = getValueFromNode(prop.value, variables);
});
+
return versions;
}
-// Get the base name of the `.mdx` file without extension
function getFileBaseName(filepath) {
return path.basename(filepath, path.extname(filepath));
}
-// Main: For each `.mdx` file, return an array where each element is {url, key}
function findRemoteMDTargets(content, variables) {
const results = [];
const jsCode = extractJsAndRemoteMD(content);
let ast;
+
try {
ast = parser.parse(jsCode, {
sourceType: 'module',
plugins: ['jsx', 'typescript'],
});
} catch (e) {
+ console.warn(`Failed to parse JS code: ${e.message}`);
return [];
}
+
traverse(ast, {
JSXElement({ node }) {
if (!node.openingElement) return;
const tagName = node.openingElement.name.name;
if (tagName !== 'RemoteMD') return;
- let found = false;
+
+ let rawUrl = null;
+ let releaseVersions = null;
+ let defaultRelease = null;
+ let hideRelease = false;
+
node.openingElement.attributes.forEach((attr) => {
- //
- if (
- attr.name &&
- attr.name.name === 'networkVersions' &&
- attr.value &&
- attr.value.expression
- ) {
- found = true;
- // networkVersions={{mainnet: ..., ...}}
- if (attr.value.expression.type === 'ObjectExpression') {
- const versions = extractNetworkVersions(attr.value.expression, variables);
- for (const [key, url] of Object.entries(versions)) {
- if (url) results.push({ url, key });
- }
- }
- // networkVersions={rawObj}
- if (attr.value.expression.type === 'Identifier') {
- let refName = attr.value.expression.name;
- if (variables[refName]) {
- // You can extend support for external objects
- results.push({ url: variables[refName], key: refName });
- }
- }
+ if (attr.name && attr.name.name === 'rawUrl') {
+ rawUrl = getValueFromNode(attr.value?.expression || attr.value, variables);
}
- //
- if (
- attr.name &&
- attr.name.name === 'url' &&
- attr.value
- ) {
- if (attr.value.type === 'StringLiteral') {
- results.push({ url: attr.value.value, key: undefined });
- } else if (attr.value.expression && attr.value.expression.type === 'Identifier') {
- let refName = attr.value.expression.name;
+
+ if (attr.name && attr.name.name === 'releaseVersions') {
+ if (attr.value?.expression?.type === 'ObjectExpression') {
+ releaseVersions = extractReleaseVersions(attr.value.expression, variables);
+ } else if (attr.value?.expression?.type === 'Identifier') {
+ const refName = attr.value.expression.name;
if (variables[refName]) {
- results.push({ url: variables[refName], key: undefined });
+ try {
+ releaseVersions = JSON.parse(variables[refName]);
+ } catch (e) {
+ console.warn(`Failed to parse releaseVersions from variable: ${refName}`);
+ }
}
}
}
+
+ if (attr.name && attr.name.name === 'defaultRelease') {
+ defaultRelease = getValueFromNode(attr.value?.expression || attr.value, variables);
+ }
+
+ if (attr.name && attr.name.name === 'hideRelease') {
+ hideRelease = getValueFromNode(attr.value?.expression || attr.value, variables) === true;
+ }
});
+
+ if (!rawUrl) return;
+
+ if (!releaseVersions) {
+ results.push({
+ url: rawUrl,
+ key: null,
+ hideRelease,
+ isDefault: defaultRelease === null
+ });
+ return;
+ }
+
+ for (const [key, url] of Object.entries(releaseVersions)) {
+ if (url) {
+ results.push({
+ url,
+ key,
+ hideRelease,
+ isDefault: defaultRelease === key || (defaultRelease === null && key === Object.keys(releaseVersions)[0])
+ });
+ }
+ }
+
+ if (defaultRelease && !releaseVersions[defaultRelease]) {
+ const defaultUrl = rawUrl.replace(/refs\/heads\/[^/]+/, defaultRelease);
+ results.push({
+ url: defaultUrl,
+ key: defaultRelease,
+ hideRelease,
+ isDefault: true
+ });
+ }
}
});
+
return results;
}
@@ -156,15 +190,49 @@ function clearDirectory(dirPath) {
if (fs.existsSync(dirPath)) {
fs.rmSync(dirPath, { recursive: true, force: true });
}
- // Recreate the directory to ensure it exists and is empty
fs.mkdirSync(dirPath, { recursive: true });
}
-async function mdToStructuredHtml(mdContent) {
+async function mdToStructuredHtml(mdContent, releaseTag = null) {
const { remark } = await import('remark');
const html = (await import('remark-html')).default;
+
+ const versionHeader = releaseTag
+ ? `