Skip to content

Commit 86b1153

Browse files
authored
Merge pull request #11 from kpd17/patch-14
Update design.md
2 parents e00647f + 78ead52 commit 86b1153

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

docs/Learn/products/btc-staking/design.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ hide_table_of_contents: false
44
sidebar_position: 2
55
---
66

7-
# Design of Non-Custodial BTC Staking
7+
# Non-Custodial Bitcoin Staking Design
88
---
99

1010
## Background
1111

12-
Core Chain’s methodology for integrating bitcoin staking centers on [CLTV timelock](https://en.bitcoin.it/wiki/Timelock#CheckLockTimeVerify). The `OP_CHECKLOCKTIMEVERIFY` (CLTV) timelock is a specific opcode used in Bitcoin's scripting language that allows for creating conditions based on time or block height before bitcoins can be spent from a transaction output. This provides a way to create outputs that are time-locked, meaning they cannot be spent until a certain condition related to time or block height is met.
12+
The methodology for integrating bitcoin staking centers on [CLTV timelock](https://en.bitcoin.it/wiki/Timelock#CheckLockTimeVerify). The `OP_CHECKLOCKTIMEVERIFY` (CLTV) timelock is a specific opcode used in Bitcoin's scripting language that allows for creating conditions based on time or block height before bitcoins can be spent from a transaction output. This provides a way to create outputs that are time-locked, meaning they cannot be spent until a certain condition related to time or block height is met.
1313

1414
![btc-staking-tx-design](../../../../static/img/btc-staking/tx-design/staking-tx-design%20(5).png)
1515

1616
## Transaction Structure
1717

1818
### Staking transaction
1919

20-
A BTC staking transaction should have two/three outputs, which are
20+
A Bitcoin staking transaction should have two/three outputs, which are
2121

2222
- `P2SH/P2WSH` type output, with time-lock enabled redeem script
23-
- `OP_RETURN` type output, with Core chain staking information
23+
- `OP_RETURN` type output, with Core staking information
2424
- (_Optional_) Change address
2525

2626
Note that there are **no** restrictions on inputs.
@@ -37,7 +37,7 @@ When the time-lock ends, the locked UTXO can be spent using the redeem script
3737

3838
### P2SH/P2WSH Output
3939

40-
* Core supports both `P2SH` and `P2WSH` outputs for BTC staking.
40+
* Core supports both `P2SH` and `P2WSH` outputs for Bitcoin staking.
4141

4242
* The construction of `P2SH` type output is as follows
4343

@@ -55,10 +55,10 @@ The `RedeemScript` should start with a CLTV time lock. Here are a few common ty
5555

5656
* When using a public key hash (most recommended) `<CLTV timelock> OP_CLTV OP_DROP OP_DUP OP_HASH160 <pubKey Hash> OP_EQUALVERIFY OP_CHECKSIG` and the corresponding unlocking script in the withdrawal transaction is `<sig> <pubKey> <RedeepScript>`
5757

58-
* When using multi signature address `<CLTV timelock> OP_CLTV OP_DROP M <pubKey1> <pubKey1> ... <pubKeyN> N OP_CHECKMULTISIG` and the corresponding unlocking script in the withdrawal transaction is `OP_0 <sig1> ... <sigM> <RedeemScript>` The amount and duration of BTC locked in this output will be used for the calculation of validator election and reward distribution on the Core chain.
58+
* When using multi signature address `<CLTV timelock> OP_CLTV OP_DROP M <pubKey1> <pubKey1> ... <pubKeyN> N OP_CHECKMULTISIG` and the corresponding unlocking script in the withdrawal transaction is `OP_0 <sig1> ... <sigM> <RedeemScript>` The amount and duration of Bitcoin locked in this output will be used for the calculation of validator election and reward distribution on Core.
5959

6060
> **Note**
61-
> There are _minimal requirements_ on both **amount** and **duration** to make the staking eligible on Core. A user should at least stake **0.01 BTC** (less transaction fees) for at least **10 days** (`CLTV timestamp - transaction confirmation timestamp > 10 days`).
61+
> There are _minimal requirements_ on both **amount** and **duration** to make the staking eligible on Core. A user should at least stake **0.01 Bitcoin** (less transaction fees) for at least **10 days** (`CLTV timestamp - transaction confirmation timestamp > 10 days`).
6262
6363
## OP_RETURN Output
6464

@@ -75,14 +75,14 @@ The `OP_RETURN` output should contain all staking information in order, and be c
7575
- (_Optional_) **`RedeemScript`**
7676
- (_Optional_) **`Timelock`:** 4 bytes
7777

78-
#### Key Points to Ensure
78+
#### Key Points
7979
- Any bytes that can translate to a number should use `OP_number` (`{0}` should use `OP_0` instead of `0x0100`, `{16}` should use `OP_16` instead of `0x0110`)
8080
- Any bytes with lengths smaller than `0x4c (76)` is pushed with 1 byte equal to the size `(byte[10] -> 10 + byte[10]; byte[70] -> 70 + byte[70])`
8181
- Any bytes bigger than or equal to `0x4c` is pushed by using `0x4c` (ie. `OP_PUSHDATA`) followed by the length followed by the data `(byte[80] -> OP_PUSHDATA + 80 + byte[80])`
8282
- Any bytes with length bigger than `255` uses `0x4d` (`OP_PUSHDATA2`)
8383
- Any bytes with length bigger than `65535` (`0xffff`) uses `0x4e` (`OP_PUSHDATA4`)
8484

85-
Either `RedeemScript` or `Timelock` must be available, the purpose is to allow relayer to obtain the `RedeemScript` and submit transactions on the Core chain. If a `RedeemScript` is provided, relayer will use it directly. Otherwise, relayer will construct the redeem script based on the timelock and the information in the transaction inputs. You can find more information about the relayer role in the [below section](#role-of-relayers).
85+
Either `RedeemScript` or `Timelock` must be available, the purpose is to allow relayer to obtain the `RedeemScript` and submit transactions on Core. If a `RedeemScript` is provided, relayer will use it directly. Otherwise, relayer will construct the redeem script based on the timelock and the information in the transaction inputs. You can find more information about the relayer role in the [below section](#role-of-relayers).
8686

8787
## Transaction Examples
8888

@@ -144,14 +144,14 @@ In the input, the redeem script `041f5e0e66b17576a914c4b8ae927ff2b9ce218e20bf06d
144144
145145
## Role of Relayers
146146

147-
In a strict sense, the Non-Custodial BTC Staking process consists of two steps
147+
In a strict sense, the Non-Custodial Bitcoin Staking process consists of two steps
148148

149149
1. Stake on the Bitcoin network
150-
2. Submit the confirmed BTC staking transaction to the Core chain
150+
2. Submit the confirmed Bitcoin staking transaction to Core
151151

152-
To make the entire process more convenient, Core Chain introduces the role of relayers. Relayers can help users submit transactions to the Core network after the staking transaction is confirmed on the Bitcoin network. Since it is necessary to verify the transaction on the Core network with the embedded Bitcoin light client, relayers needs to obtain the corresponding `RedeemScript` of the `P2SH/P2WSH` output. To meet this requirement, we suggest users to either
152+
To make the entire process more convenient, Core introduces the role of relayers. Relayers can help users submit transactions to the Core network after the staking transaction is confirmed on the Bitcoin network. Since it is necessary to verify the transaction on the Core network with the embedded Bitcoin light client, relayers needs to obtain the corresponding `RedeemScript` of the `P2SH/P2WSH` output. To meet this requirement, we suggest users to either
153153

154154
- Put the entire `RedeemScript` at the end of the `OP_RETURN` output, if the script is short. e.g. a `RedeemScript` constructed using public key hash as shown in the sample above.
155155
- Set the receiving address of the staking transaction as their own so relayers can extract useful information from the transaction input and compose the `RedeemScript` by themselves. E.g.
156156
- If it's a normal address, the `pubkey` or `pubkey hash` should be set as the input's corresponding public key when constructing the `RedeemScript`.
157-
- If it is a multi-signature address, the corresponding multi-signature address's public key should be set when constructing the `RedeemScript`.
157+
- If it is a multi-signature address, the corresponding multi-signature address's public key should be set when constructing the `RedeemScript`.

0 commit comments

Comments
 (0)