Skip to content

Commit dcb5854

Browse files
authored
docs: improve spv type lock docs
1 parent 95b985e commit dcb5854

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

contracts/ckb-bitcoin-spv-type-lock/README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ A type script for Bitcoin SPV clients which synchronize [Bitcoin] state into [CK
77
A [Bitcoin] SPV in [CKB] contains a set of cells, this type script is used
88
to manage them.
99

10-
Since this type script has a unique ID in its script [`args`], so the size of
11-
the set of cells is immutable after they created.
10+
The set is identified by the script [`args`]. The number of live cells with this
11+
specific `args` script is fixed once created, and all cells in the set are
12+
destroyed together.
1213

1314
### Cells
1415

@@ -57,7 +58,7 @@ There are 4 kinds of operations:
5758
Inputs:
5859
- Enough Capacity Cells
5960
Outputs:
60-
- SPV Info (last_client_id=0)
61+
- SPV Info (tip_client_id=0)
6162
- SPV Client (id=0)
6263
- SPV Client (id=1)
6364
- SPV Client (id=2)
@@ -82,7 +83,7 @@ There are 4 kinds of operations:
8283
- Type Lock
8384
- ... ...
8485
Inputs:
85-
- SPV Info (last_client_id=0)
86+
- SPV Info (tip_client_id=0)
8687
- SPV Client (id=0)
8788
- SPV Client (id=1)
8889
- SPV Client (id=2)
@@ -106,7 +107,8 @@ There are 4 kinds of operations:
106107
we consider that it has the latest data.
107108

108109
The client cell who has the next ID of the `tip_client_id` in the info cell,
109-
we consider that it has the oldest data. The next ID of ID `n-1` is `0`.
110+
we consider that it has the oldest data. These client cells form a ring, where
111+
the next ID after `n-1` is `0`.
110112

111113
Once we update the Bitcoin SPV instance, we put the new data into the client
112114
cell which has the oldest data, and update the `tip_client_id` in the client
@@ -122,11 +124,11 @@ There are 4 kinds of operations:
122124
- SPV Client (id=k)
123125
- ... ...
124126
Inputs:
125-
- SPV Info (last_client_id=k)
127+
- SPV Info (tip_client_id=k)
126128
- SPV Client (id=k+1)
127129
- ... ...
128130
Outputs:
129-
- SPV Info (last_client_id=k+1)
131+
- SPV Info (tip_client_id=k+1)
130132
- SPV Client (id=k+1)
131133
- ... ...
132134
Witnesses:
@@ -153,14 +155,14 @@ There are 4 kinds of operations:
153155
- SPV Client (id=t)
154156
- ... ...
155157
Inputs:
156-
- SPV Info (last_client_id=k)
158+
- SPV Info (tip_client_id=k)
157159
- SPV Client (id=t+1)
158160
- SPV Client (id=t+2)
159161
- SPV Client (id=...)
160162
- SPV Client (id=k)
161163
- ... ...
162164
Outputs:
163-
- SPV Info (last_client_id=t+1)
165+
- SPV Info (tip_client_id=t+1)
164166
- SPV Client (id=t+1)
165167
- SPV Client (id=t+2)
166168
- SPV Client (id=...)

0 commit comments

Comments
 (0)