Skip to content

Commit e8eb40a

Browse files
docs: improve readme (#119)
## Description This PR improves Readme ## Checklist - [x] I have updated the [docs/SPEC.md](https://github.com/babylonlabs-io/rollup-bsn-contracts/blob/main/docs/SPEC.md) file if this change affects the specification - [x] I have updated the schema by running `cargo gen-schema`
1 parent 6a96396 commit e8eb40a

File tree

3 files changed

+92
-61
lines changed

3 files changed

+92
-61
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
3939

4040
### Improvements
4141

42+
* [#119](https://github.com/babylonlabs-io/rollup-bsn-contracts/pull/119) docs:
43+
improve readme
4244
* [#120](https://github.com/babylonlabs-io/rollup-bsn-contracts/pull/120) docs:
4345
add reward mechanism
4446

README.md

Lines changed: 90 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,121 @@
11
# Rollup BSN Contracts
22

3-
This repo contains the Wasm smart contract for rollup BSN integration. The
4-
contract is intended to be deployed on Babylon Genesis and will maintain
5-
finality signatures and block finalisation status of rollups.
6-
7-
## Specification
8-
9-
For detailed technical specifications and requirements of the finality contract,
10-
please see [SPEC.md](docs/SPEC.md). The spec document outlines the contract's
11-
interfaces, message handlers, queries, and provides guidance for integrators.
12-
13-
## Development
3+
**Bitcoin-secured finality for rollups through Babylon's Bitcoin staking
4+
protocol.**
5+
6+
This repository contains the finality contract that enables Ethereum Rollups to
7+
become Bitcoin Supercharged Networks (BSNs) by inheriting Bitcoin's economic
8+
security through Babylon's staking infrastructure.
9+
10+
## What is Rollup BSN?
11+
12+
**Bitcoin Supercharged Networks (BSNs)** are blockchain networks that leverage
13+
Bitcoin's economic security through Babylon's Bitcoin staking protocol. BSNs
14+
enhance their security by tapping into Bitcoin's massive economic security,
15+
where Bitcoin stakers delegate their BTC to provide cryptographic attestations
16+
for network finality.
17+
18+
### How It Works
19+
20+
1. **Deploy Contract** - Deploy this finality contract on Babylon Genesis chain
21+
2. **Register BSN** - Register your rollup as a Bitcoin Supercharged Network
22+
3. **BTC Delegation** - Bitcoin stakers delegate their BTC to finality providers
23+
4. **Block Finalization** - Finality providers sign rollup blocks and submit
24+
signatures to the contract
25+
5. **Cross-Chain Security** - Your rollup inherits Bitcoin's economic security
26+
through Babylon's infrastructure
27+
28+
The finality contract acts as the bridge between your rollup and Babylon's
29+
Bitcoin staking protocol, maintaining an immutable record of block finalization
30+
and ensuring finality providers remain honest through economic incentives.
31+
32+
> **Note:** To read finalized data from contracts on Babylon Genesis, you should
33+
> use an already built off-chain service or build your own. We have a
34+
> proof-of-concept available at
35+
> [rollup-finality-gadget](https://github.com/babylonlabs-io/rollup-finality-gadget).
36+
>
37+
> **Learn More:** To understand how finality providers work and how to become one,
38+
> visit the [finality-provider repository](https://github.com/babylonlabs-io/finality-provider).
39+
40+
### Security Through Cryptography
41+
42+
The system uses **EOTS (Extractable One-Time Signatures)** to ensure finality
43+
provider honesty:
44+
45+
- **Public Randomness Commitment** - Finality providers pre-commit to randomness
46+
values they'll use for signing
47+
- **Block Finality Signatures** - Finality providers sign rollup block data
48+
using their private keys
49+
- **One-Time Signatures** - Each signature uses unique randomness and can only
50+
be used once safely
51+
- **Automatic Slashing** - If a provider signs two different blocks at the same
52+
height (double-signing), the contract automatically extracts their private key
53+
and triggers slashing
54+
55+
## Repository Structure
56+
57+
- **`contracts/finality/`** - Core finality contract implementing BSN
58+
integration
59+
- **`docs/`** - Comprehensive technical specifications and guides
60+
- **`e2e/`** - End-to-end integration tests
61+
- **`scripts/`** - Development and deployment utilities
62+
63+
## Quick Start
1464

1565
### Prerequisites
1666

17-
Make sure you have `cargo-run-script` installed and docker running.
18-
1967
```bash
68+
# Install dependencies
2069
cargo install cargo-run-script
2170
```
2271

23-
### Clean the build
24-
25-
```bash
26-
cargo clean
27-
```
28-
29-
### Build the contract
72+
### Build & Test
3073

3174
```bash
75+
# Build the contract
3276
cargo build
33-
```
34-
35-
### Formatting and Linting
36-
37-
Check whether the code is formatted correctly.
38-
39-
```bash
40-
cargo fmt --all -- --check
41-
cargo check
42-
cargo clippy --all-targets -- -D warnings
43-
```
44-
45-
Alternatively, you can run the following command to run all the checks at once.
46-
47-
```bash
48-
cargo run-script lint
49-
```
5077

51-
### Build the optimized contract
78+
# Run tests
79+
cargo test --lib
5280

53-
```bash
81+
# Build optimized version for deployment
5482
cargo run-script optimize
5583
```
5684

57-
## Tests
85+
### Deploy to Babylon
5886

59-
### Unit tests
87+
1. **Upload Contract**: Deploy WASM bytecode to Babylon Genesis
88+
2. **Instantiate**: Configure your BSN parameters
89+
3. **Register BSN**: Register with Babylon's consumer registry
90+
4. **Go Live**: Start accepting finality signatures from Finality Providers
6091

61-
Note: Requires the optimized contract to be built (`cargo optimize`)
92+
See our [Contract Management Guide](docs/contract-management.md) for detailed
93+
deployment instructions.
6294

63-
Runs all the CI checks locally (in your actual toolchain).
95+
## Development Commands
6496

6597
```bash
66-
cargo test --lib
67-
```
98+
# Linting & formatting
99+
cargo run-script lint
68100

69-
### Integration tests
101+
# Integration tests (requires optimized build)
102+
cargo run-script integration
70103

71-
Note: Requires the optimized contract to be built (`cargo optimize`)
104+
# End-to-end tests
105+
cargo run-script e2e
72106

73-
```bash
74-
cargo test --test integration
107+
# Generate contract schema
108+
cargo run-script schema
75109
```
76110

77-
Alternatively, you can run the following command, that makes sure to build the
78-
optimized contract before running the integration tests.
79-
80-
```bash
81-
cargo run-script integration
82-
```
111+
## Contributing
83112

84-
### End-to-End Tests
113+
We welcome contributions! This project follows the same guidelines as the
114+
[Babylon node repository](https://github.com/babylonlabs-io/babylon/blob/main/CONTRIBUTING.md).
85115

86-
Note: Requires the optimized contract to be built (`cargo optimize`)
116+
---
87117

88-
Run the end-to-end tests for the contract.
118+
**Need Help?** Check our [documentation](docs/) or open an issue for support.
89119

90-
```bash
91-
cargo run-script e2e
92-
```
120+
**Learn More:** Visit [Babylon Labs](https://babylonlabs.io) to understand the
121+
broader Bitcoin staking ecosystem.
File renamed without changes.

0 commit comments

Comments
 (0)