1
- # Bitcoin Bridge
1
+ # Bitcoin bridge
2
2
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.
8
14
9
15
!!! info
10
16
11
17
The current bridge design assumes an N-of-N cooperation amongst
12
18
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.
14
20
15
21
The deposit flow is composed of a Deposit Request Transaction (DRT)
16
22
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.
19
24
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.
23
29
24
30
!!! note
25
31
@@ -28,17 +34,17 @@ and then collects the signatures from the bridge federation.
28
34
29
35
!!! info
30
36
31
- All the multisigs in the deposit and withdraw follows
37
+ All the multisigs in the deposit and withdrawal flows follow
32
38
the [MuSig2](https://github.com/bitcoin/bips/blob/master/bip-0327.mediawiki)
33
39
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.
35
41
36
42
## Deposit
37
43
38
44
The deposit process is initiated by the user,
39
45
who sends 10[ ^ fees ] BTC to a P2TR address, where:
40
46
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.
42
48
43
49
1 . The key path spend is unspendable, following
44
50
[ 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:
47
53
48
54
[ ^ nums ] :
49
55
"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,
52
59
as per [ BIP 341] ( https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#constructing-and-spending-taproot-outputs ) .
53
60
An unspendable pubkey is a point on the curve whose discrete log
54
61
is not known with respect to the generator point $G$.
55
62
This can be verified by revealing the random scalar $r$
56
63
used to generate the pubkey by shifting the NUMS point.
57
64
58
65
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,
62
69
which allows the user to take back their funds if the bridge fails to
63
70
move funds from the Deposit Request Transaction (DRT)
64
71
into the bridge address within a two-week period,
65
72
i.e. it is time-locked and the user provides a signature to spend it.
66
73
67
74
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),
69
76
and is composed of the following data:
70
77
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
75
82
Deposit Request Transaction (DRT),
76
83
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 .
81
88
It is a 20-byte Ethereum Virtual Machine (EVM) address.
82
- This is $1 + 20 = 21 $ bytes long.
89
+ This is $20 $ bytes long.
83
90
84
91
The bridge monitors the blockchain for incoming transactions,
85
92
which can be detected by the ` OP_RETURN ` output.
@@ -90,7 +97,7 @@ and the full Taproot commitment.
90
97
If the Deposit Request Transaction (DRT) is valid,
91
98
the bridge operators fulfill the deposit with a Deposit Transaction (DT)
92
99
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
94
101
the Execution Layer (EL) address provided by the user.
95
102
96
103
Below in the figure is the deposit flow:
@@ -112,20 +119,18 @@ sequenceDiagram
112
119
113
120
## Withdrawal
114
121
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:
119
124
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 .
122
127
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,
125
130
and requests the other $N−1$ operators to sign
126
131
the Withdrawal Transaction.
127
132
1 . Once all the signatures have been aggregated, the transaction is submitted to
128
- the Bitcoin network .
133
+ bitcoin .
129
134
1 . Once the transaction is confirmed,
130
135
the withdrawal request is fulfilled.
131
136
0 commit comments