Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.

Commit 4c2f333

Browse files
Update bitcoin-bridge.md (#3)
* Update bitcoin-bridge.md * fix(bridge): NUMS point --------- Co-authored-by: Jose Storopoli <[email protected]>
1 parent d0ead41 commit 4c2f333

File tree

2 files changed

+46
-40
lines changed

2 files changed

+46
-40
lines changed

docs/technical/bitcoin-bridge.md

+45-40
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
1-
# Bitcoin Bridge
1+
# Bitcoin bridge
22

3-
The Bitcoin bridge is a two-way peg program between Bitcoin and Alpen Labs' rollup.
4-
It is a federated bridge, where a group of operators
5-
sign transactions to move funds into the rollup,
6-
whereas the user can withdraw funds from the rollup with the guarantee
7-
that at least one operator is honest.
3+
!!! note
4+
5+
Although Strata is designed to run on bitcoin mainnet,
6+
currently Strata is only running on a bitcoin signet.
7+
Any references to bitcoin or BTC in this documentation should be read
8+
as "bitcoin signet" or "signet BTC" when describing the current system.
9+
10+
The Strata bitcoin bridge enables the transfer of BTC between the bitcoin
11+
and Strata blockchains.
12+
The bridge is run by a federation of operators who
13+
co-sign transactions to move BTC into and out of the Strata bridge address.
814

915
!!! info
1016

1117
The current bridge design assumes an N-of-N cooperation amongst
1218
the bridge operators.
13-
Future designs will enhance the security model of the bridge operation.
19+
Future designs will improve the liveness and safety guarantees of the bridge.
1420

1521
The deposit flow is composed of a Deposit Request Transaction (DRT)
1622
which is fulfilled by the bridge federation with a Deposit Transaction (DT).
17-
The user should provide an Execution Layer (EL) address to receive the funds
18-
in the rollup.
23+
The user must provide an Execution Layer (EL) address to receive BTC on Strata.
1924

20-
The withdrawal request is assigned to an operator that fulfills it
21-
with the Bridge's funds with a Withdrawal Transaction (WT),
22-
and then collects the signatures from the bridge federation.
25+
The withdrawal request is assigned to an operator who fulfills the request
26+
by creating a transaction spending BTC from the bridge address to the user's
27+
specified withdrawal address. Once the other `N-1` operators co-sign this transaction
28+
it is broadcast to bitcoin for confirmation.
2329

2430
!!! note
2531

@@ -28,17 +34,17 @@ and then collects the signatures from the bridge federation.
2834

2935
!!! info
3036

31-
All the multisigs in the deposit and withdraw follows
37+
All the multisigs in the deposit and withdrawal flows follow
3238
the [MuSig2](https://github.com/bitcoin/bips/blob/master/bip-0327.mediawiki)
3339
protocol, where signatures are aggregated into a single signature
34-
that validates all $n$ participants' partial signatures.
40+
that validates all $N$ participants' partial signatures.
3541

3642
## Deposit
3743

3844
The deposit process is initiated by the user,
3945
who sends 10[^fees] BTC to a P2TR address, where:
4046

41-
[^fees]: The user must pay the Bitcoin network fees for both the Deposit Request and Deposit Transactions.
47+
[^fees]: The user must pay the bitcoin network fees for both the Deposit Request and Deposit Transactions.
4248

4349
1. The key path spend is unspendable, following
4450
[BIP 341](https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#constructing-and-spending-taproot-outputs)
@@ -47,39 +53,40 @@ who sends 10[^fees] BTC to a P2TR address, where:
4753

4854
[^nums]:
4955
"Nothing Up My Sleeve" (NUMS) point,
50-
i.e., a point with unknown discrete logarithm, chosen as $H = lift_x(G)$
51-
where $G$ is the secp256k1 generator point,
56+
i.e., a point with unknown discrete logarithm,
57+
constructed by taking the hash of the standard uncompressed encoding of
58+
the [secp256k1](https://www.secg.org/sec2-v2.pdf) base point $G$ as $X$ coordinate,
5259
as per [BIP 341](https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#constructing-and-spending-taproot-outputs).
5360
An unspendable pubkey is a point on the curve whose discrete log
5461
is not known with respect to the generator point $G$.
5562
This can be verified by revealing the random scalar $r$
5663
used to generate the pubkey by shifting the NUMS point.
5764

5865
1. The script path spend has two paths:
59-
1. "deposit path", an $n$-of-$n$ multisig path,
60-
where $n$ is the number of operators in the bridge.
61-
1. "take back" path,
66+
1. "Deposit path", an $N$-of-$N$ multisig path,
67+
where $N$ is the number of operators in the bridge.
68+
1. "Take back" path,
6269
which allows the user to take back their funds if the bridge fails to
6370
move funds from the Deposit Request Transaction (DRT)
6471
into the bridge address within a two-week period,
6572
i.e. it is time-locked and the user provides a signature to spend it.
6673

6774
This transaction has some metadata attached to it, in the form of an `OP_RETURN`
68-
output, that can be up to 80-bytes long (according to Bitcoin consensus rules);
75+
output, that can be up to 80 bytes long (according to bitcoin standardness policy),
6976
and is composed of the following data:
7077

71-
1. Magic bytes in the form `OP_PUSHBYTES_11 <some magic bytes>`.
72-
These take $1 + 11 = 12$ bytes and are used to identify the bridge.
73-
1. "Take back" TapLeaf hash as `OP_PUSHBYTES_32 <take back leaf hash>`.
74-
These take $1 + 32 = 33$ bytes and are used to validate the
78+
1. Magic bytes.
79+
These take $11$ bytes and are used to identify the bridge.
80+
1. "Take back" TapLeaf hash.
81+
These take $32$ bytes and are used to validate the
7582
Deposit Request Transaction (DRT),
7683
while also necessary for the control block required
77-
to spend the P2TR output via the $n$-of-$n$ Tapscript.
78-
1. Execution layer (EL) Address as `OP_PUSHBYTES_20 <el_address>`.
79-
The Execution Layer (EL) address is the address in the rollup where
80-
the user wants to receive the funds (sBTC) in the rollup.
84+
to spend the P2TR output via the $N$-of-$N$ Tapscript.
85+
1. Execution Layer (EL) address.
86+
The Execution Layer (EL) address is the Strata address where
87+
the user wants to receive the BTC in Strata.
8188
It is a 20-byte Ethereum Virtual Machine (EVM) address.
82-
This is $1 + 20 = 21$ bytes long.
89+
This is $20$ bytes long.
8390

8491
The bridge monitors the blockchain for incoming transactions,
8592
which can be detected by the `OP_RETURN` output.
@@ -90,7 +97,7 @@ and the full Taproot commitment.
9097
If the Deposit Request Transaction (DRT) is valid,
9198
the bridge operators fulfill the deposit with a Deposit Transaction (DT)
9299
that transfers the BTC to the bridge address's UTXO set
93-
and also mints the same amount of sBTC in the rollup to
100+
and also mints the same amount of BTC to
94101
the Execution Layer (EL) address provided by the user.
95102

96103
Below in the figure is the deposit flow:
@@ -112,20 +119,18 @@ sequenceDiagram
112119

113120
## Withdrawal
114121

115-
All withdrawals take place through the bridge's UTXO set.
116-
117-
The user requests a withdrawal in the rollup and an operator is assigned to
118-
fulfill the request in the Bitcoin network:
122+
The user requests a withdrawal on Strata and an operator is assigned to
123+
fulfill the request on bitcoin:
119124

120-
1. The user requests a withdrawal from the rollup making sure to burn the
121-
same amount of `sBTC`.
125+
1. The user requests a withdrawal making sure to burn the
126+
same amount of `BTC` on Strata.
122127
1. The assigned operator creates and signs a Withdrawal Transaction
123-
(WT) where they spend 10 BTC from the Bridge Address' UTXO set,
124-
while subtracting the operator's fee and the transaction fee;
128+
(WT) where they spend 10 BTC from the bridge address' UTXO set,
129+
while subtracting the operator's fee and the mining fee,
125130
and requests the other $N−1$ operators to sign
126131
the Withdrawal Transaction.
127132
1. Once all the signatures have been aggregated, the transaction is submitted to
128-
the Bitcoin network.
133+
bitcoin.
129134
1. Once the transaction is confirmed,
130135
the withdrawal request is fulfilled.
131136

project-words.txt

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ satoshis
3131
secp
3232
snarknado
3333
squidfunk
34+
standardness
3435
timelock
3536
txid
3637
unspendable

0 commit comments

Comments
 (0)