Skip to content

Commit f67a84c

Browse files
authored
updated cosmos & op stack chain .mdxs (#200)
1 parent 89457d2 commit f67a84c

File tree

2 files changed

+28
-13
lines changed

2 files changed

+28
-13
lines changed

docs/developers/bsns/cosmos_chains/cosmos_chains.mdx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ for example, X→ Y means "Y queries data from X and the data flows from X to Y"
2222
dark: useBaseUrl('/img/cosmos-integration.png'),
2323
}}
2424
/>
25+
<br />
2526

2627
The design involves the following main components:
2728

28-
- **Finality Provider:** a daemon program that receives BTC stake and keeps submitting
29-
finality signatures over blocks to the BSN chain.
29+
### Finality Provider
30+
31+
A daemon program that receives BTC stake and keeps submitting finality signatures over blocks to the BSN chain.
3032
- It connects to a BSN chain node to query block metadata.
3133
- It connects to the Babylon contracts on the BSN chain for querying voting
3234
power and submitting finality signatures.
@@ -38,8 +40,9 @@ Upon a new block in the BSN chain, it:
3840
voting power at this height.
3941
- If yes, sign and submit a finality signature to the Babylon contracts.
4042

41-
- **Babylon Contracts:** a set of CosmWasm smart contracts that maintains IBC channels
42-
with Babylon and handles finality signatures submitted from Finality Providers
43+
### Babylon Contracts
44+
45+
A set of CosmWasm smart contracts that maintains IBC channels with Babylon and handles finality signatures submitted from Finality Providers
4346
- It will be deployed on the BSN chain.
4447
- It establishes an IBC channel with Babylon. The IBC channel relays information
4548
about BTC light clients, BTC timestamps and BTC staking.
@@ -53,8 +56,9 @@ Upon a finality signature, the Babylon contracts verify it:
5356
packet to Babylon. Then Babylon emits an event so anyone can slash the Finality
5457
Provider and the BTC stake under it.
5558

56-
- **Babylon-SDK:** a small Cosmos SDK module serving as a thin layer between Babylon
57-
contracts and Cosmos SDK level of the BSN chain.
59+
### Babylon-SDK
60+
61+
A small Cosmos SDK module serving as a thin layer between Babylon contracts and Cosmos SDK level of the BSN chain.
5862
- It sends a sudo message to the Babylon contracts upon each `BeginBlock` , so that
5963
Babylon contracts can update voting power table and tally blocks.
6064
- It moves a part of the reward from the fee collector account to Babylon contracts,

docs/developers/bsns/op_stack_chains/op_stack_chains.mdx

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ The design involves the following main components:
2121
light: useBaseUrl('/img/op-stack-integration.png'),
2222
dark: useBaseUrl('/img/op-stack-integration.png'),
2323
}}
24-
/>;
24+
/>
25+
<br />
2526

26-
- **Finality Provider:** a daemon program that receives BTC stake and keeps
27-
submitting finality signatures over L2 blocks to the finality contract on Babylon.
27+
### Finality Provider
28+
29+
A daemon program that receives BTC stake and keeps submitting finality signatures over L2 blocks to the finality contract on Babylon.
2830
- It connects to a Babylon node to query its voting power.
2931
- It connects to the finality contract via the Babylon node for submitting
3032
finality signatures.
@@ -35,7 +37,10 @@ Upon a new L2 block in the OP-stack chain, It:
3537
- Gets the L2 block metadata.
3638
- Queries Babylon Genesis to determine whether it has voting power at this L2 block height.
3739
- If yes, sign and submit a finality signature to the finality contract.
38-
- **Finality contract:** a CosmWasm smart contract that maintains all finality signatures submitted from OP-stack Finality Providers.
40+
41+
### Finality Contract
42+
43+
A CosmWasm smart contract that maintains all finality signatures submitted from OP-stack Finality Providers.
3944
- It will be deployed on Babylon Genesis.
4045
- It will query Babylon Genesis to determine the Finality Provider’s status and voting power.
4146

@@ -44,7 +49,10 @@ Upon a finality signature, the finality contract verifies it and identifies equi
4449
- If invalid, reject.
4550
- If valid and non-conflicting with any existing ones, accept.
4651
- 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.
47-
- **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.
52+
53+
### Finality Gadget
54+
55+
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.
4856
- It connects to a Babylon node for querying the voting power of Finality Providers.
4957
- It connects to the finality contract via the Babylon node for querying finality signatures.
5058
- 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:
5563
- 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.
5664
- Tallies finality signatures and determines whether the L2 block receives a quorum.
5765
- 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.
58-
- **OP node with finality gadget:** a modified OP node that enforces BTC-voting quorum before finalizing L2 blocks.
66+
67+
### OP Node with Finality Gadget
68+
69+
A modified OP node that enforces BTC-voting quorum before finalizing L2 blocks.
5970
- It connects to the finality gadget for querying consecutive BTC-voting quorums to determine the finalization status of the L2 blocks.
6071
- It notifies OP-geth about the L2 blocks’ finalization status to move the L2 finalized block head.
6172

@@ -81,6 +92,6 @@ We have finished the reference implementation. The codebases include:
8192
We have developed local deployment scripts for the OP stack integration.
8293

8394
- https://github.com/Snapchain/babylon-deployment for spinning up an OP stack chain integrating with Babylon Euphrates devnet
84-
- https://github.com/Snapchain/op-chain-deployment for spinning up the entire stack (OP stack chain + ETH L1 + Babylon + Bitcoin)
95+
- https://github.com/Snapchain/op-chain-deployment for spinning up the entire stack (OP stack chain + ETH L1 + Babylon Genesis + Bitcoin)
8596

8697
---

0 commit comments

Comments
 (0)