Skip to content

Commit d771ae4

Browse files
committed
add TSS doc
1 parent f152c8e commit d771ae4

File tree

1 file changed

+286
-0
lines changed

1 file changed

+286
-0
lines changed

mainnet/sidechain-1/tss.md

Lines changed: 286 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,286 @@
1+
# TSSigner
2+
3+
The *`TSS`*(**Threshold Signature Scheme**) network is a key building block intended to perform Bitcoin signing in the distributed manner to facilitate the Bitcoin bridge on the [Side Chain](https://github.com/sideprotocol/side)
4+
5+
The TSS signature network consists of twenty-one nodes which are a subset of the Side validators of well-known reputation.
6+
7+
TSS nodes are mainly responsible for several tasks: *`DKG`*(**Distributed Key Generation**), `Signing` and `Relaying`.
8+
9+
## DKG
10+
11+
The DKG procedure is as follows:
12+
13+
1. Initiate: The DKG initiation is proposed as a governance proposal on the Side Chain. The proposal contains the DKG participant set and required threshold for later signing.
14+
15+
2. Vote: Community members and validators can vote for the proposal.
16+
17+
3. Create: The DKG request is formally created on the Side Chain when the proposal passed.
18+
19+
4. Complete: TSS nodes will coordinate to complete the DKG request. All participants listed in the proposal must be connected to the TSS network in the phase.
20+
21+
5. Re-DKG: This happen when some nodes want to quit the TSS network according to their operation demands. New signing keys will be generated by the steps above and all assets held by the previous keys will be transferred to the newly generated ones.
22+
23+
## Signing
24+
25+
Signing is the regular task for TSS nodes.
26+
27+
1. Signing requests are fetched from the Side Chain by the TSS node periodically.
28+
29+
2. Sign the requests and broadcast the related messages when signing requests are received.
30+
31+
## Relaying
32+
33+
As the security guard, TSS nodes can contribute to the security of the bitcoin bridge by relaying the bitcoin block headers.
34+
35+
At the same time, the bridge related transactions including deposit and withdrawal can be relayed to the Side Chain by TSS nodes as well.
36+
37+
## Get started
38+
39+
### Build from source
40+
41+
1. Install *Rust*
42+
43+
```
44+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
45+
```
46+
47+
2. Clone and build
48+
49+
```
50+
git clone https://github.com/sideprotocol/shuttler.git
51+
cd shuttler
52+
git checkout v1.0.0
53+
cargo build --release
54+
```
55+
56+
**Note:** v1.0.0 will be released soon.
57+
58+
The binary can be placed into the bin directory of Cargo for convenience.
59+
60+
```
61+
cp target/release/shuttler ~/.cargo/bin
62+
```
63+
64+
### Configure
65+
66+
1. Initialize
67+
68+
```
69+
shuttler --home ~/.shuttler init --network bitcoin
70+
```
71+
72+
The *home* directory can be replaced by your choice.
73+
74+
You can specify the port by `--port`. The default port is `5158`.
75+
76+
2. Set the bootstrapping nodes
77+
78+
```
79+
bootstrap_nodes = ["<peer address>",...,"<peer address>"]
80+
```
81+
82+
The bootstrapping nodes are used to help connect to the TSS network when started.
83+
84+
The format of the peer address is like this:
85+
86+
```
87+
/ip4/<IP>/tcp/<PORT>/p2p/<PEER ID>
88+
```
89+
90+
The `local peer id` can be retrieved as the following command:
91+
92+
```
93+
shuttler --home <home> id
94+
```
95+
96+
The seed node provided by Side Labs is as following:
97+
98+
```
99+
<will be published>
100+
```
101+
102+
3. Set the validator key
103+
104+
```
105+
priv_validator_key_path = "<validator key path>"
106+
```
107+
108+
The validator key is required to participate the DKG.
109+
The item should be set to the correct location which is commonly the *.side/config/priv_validator_key.json* in the home directory.
110+
111+
**Note**: **TMS is not supported currently.**
112+
113+
4. Set the Side config
114+
115+
**gRPC:**
116+
117+
```
118+
[side_chain]
119+
grpc = "<gprc address>"
120+
```
121+
122+
If you run own Side node on the same server, the item can be set to `http://localhost:9090`. The value can be configured by the actual deployment or set to the public Side node which provides the gRPC server.
123+
124+
**Gas and Fee:**
125+
126+
```
127+
[side_chain]
128+
gas = <gas limit>
129+
```
130+
131+
```
132+
[side_chain.fee]
133+
amount = <fee amount>
134+
denom = "uside"
135+
```
136+
137+
**Note:**
138+
139+
The recommended values are `gas = 2000000` and `amount = 2000`.
140+
141+
The setting can be adjusted by demand, e.g. when `out of gas` occurred.
142+
143+
5. Set the Bitcoin RPC
144+
145+
```
146+
[bitcoin]
147+
network = "<network name>"
148+
rpc = "<rpc endpoint>"
149+
user = "<rpc username>"
150+
password = "<rpc password>"
151+
```
152+
153+
*Note*: **Required only by relayers**
154+
155+
For relayers, the bitcoin node rpc is required to sync the bitcoin block headers and relay the bridge related transactions between the Bitcoin and Side Chain.
156+
157+
The TSS node operator can deploy own bitcoin node or use the third-party server provider by demand.
158+
159+
The public bitcoin node information provided by Side Labs is as follows:
160+
161+
```
162+
network = "bitcoin"
163+
rpc = "http://192.248.180.245:8332"
164+
user = "side"
165+
password = "12345678"
166+
```
167+
168+
**_Note_**: The `--txindex` is required to be set when starting the Bitcoin node as following:
169+
170+
```
171+
bitcoind -txindex -rpcuser=<user> --rpcpassword=<password>
172+
```
173+
174+
### Fund the relayer address
175+
176+
The relayer(Side transaction sender) address can be viewed by the following command:
177+
178+
```
179+
shuttler --home <home> address
180+
```
181+
182+
**Note**: Before starting the TSS node, the sender address needs to be funded for sending the transactions to the Side Chain.
183+
184+
### Start
185+
186+
The TSS node can be started by the different modes or roles: *`signer`* and *`relayer`*.
187+
188+
**Note:**
189+
190+
**Only signer mode is required to participate DKG and sign transactions.**
191+
192+
**If there is operational and synced Bitcoin full node, the relayer mode can be enabled.**
193+
194+
1. Start as signer (**Recommended**)
195+
196+
```
197+
shuttler --home <home> start --signer
198+
```
199+
200+
or start by default
201+
202+
```
203+
shuttler --home <home> start
204+
```
205+
206+
2. Start as relayer
207+
208+
```
209+
shuttler --home <home> start --relayer
210+
```
211+
212+
3. Start as both signer and relayer
213+
214+
```
215+
shuttler --home <home> start --signer --relayer
216+
```
217+
218+
### Hardware Specifications
219+
220+
#### Running only the TSS node
221+
222+
1. Minimum Requirements
223+
224+
- CPU: 4 cores
225+
226+
- RAM: 8 GB
227+
228+
- Storage: 100 GB
229+
230+
- Network: 1 Gbps
231+
232+
2. Recommended Specifications
233+
234+
- CPU: 8 cores
235+
236+
- RAM: 16 GB
237+
238+
- Storage: 500 GB
239+
240+
- Network: 1 Gbps
241+
242+
#### Running only the Bitcoin full node
243+
244+
1. Minimum Requirements
245+
246+
- CPU: 4 cores
247+
248+
- RAM: 8 GB
249+
250+
- Storage: 500 GB
251+
252+
- Network: 1 Gbps
253+
254+
2. Recommended Specifications
255+
256+
- CPU: 8 cores
257+
258+
- RAM: 16 GB
259+
260+
- Storage: 500 GB
261+
262+
- Network: 1 Gbps
263+
264+
#### Running both the TSS node and Bitcoin full node
265+
266+
1. Minimum Requirements
267+
268+
- CPU: 4 cores
269+
270+
- RAM: 8 GB
271+
272+
- Storage: 500 GB
273+
274+
- Network: 1 Gbps
275+
276+
2. Recommended Specifications
277+
278+
- CPU: 8 cores
279+
280+
- RAM: 16 GB
281+
282+
- Storage: 500 GB
283+
284+
- Network: 1 Gbps
285+
286+
**Note**: To ensure service quality, we strongly recommend not running the Side Chain validator node on any of the machines listed above.

0 commit comments

Comments
 (0)