On this page
- §0 The area in one paragraph
- 1. Pieces, the manifest and the root
- 2. StoreFile (40)
- 3. FundStoredFile (296)
- 4. Stored-file rent and the storage pool
- 5. Replica placement and epochs
- 6. Proof of possession: SubmitStorageProof (41) and SubmitStorageProofBatch (297)
- 7. The epoch tally
- 8. Access control at fetch (HTTP)
- 9. Piece transport (P2P) and placement upkeep
- 10. Upload admission and the quote (HTTP)
- 11. Ledger rows and the consensus/local split
- 12. The snapshot archive
11 — Decentralized storage: stored files, rent, placement, proofs and the storage pool
Out of scope the fee floor, the duty lane and the overpay refund (04); the per-block step order (22); the longevity pool and its payout (13, 21); the payout view that says whether a node earns (09 §12); the oracle that resolves snapshot attestations (17); the snapshot file, its chunks and the sample-drawing rule (26); the signed-request headers of the HTTP API (31); the P2P framing (27, 28); the DFS files and the datasets that also use ZBS_ deposit addresses (10)
§0 The area in one paragraph
A stored file is anchored on chain by its manifest: the file is cut into pieces of
1,048,576 bytes, each piece is named by the SHA3-256 of its bytes, and the root = SHA3-256 of
piece_size ‖ total_size ‖ piece ids is the file's identity. A StoreFile records the
manifest, an owner, a rent deposit, an access mode and an allow list; a FundStoredFile adds
to the deposit, and anyone may send one. Once per billing period (the snapshot cycle) the chain
moves one period's rent (whole mebibytes, at least one, times the per-MiB price) from the deposit
into the storage pool ZBCSTORE, and prunes the file when the deposit cannot cover a period;
the remainder of a pruned deposit goes to the longevity pool. Which nodes should hold a piece is
decided by rendezvous hashing over the active registry keys with the hash of the block that
opened the epoch as the seed; the pieces themselves travel between nodes over two P2P calls and
never touch consensus state. Each epoch a holder submits a proof of possession (SHA3-256 of the
piece bytes and a chain-derived nonce), normally all its proofs of the epoch in one fee-free
SubmitStorageProofBatch; at the next epoch boundary the chain tallies, per piece, which submitted
proofs agree, and when at least three distinct registered nodes agree on a unique majority it pays
each agreeing node that earns a share of the active files' rent, from the pool. The chain holds no
piece bytes, so it judges agreement, not truth; an outvoted or silent node only forgoes the reward.
The same storage also keeps the snapshot archive: every snapshot two thirds of the registry
attested joins it, each of its chunks is held by five registered nodes chosen by lot, every node
keeps only its last three snapshots locally, and each epoch 64 sampled chunks are proven and their
honest holders share a part of the longevity pool. Everything in the stored_file and
storage_proof tables, the pools, the tally and the archive's admission is consensus; the piece
store, placement upkeep, transport, upload admission, the fetch-side access check and the storage
audit ledger are each node's own.
1. Pieces, the manifest and the root
Purpose. The content identity every other mechanism refers to; an implementation must compute the same piece ids and root from the same bytes.
Inputs. A byte string (the file content), the piece size piece_size (u32; the value every
reference node uses is DEFAULT_PIECE_SIZE = 1,048,576).
Output and effect. piece_id = SHA3-256(piece bytes). The content is cut into consecutive
pieces of piece_size bytes, the last one shorter (an empty content has no pieces). The root =
SHA3-256 of:
| Offset | Length | Field | Encoding |
|---|---|---|---|
| 0 | 4 | piece_size |
u32 LE |
| 4 | 8 | total_size |
u64 LE, the content length in bytes |
| 12 | 32 × n | piece_ids |
the n piece ids in content order |
Reassembly concatenates the pieces in manifest order after re-hashing each against its id, then
checks the length against total_size. There is no erasure coding: a piece is replicated
whole to K holders (§5).
How to compute it.
- Split the content into pieces of
piece_sizebytes. - Hash each piece with SHA3-256.
- Hash
LE32(piece_size) ‖ LE64(total_size) ‖ id_0 ‖ … ‖ id_(n−1).
Rule activation. None.
Rejections and errors. Reassembly refuses "piece count != manifest", "piece i hash mismatch", "reassembled size != total_size" (node-local).
Vector. computed.
- INPUT: content = the 42 ASCII bytes
ZooBC decentralised storage: example filefollowed by0A(hex5A6F6F424320646563656E7472616C697365642073746F726167653A206578616D706C652066696C650A),piece_size1,048,576. - EXPECTED OUTPUT: one piece,
piece_id=3A37640C3FC158F57CBE24F9F0B2B1E448DDA55DB9738069E6B8A4A3C12EB280; root = SHA3-256(00001000‖2A00000000000000‖ piece_id) =A6911274C20C21279E714E13A83AC49382ECD56151AE9D04EC1369B414FC661B. - INPUT: content = the bytes
00 01 … FFrepeated 4,097 times (1,048,832 bytes). EXPECTED OUTPUT: two pieces (1,048,576 and 256 bytes), idsD968751128CFEC8780DDFE859F11BDCD8B84E1F2175A1093FA9E776AD7FAC6B1and9B04C091DA96B997AFB8F2585D608AEBE9C4A904F7D52C8F28C7E4D2DD9FBA5F, root27A29ABDE23D1DC06A5195B5E9FB0D22A6C891A5D6AC7D8E9A3427EE930EA247.
Test cases · §1
3 cases · 3 valid
A 42-byte file: one piece and its root
Loading the test widget…
The bytes 00 … FF repeated 4,097 times: two pieces
Loading the test widget…
An empty content has no pieces
Loading the test widget…
Defects to match. None.
2. StoreFile (40)
Purpose. Anchor a manifest with a rent deposit and an access policy; an implementation must accept, refuse and record exactly as below.
Inputs. The envelope (03; recipient empty) and the body:
| Offset | Length | Field | Encoding |
|---|---|---|---|
| 0 | 32 | file_root |
must equal the root of §1 over the fields below |
| 32 | 8 | total_size |
u64 LE |
| 40 | 4 | piece_size |
u32 LE, > 0 |
| 44 | 8 | deposit |
i64 LE, ≥ STORE_FILE_MIN_DEPOSIT = 1,000,000 (0.01 ZBC) |
| 52 | 4 | piece_count |
u32 LE, 1 … STORE_FILE_MAX_PIECES = 100,000 |
| 56 | 32 × n | piece_ids |
n = piece_count |
| 56 + 32n | 0 or more | access block | optional, below |
The fixed length is 56 + 32n. The optional access block: flags (1 byte; only bits 0 and 1
may be set; bit 0 = private, bit 1 = an allow list follows), then, when bit 1 is set, the allow list
count (u8) ‖ count × (addr_len (u8) ‖ address (addr_len bytes)). Without bit 1 the block
is exactly the one flags byte. The allow list is read entry by entry: reading stops at the declared
count, at an entry whose addr_len is 0, or at an entry that would run past the end; re-encoding
the entries read (count byte = the number read) must give as many bytes as follow the flags byte,
and the entries read must number 1 … STORE_FILE_MAX_ALLOWED = 16, each a well-formed typed
account (07 §3.1, so a bare 32-byte key is refused) and not a full-key form (rule
canonical_account_forms, 07 §3.1).
Output and effect. In order, at execution:
- The fee is charged (a fee the sender cannot pay makes the block invalid).
- When
stored_filealready holds an active record for the root (newest row,status0): a paid no-op. - The deposit is debited from the sender, with a ledger row of event 51 (−deposit). A sender that cannot pay the deposit: a paid no-op (fee kept, nothing stored).
- A new
stored_fileversion at this height:file_root,owner_address= the sender's typed account (the group for an enabled member,08§1),total_size,piece_size,piece_ids(one blob of 32n bytes in order),deposit,status0,last_billed_height0,block_height= this height,access_mode1 when flags bit 0 is set else 0,allowed_addresses= the allow list re-encoded ascount ‖ (len ‖ address)*(00when there is none). The previous newest row of the root, if any (a pruned record,status1), loses itslatestmarker: a pruned root may be stored again. - The fee settlement of
04§5.
How to compute it. Stateless checks (admission and block validation; a failure refuses admission and makes a block invalid), in this order:
- body ≥ 56 bytes, else
"StoreFile body too short"; piece_size= 0 →"StoreFile piece_size must be > 0";piece_count0 or > 100,000 →"StoreFile piece_count out of range";- body longer than the fixed length: flags with a bit other than 0 or 1 →
"StoreFile: unknown access flags"; bit 1 set and no entry read →"StoreFile: allow list flag set but the list is empty"; bit 1 set and the re-encoding of the entries read not as long as the bytes after the flags byte →"StoreFile: trailing bytes after the allow list"; more than 16 entries →"StoreFile: allow list too long"; then entry by entry, both tests on one entry before the next: not a well-formed typed account →"StoreFile: malformed address in the allow list", a full-key form →"StoreFile: allow list: a full-key account form (an Ethereum or Tron key, a Bitcoin key) is not an account: no transaction can be sent from it; name the 20-byte address (rule canonical_account_forms)"; bit 1 clear and the body not exactly fixed length + 1 →"StoreFile: trailing bytes after the access flags"; - body shorter than the fixed length →
"StoreFile body length mismatch"; deposit< 1,000,000 →"StoreFile deposit below minimum";- the root of §1 over (
piece_size,total_size,piece_ids) ≠file_root→"StoreFile root != manifest hash".
The executor repeats every one of these checks but the full-key test (in the order empty list, too long, malformed, trailing bytes); a transaction that passed stateless validation never fails them there.
Admission checks against the state (refusals only, never in a block): deposit < 0 →
"StoreFile: deposit cannot be negative"; an active record for the root → "StoreFile: this file is already stored and active; add rent with FundStoredFile instead"; deposit + fee overflows →
"StoreFile: deposit + fee overflow"; the sender's spendable balance (07 §3) below deposit + fee
→ "StoreFile: deposit is more than the account holds — storage rent is paid up front (FundStoredFile adds to it later, from stored_file_topup) (need N atomic incl. fee, have M)". In a block only the
confirmed balance decides (step 3 above).
Rule activation. storage_acl (the access block) and canonical_account_forms (the full-key
test): active from height 0 on every chain.
Rejections and errors. As listed: the stateless ones refuse admission and make a block invalid; an unpayable fee makes the block invalid; a duplicate root or an unpayable deposit is a paid no-op.
Vector. computed (TestNet prices).
- INPUT: a StoreFile of the 42-byte file of §1, deposit 5,000,000, public (no access block). Body
(88 bytes):
A6911274C20C21279E714E13A83AC49382ECD56151AE9D04EC1369B414FC661B 2A00000000000000 00001000 404B4C0000000000 01000000 3A37640C3FC158F57CBE24F9F0B2B1E448DDA55DB9738069E6B8A4A3C12EB280. EXPECTED OUTPUT (mined at height h by sender S with enough balance): S −fee (event 1), S −5,000,000 (event 51);stored_filerow (file_root= the root,owner_address= S,total_size42,piece_size1,048,576,piece_ids= the one id,deposit5,000,000,status0,last_billed_height0,block_heighth,access_mode0,allowed_addresses00). - INPUT: the same body followed by the access block (39 bytes)
03 01 24 000000007D8BD8A41DCEEA4986D1E99DFE99CA9303874B7C3AAC7EEECD60A82F61902572(flags 3 = private with an allow list; one 36-byte entry, the TestNet release authority's typed account). EXPECTED OUTPUT: as above withaccess_mode1 andallowed_addresses= the 38 bytes after the flags byte. - INVALID: the 88-byte body with its first byte changed from
A6toA7→"StoreFile root != manifest hash"; the 88-byte body with the deposit field3F420F0000000000(999,999) →"StoreFile deposit below minimum"; the 88-byte body followed by the single byte04→"StoreFile: unknown access flags"; the 88-byte body followed by02 01 20and 32 bytes (a bare key in the allow list) →"StoreFile: malformed address in the allow list"; the 88-byte body followed by03 01 44 04000000and 64 ×66(one 68-byte entry, an Ethereum full-key form) →"StoreFile: allow list: a full-key account form (an Ethereum or Tron key, a Bitcoin key) is not an account: no transaction can be sent from it; name the 20-byte address (rule canonical_account_forms)"; the 88-byte body followed by the 39-byte access block above and one more byte00(40 bytes after the fixed length: the one entry re-encodes to 38 bytes, 39 follow the flags byte) →"StoreFile: trailing bytes after the allow list", refused at admission and invalid in a block.
Test cases · §2
13 cases · 6 valid · 7 invalid · 1 reference
The StoreFile body of the 42-byte file, public
Loading the test widget…
The same with an allow list naming the release authority
Loading the test widget…
The public StoreFile passes the stateless checks
Loading the test widget…
The private StoreFile passes the stateless checks
Loading the test widget…
A StoreFile whose root is changed is refused
Loading the test widget…
A deposit of 999,999 is refused
Loading the test widget…
An unknown access flag is refused
Loading the test widget…
A bare 32-byte key in the allow list is refused
Loading the test widget…
An Ethereum full-key form in the allow list is refused
Loading the test widget…
A byte after the allow list is refused
Loading the test widget…
A count byte of 2 over one entry passes the stateless checks
Loading the test widget…
A 55-byte body is refused
Loading the test widget…
The record a mined StoreFile writes
A stated value: there is nothing to compute. A compatible node shows the same value.
- rows
1:-fee, 51:-5000000- stored_file
total_size 42, piece_size 1048576, deposit 5000000, status 0, last_billed_height 0, access_mode 0, allowed_addresses 00
Defects to match. (1) The fee of a StoreFile is a hard debit (an unpayable fee fails the block)
while every state refusal after it is a paid no-op. (2) The trailing-bytes test compares lengths
only, so a count byte larger than the entries present is accepted when the entries present
re-encode to the same length (one byte for the count either way): 02 24 <36 bytes> stores a
one-entry list, written back as 01 24 <36 bytes>. (3) The chain never sees the pieces: a manifest
of invented ids is anchored, billed and pruned like any other.
3. FundStoredFile (296)
Purpose. Add rent to an active stored file; anyone may pay.
Inputs. Body, exactly 40 bytes: file_root (32) ‖ amount (8, i64 LE, ≥ 1,000,000). Envelope
recipient empty.
Output and effect. In order, at execution: the fee is charged (a fee the sender cannot pay: a
silent no-op, nothing written); no record for the root or a record that is not active → paid no-op;
deposit + amount overflows → paid no-op; the sender cannot pay amount → paid no-op; otherwise
the sender is debited amount, a new stored_file version is written at this height with deposit += amount and, when the record was never billed (last_billed_height 0), last_billed_height set
to the previous version's block_height (so the rent clock does not move), and a ledger row of
event 51 (−amount) on the sender. Then 04 §5. The payer is not recorded on the file: a stored
file's deposit is one number.
How to compute it. Stateless (admission and block validation): body length ≠ 40 →
"FundStoredFile body must be exactly 40 bytes (file root, amount)"; amount < 1,000,000 →
"FundStoredFile: amount below the minimum deposit of 1000000 units". Admission against the state:
no record → "FundStoredFile: no stored file has that root"; not active → "FundStoredFile: that file is no longer stored (its deposit ran out)"; amount + fee overflows → "FundStoredFile: amount + fee overflow"; spendable balance below amount + fee → "FundStoredFile: insufficient balance for amount + fee (need N, have M)".
Rule activation. The type exists from rule stored_file_topup, active from height 0 on every
chain.
Rejections and errors. As listed.
Vector. computed.
- INPUT: body
A6911274C20C21279E714E13A83AC49382ECD56151AE9D04EC1369B414FC661B 40420F0000000000(the root of §2, 1,000,000) mined at height h + 5 by any account P, the record of §2 (stored at h, never billed) being active. - EXPECTED OUTPUT: P −fee (event 1), P −1,000,000 (event 51); a new record version with
deposit6,000,000,block_heighth + 5,last_billed_heighth. - INVALID: the same root with amount
3F420F0000000000(999,999) →"FundStoredFile: amount below the minimum deposit of 1000000 units"; a 41-byte body →"FundStoredFile body must be exactly 40 bytes (file root, amount)"; an unknown root →"FundStoredFile: no stored file has that root"(admission).
Test cases · §3
5 cases · 2 valid · 3 invalid · 2 reference
A FundStoredFile of 1,000,000 passes the stateless checks
Loading the test widget…
A top-up of 999,999 is refused
Loading the test widget…
A 41-byte body is refused
Loading the test widget…
The record after the top-up
A stated value: there is nothing to compute. A compatible node shows the same value.
- deposit
6000000- block_height
h + 5- last_billed_height
h
A top-up of an unknown root is refused at admission
A stated value: there is nothing to compute. The statement is a refusal: the exact text a compatible node answers.
- refusal
FundStoredFile: no stored file has that root
Defects to match. None.
4. Stored-file rent and the storage pool
Purpose. What a file pays per period, to where, and when it is pruned.
Inputs. The active records (newest row per root with status 0); the parameter
dataset_storage_cost_per_mib (governable, 10; TestNet 5,000,000, DevNet 100,000,000); the
billing period = the snapshot cycle (main_snapshot_interval: TestNet 172,800, DevNet 240); the
block (height h, timestamp).
Output and effect. A per-block step (22 gives its place: after the gateway pruning, before
the proof tally of §7). The due set = the active records with h − base ≥ period, where base
= last_billed_height when non-zero, else the record's block_height, taken in ascending
file_root byte order. For each:
rent = max(1, ceil(total_size / 1,048,576)) × cost_per_mib (the storage-oracle multiplier is not
applied).
deposit ≥ rent: the storage pool00000000 ‖ "ZBCSTORE" ‖ 24 × 0x00is creditedrent(a plain credit) with a ledger row of event 69 on the pool (transaction_id0, the block's timestamp); then the record gets a new version withdeposit −= rentandlast_billed_height = h.- otherwise prune: the remainder, when > 0, is credited to the longevity pool (ledger row event
50,
13); then the record gets a new version withdeposit0,status1 andlast_billed_height = h.
The credit happens before the deposit is cut: a credit the account rules refuse (an overflow) leaves the record as it was, and it is due again at the next block; a failed read of the stored files, and a storage fault in a credit or in the record's write, make the node refuse the block.
How to compute it. Integer arithmetic throughout. The schedule a client is shown: charges fall
at next = max(base + period, tip + 1), then every period blocks; the deposit pays
n = floor(deposit / rent) of them; paid_through_height = next + n × period is the block where
the file is pruned; deposit_remainder = deposit − n × rent.
Rule activation. survival_field (the remainder to the longevity pool): active from height 0 on
every chain.
Rejections and errors. None.
Vector. computed (TestNet genesis parameters). A node of a chain with these parameters
answers GET /api/v1/storage/quote?bytes=42&blocks=172800 (§10) with
{"bytes":42,"cost_per_mib":5000000,"storage_oracle_multiplier_ppm":1000000,"billing_period_blocks":172800,"block_time_seconds":15,"rent_per_period":5000000,"requested_blocks":172800,"periods_covered":1,"deposit":5000000,"min_deposit":1000000}.
- INPUT: the record of §3 after the top-up (stored at h = 1,000,
deposit6,000,000,last_billed_height1,000),total_size42, price 5,000,000, period 172,800. - EXPECTED OUTPUT: rent 5,000,000; schedule at tip 1,005:
next_billing_height173,800,periods_covered1,deposit_remainder1,000,000,paid_through_height346,600. Block 173,800: pool +5,000,000 (event 69), recorddeposit1,000,000,last_billed_height173,800. Block 346,600: 1,000,000 < 5,000,000 → longevity pool +1,000,000 (event 50), recorddeposit0,status1,last_billed_height346,600. - INPUT:
total_size1,048,577. EXPECTED OUTPUT: rent 10,000,000 (two MiB); on DevNet a 42-byte file pays 100,000,000 per 240 blocks.
Test cases · §4
5 cases · 5 valid · 1 reference
The record after the top-up at tip 1,005
Loading the test widget…
A file of 1,048,577 bytes pays two MiB
Loading the test widget…
A 42-byte file on the DevNet
Loading the test widget…
GET /api/v1/storage/quote?bytes=42&blocks=172800 at the TestNet genesis parameters
Loading the test widget…
The two billing blocks of that record
A stated value: there is nothing to compute. A compatible node shows the same value.
- 173800
pool +5,000,000 (event 69), deposit 1,000,000- 346600
longevity pool +1,000,000 (event 50), deposit 0, status 1
Defects to match. (1) A 1-byte file pays the same as a 1 MiB file. (2) A FundStoredFile after
the first charge moves the record's block_height but not its clock; before the first charge the
clock is pinned by the top-up (§3), so the schedule never shifts.
5. Replica placement and epochs
Purpose. Which K nodes should hold a piece in a given epoch; the tally of §7 depends on it.
Inputs. The piece id (32 bytes); the node set = the 32-byte node public key of every
active registry row (09 §1) as of the previous block (rule registry_as_of_prev); the epoch
seed = the hash of the block at height e × EPOCH; K = storage_replication (5 on both chains);
EPOCH = storage_proof_epoch_blocks (TestNet 240, DevNet 10); epoch(h) = h div EPOCH.
Output and effect. weight(node) = SHA3-256(piece_id ‖ node_key ‖ seed); the nodes sorted by
weight descending (byte-wise), ties by node key descending; the first K are the expected
holders (index 0 the primary). Fewer than K nodes → all of them. An empty node set or K = 0 →
none. The order of the input set does not matter. The node-local transport and upkeep of §9 read the
current registry; only the tally of §7 is consensus.
How to compute it. As stated.
Rule activation. registry_as_of_prev: active from height 0 on every chain.
Rejections and errors. None.
Vector. computed over the 11 node keys of the TestNet genesis file (its registry at height
0, 06 §6; first four bytes shown: 715EA8E2, 81E1FFF8, 66A2B2C6, 02A50719, 6CC41B8D,
A7E89B25, 578F1C02, F442F504, 6B9AA5C7, F5692B26, EB89F581).
- INPUT: piece
3A37640C…C12EB280(§1), epoch 51, seed (an example block hash: the hash of block 51 × 240 = 12,240 of a chain) = SHA3-256 of the ASCII textZooBC specification vector: epoch seed=BBB0B1CF94B87B718A2EB3CEEAA01482654C2B7BD3BEEF90E322B1BC95EF0164, K = 5. - EXPECTED OUTPUT: weights (first 8 bytes) and keys in order:
F2C4507BD9BAB79781E1FFF8…,D360A1E6734BB2C1A7E89B25…,B90CE720FEE29086F442F504…,A22DB060D8E35FCF66A2B2C6…,91AD58458D489E16715EA8E2…(the five holders); then7B1F14D616DD643C6CC41B8D…,5E5BAED5D74593E002A50719…,4652420BF305587BEB89F581…,2B3203C0179C1AEB578F1C02…,1C93FEC3258982B76B9AA5C7…,12EB86CA688CB170F5692B26….
Test cases · §5
2 cases · 2 valid
The five holders of the 42-byte file's piece in epoch 51 over the TestNet genesis keys
Loading the test widget…
The input order of the node set does not matter
Loading the test widget…
Defects to match. None.
6. Proof of possession: SubmitStorageProof (41) and SubmitStorageProofBatch (297)
Purpose. A holder's attestation for a piece in an epoch, and a node's whole epoch in one transaction.
Inputs. The proof: nonce = SHA3-256(seed ‖ piece_id ‖ LE64(epoch)) with the epoch seed of
§5; proof = SHA3-256(piece_bytes ‖ nonce).
SubmitStorageProof (41) body, exactly 72 bytes:
| Offset | Length | Field | Encoding |
|---|---|---|---|
| 0 | 32 | piece_id |
|
| 32 | 8 | epoch |
u64 LE |
| 40 | 32 | proof |
SubmitStorageProofBatch (297) body:
| Offset | Length | Field | Encoding |
|---|---|---|---|
| 0 | 8 | epoch |
u64 LE |
| 8 | 2 | count |
u16 LE, 1 … 1,000 |
| 10 | 64 × count | piece_id (32) ‖ proof (32) |
the body ends exactly after the last proof |
Both: the sender is the node's typed node-key account 00000000 ‖ node public key (07 §3.1;
a bare key is refused like any bare sender); the declared fee is exactly 0 (rule
duty_fee_free); envelope recipient empty; category NodeInfra (08 §11). Both are duties: the duty
lane of 04 admits at most one pending batch per node per epoch, one duty per node per block at
assembly, and never evicts it. A batch counts as one transaction toward the block's transaction
ceiling.
Output and effect.
- Type 41. When the sender's node key has a registry row as of this height (any status): the
fee is charged (0 charges nothing) and a
storage_proofrow(piece_id, epoch, prover_address = the sender's typed account, proof, block_height = h)is written, replacing any earlier row of the same(piece_id, epoch, prover_address). Otherwise a paid no-op. - Type 297. When the sender's node key has no registry row as of this height: a paid no-op.
When the sender already has any
storage_proofrow for thisepoch: a paid no-op. Otherwise onestorage_proofrow per proof, in body order, as for type 41. A piece id may be a stored file's piece or an archive chunk's name (§12). - Then
04§5 (nothing to refund at a fee of 0).
How to compute it. Stateless (admission and block validation): type 41 body ≠ 72 bytes →
"SubmitStorageProof body must be exactly 72 bytes". Type 297: envelope recipient not empty →
"SubmitStorageProofBatchTransaction: a batch names its recipients in its body; the envelope recipient must be empty"; body < 8 → "SubmitStorageProofBatch: body too short for the epoch";
< 10 → "SubmitStorageProofBatch: body too short for the action count"; count 0 →
"SubmitStorageProofBatch: a batch carries at least one action"; count > 1,000 →
"SubmitStorageProofBatch: more than 1000 actions"; count × 64 above the bytes left →
"SubmitStorageProofBatch: the body is shorter than its action count"; bytes left ≠ count × 64 →
"SubmitStorageProofBatch: the body must hold exactly its proofs (64 bytes each)"; a piece id
twice → "SubmitStorageProofBatchTransaction: a piece is proved twice in one batch". A fee ≠ 0 →
"Transaction fee must be exactly 0: a node duty declares a fee of exactly zero (this one declares N)". Admission only: a sender that is not 00000000 ‖ k with k the key of a registry row →
"a fee-free duty transaction must be sent by a registry attester account (the node's own key)";
type 297 with an existing proof row of the sender for the epoch →
"SubmitStorageProofBatchTransaction: this node already proved epoch E (one batch per node per epoch)".
The reference node (node-local behaviour): after each epoch's sync it sends one batch per epoch holding a proof for every piece it holds and is an expected holder of this epoch, plus the archive's sampled chunks it holds (§12) — the lowest 1,000 piece ids when it owes more — and re-sends it every two minutes while it is still pending.
Rule activation. duty_fee_free (the zero fee and the attester sender) and state_answer_noop
(the paid no-op of an unregistered prover) are active from height 0 on every chain.
Rejections and errors. As listed: stateless failures refuse admission and make a block invalid; the attester and one-batch-per-epoch checks refuse admission; in a block an unregistered prover or a second batch for an epoch is a paid no-op.
Vector. computed (the file of §1, epoch 51, the seed of §5).
- INPUT: piece
3A37640C3FC158F57CBE24F9F0B2B1E448DDA55DB9738069E6B8A4A3C12EB280, epoch 51, seedBBB0B1CF…95EF0164, the 42 content bytes. - EXPECTED OUTPUT: nonce
D6367CA42CB6C0B2F2AC539B68C88395FCBB4BD137D48F94B9D3F3B2999A6C1E; proof31D27F4FBD19AE322FED31C8D7106DD98E500175FC1550CE5E38219AF94B0D20; type-41 body (72 bytes)3A37640C3FC158F57CBE24F9F0B2B1E448DDA55DB9738069E6B8A4A3C12EB280 3300000000000000 31D27F4FBD19AE322FED31C8D7106DD98E500175FC1550CE5E38219AF94B0D20; type-297 body (74 bytes)3300000000000000 0100 3A37640C…C12EB280 31D27F4F…F94B0D20. Mined from00000000 ‖ 578F1C02344F7744E7844B6A9AC55D693D30A9803820027832E2179C8DA88E62(a genesis registry key of the TestNet file) at fee 0: onestorage_proofrow(3A37640C…, 51, 00000000578F1C02…, 31D27F4F…, h). - INVALID: the batch body with
count0000→"SubmitStorageProofBatch: a batch carries at least one action"; the batch with the same proof listed twice (count0200) →"…: a piece is proved twice in one batch"; either type with fee 1 →"Transaction fee must be exactly 0: a node duty declares a fee of exactly zero (this one declares 1)"; a 71-byte type-41 body →"SubmitStorageProof body must be exactly 72 bytes".
Test cases · §6
9 cases · 4 valid · 5 invalid · 1 reference
The proof of the 42-byte piece in epoch 51
Loading the test widget…
The storage_proof row a mined proof from a genesis registry key writes
A stated value: there is nothing to compute. A compatible node shows the same value.
- piece_id
3a37640c3fc158f57cbe24f9f0b2b1e448dda55db9738069e6b8a4a3c12eb280- epoch
51- prover_address
00000000578f1c02344f7744e7844b6a9ac55d693d30a9803820027832e2179c8da88e62- proof
31d27f4fbd19ae322fed31c8d7106dd98e500175fc1550ce5e38219af94b0d20- block_height
h
The type-41 proof from a node key at fee 0 passes the stateless checks
Loading the test widget…
The batch from a node key at fee 0 passes the stateless checks
Loading the test widget…
A batch of count 0 is refused
Loading the test widget…
A batch proving one piece twice is refused
Loading the test widget…
A type-41 proof with fee 1 is refused
Loading the test widget…
A batch with fee 1 is refused
Loading the test widget…
A 71-byte type-41 body is refused
Loading the test widget…
Defects to match. (1) Neither the piece id nor the epoch is checked against anything: a
registered key can store any (piece, epoch, proof) triple (it is paid only through a confirmed
tally, §7). (2) The execution gate accepts a Queued or Deleted key (any registry row as of the
height); only admission demands a registry row, of any status, too. (3) A proof for an epoch other
than the one closing next is never tallied. (4) A type-41 proof for epoch E makes a later batch of
the same node for E a no-op.
7. The epoch tally
Purpose. Pay the holders whose proofs agree; an implementation must move exactly the same amounts.
Inputs. storage_proof; the parameters storage_proof_epoch_blocks (EPOCH),
storage_replication (K), oracle_quorum (3 in both genesis files), dataset_storage_cost_per_mib
and the period of §4; the active stored files; the storage pool's confirmed balance; the registry
(as of the previous block for placement, the newest rows for the provers); the payout view of 09 §12.
Output and effect. At a block of height h with h ≥ 2 × EPOCH and h mod EPOCH = 0, for the
epoch e = h div EPOCH − 1 that just closed:
- Reward per honest proof, once for the block:
rent_per_epoch = q × EPOCH + (r × EPOCH) div period, whereq, r= quotient and remainder ofΣ rent(file)(§4, over the active files) byperiod;expected = Σ piece_count × Kover the active files;reward = rent_per_epoch div expected, 0 when either is 0. - Pieces: the distinct piece ids with a proof row for
e, ascending, less the chunks of the epoch's archive sample (§12), which the archive step alone tallies and pays. - For each piece: the expected holders of §5 (seed = hash of block
e × EPOCH, node set as of block h − 1); the submissions = its proof rows forewhose prover is00000000 ‖ kwith k the key of a registry row (newest, any status), one per node (proof rows of other provers are ignored; expected or not, every registered submitter counts). - Verdict: the truth = the proof value submitted by the most distinct nodes, only when that
maximum is unique (a tie leaves no truth);
honest= submitters of the truth,faulty= the others,missing= expected holders that submitted nothing;confirmed= a truth exists and|honest| ≥ oracle_quorum. - Not confirmed: nobody is paid and nobody is charged.
- Confirmed: for each honest node in ascending node-key order: skip a node with no registry row
or that does not earn at h (missing, suspended or immature,
09§12);pay = min(reward, the pool's confirmed balance); whenpay > 0and the node's owner is set: the pool is debitedpay, the owner creditedpayas an incoming credit (its split policy applies,08§10), and two ledger rows of event 19 are written (pool −pay, owner +pay;transaction_id0, the block's timestamp). A debit the account rules refuse pays nothing (the next node is tried); a credit they refuse puts the debit back and pays nothing. - Faulty and missing nodes: nothing (no score moves).
A failed read of the seed block, of the registry, of the archive or of the proof rows, a payout view that cannot be read, and a storage fault in a payment make the node refuse the block.
Node-local, beside the verdict (not consensus, never carried by a snapshot): each node records in
its storage audit ledger the missing holders of each (piece, epoch) and each piece's streak of
unconfirmed epochs (reset by a confirmed verdict; a streak of 3 is logged). These records are
deleted above the target of a reorganisation (07 §9, §10) and are read by nothing in consensus.
How to compute it. As stated; 64-bit integer arithmetic.
Rule activation. duty_fee_free (the rent-derived reward), small_n_measurement (step 5),
storage_tally_no_penalty (step 7) and registry_as_of_prev (step 3's placement): active from
height 0 on every chain.
Rejections and errors. None of its own; the faults above refuse the block on that node.
Vector. computed (TestNet: period 172,800, EPOCH 240, K 5, price 5,000,000, quorum 3).
- INPUT: one active file (the 42-byte file of §1, one piece); at block 12,480 the pool holds
100,000,000; for epoch 51 the five expected holders of §5 submitted, three of them the proof
31D27F4F…F94B0D20of §6 and two others00…00; all five earn. - EXPECTED OUTPUT:
Σ rent= 5,000,000 → q = 28, r = 161,600 →rent_per_epoch= 6,720 + 224 = 6,944;expected= 5;reward= 1,388. Truth =31D27F4F…(3 votes, unique), confirmed (3 ≥ 3); the three honest nodes' owners, in ascending key order, get +1,388 each (event 19) and the pool −1,388 three times; the two faulty nodes get nothing. - INPUT: the same with two submitters of
31D27F4F…and two of00…00. EXPECTED OUTPUT: a tie, no truth, not confirmed: nothing moves. - INPUT: one registered node alone submits the right proof. EXPECTED OUTPUT: 1 < 3, not confirmed: nothing moves.
Test cases · §7
4 cases · 4 valid
The reward per honest proof with one active 42-byte file
Loading the test widget…
Three of five holders agree
Loading the test widget…
Two against two: no truth
Loading the test widget…
One node alone: below the quorum
Loading the test widget…
Defects to match. (1) Truth is agreement, not possession: three or more registered keys
submitting the same bytes are paid without holding the piece. (2) A node that copies another's proof
counts as honest; a node whose key left the registry after submitting is dropped. (3) When more
pieces are stored than rent covers, reward rounds down toward 0 and honest holders may be paid
nothing on a confirmed verdict.
8. Access control at fetch (HTTP)
Purpose. What access_mode and the allow list do: they gate the HTTP fetch of a file's
content on a node; nothing else.
Inputs. The routes below; for a signed request the headers X-Node-Public-Key, X-Timestamp,
X-Signature of 31 (the caller proves an Ed25519 key; the caller's account is
00000000 ‖ that key).
Output and effect. Node-local, no consensus effect.
GET /api/v1/storage/files→ 200{"files":[{file_root, owner_address, total_size, piece_size, piece_count, deposit, block_height}, …]}over the active records, private files left out (file_rootandowner_addresslower-case hex; the numbers JSON integers).GET /api/v1/storage/files/<64 hex>→ 200{file_root, owner_address, total_size, piece_size, deposit, status, access_mode, last_billed_height, rent_per_period, billing_period_blocks, next_billing_height, periods_covered, deposit_remainder, paid_through_height, piece_ids:[hex…]}(the schedule of §4; for a pruned record the schedule fields are 0); unknown root → 404{"success":false,"error":"file not found","code":404}.GET /api/v1/storage/files/<64 hex>/content→ 200application/octet-stream, the reassembled bytes (local pieces first, else fetched from the expected holders of the current epoch). Refusals, in this order: unknown root → 404file not found; pruned → 404{"success":false,"anchored":true,"expired":true,"error":"this file's storage rent ran out; it is no longer stored (fund a new StoreFile to store it again)","code":404}; then the guards = the file itself when it is private, plus every other active private file that shares a piece id with it: with any guard, an unsigned or badly signed request → 401this file is private: sign the request with the account that stored it (<why>)(orthis file shares content with a private file: sign the request …when the file itself is public); a signed caller that is neither the owner nor on the allow list of every guard → 403this file is private and that account is not permitted to read it/this file shares content with a private file that account is not permitted to read; a piece no holder serves → 404{"success":false,"anchored":true,"error":"content unavailable - the file is anchored on chain but no holder served its pieces","code":404}.GET /api/v1/accounts/<address>/stored-files→ 200{"address", "chain_height", "includes_private", "files":[{file_root, owner_address, total_size, piece_size, piece_count, deposit, status, access_mode, block_height, last_billed_height, + the schedule fields}], "private_not_listed"}: the account's active files; private ones only on a request signed by the account (or a member of its group), else counted inprivate_not_listed. A bad address → 400bad address; a signature that does not verify → 401signature rejected: <why>; a signing key that is not the account → 403the signing key is not this account or a member of its group.
The P2P calls of §9 serve any stored file's piece to any peer regardless of these rules.
How to compute it. As stated.
Rule activation. storage_acl (the flags exist, §2).
Rejections and errors. As listed.
Vector. computed. On a chain where no file is stored (every chain at genesis):
GET /api/v1/storage/files → {"files":[]};
GET /api/v1/storage/files/A6911274C20C21279E714E13A83AC49382ECD56151AE9D04EC1369B414FC661B
→ HTTP 404 {"success":false,"error":"file not found","code":404}. For the private file of §2, an
unsigned content request → 401; a request signed by the release authority's key (on the allow
list) → 200 with the 42 bytes; signed by any other key → 403.
Test cases · §8
3 cases · 2 valid · 1 invalid · 3 reference
GET /api/v1/storage/files on a chain where no file is stored
A stated value: there is nothing to compute. A compatible node shows the same value.
- value
{"files":[]}
GET /api/v1/storage/files/<the root of §2> on a chain where no file is stored
A stated value: there is nothing to compute. The statement is a refusal: the exact text a compatible node answers.
- refusal
{"success":false,"error":"file not found","code":404}
The content of the private file of §2
A stated value: there is nothing to compute. A compatible node shows the same value.
- unsigned
401- signed_by_release_authority
200 with the 42 bytes- signed_by_another_key
403
Defects to match. The policy is a speed bump by design: the pieces replicate in the clear to the K holders and any peer serves them.
9. Piece transport (P2P) and placement upkeep
Purpose. How piece bytes move and which node keeps what; none of it is consensus, but a node must answer the two calls as below to interoperate.
Inputs. Two P2P calls (27 gives the framing):
GetStoragePiece(GetStoragePieceRequest{piece_id = 1 (bytes, 32), requester_public_key = 2 (bytes, 32, optional), timestamp = 3 (int64 Unix seconds), signature = 4 (bytes, 64)}) → GetStoragePieceResponse{found = 1 (bool), data = 2 (bytes)};PutStoragePiece(PutStoragePieceRequest{piece_id = 1 (bytes, 32), data = 2 (bytes)}) → PutStoragePieceResponse{accepted = 1 (bool)}.
Output and effect.
- Both calls are signed P2P calls (
27§1a): an unsigned call, or one whose signature, digest, receiver, stamp or nonce fails, is refusedUNAUTHENTICATED; a caller whose key holds no handshake-verified entry in this node's peer table is refusedFAILED_PRECONDITION "no handshake for this chain". "Anyone" below means any node that has handshaken with this node on this chain. - Serve: storage off, a
piece_idnot of 32 bytes, or a piece not held (or whose stored bytes no longer hash to the id) →found false. A chunk of an archived snapshot older than the newest three snapshots every node keeps (§12) is served only on a request signed by a registered node: the signed message is"ZBC-PIECE-REQ"(13 ASCII bytes) ‖ genesis hash (32) ‖piece_id(32) ‖LE64(timestamp)‖requester_public_key(32), Ed25519 by that key, withtimestampwithin ±300 s of the holder's clock; otherwise the call fails with statusPERMISSION_DENIEDand the messageold snapshot chunks of the archive are served to registered nodes only (<why>),<why>one ofthe request is not signed,the request's proof is malformed,the request's time is outside the 300-second window,the request's signature does not verify for the key it names,the signing key is not a registered node of this chain. Every other piece is served to anyone. The reference client always signs. - Accept a push only when storage is on,
piece_idis 32 bytes,datais 1 … 1,048,576 bytes, SHA3-256(data) =piece_id, and this node is an expected holder (§5, current registry) of the piece in the current or the previous epoch; elseaccepted false. - Fetch: try the expected holders in weight order, then any other candidates; keep the first reply whose bytes hash to the id.
- Upkeep, once per epoch (keyed on
epoch(tip), seed of §5, previous seed likewise): for every piece of every active stored file, a piece assigned to this node that it lacks is fetched from this epoch's holders, then the previous epoch's, then any node; a held piece not assigned to it is deleted only when it was not a holder in the previous epoch either and has been held at least 3,600 s. Pieces no active stored file references ("unanchored") are deleted once older than 3,600 s, checked every 600 s. - The storage service is on by default (
node.conf[storage] enabled, default true). The epoch pass runs as soon as a peer is connected, else after a quarter of the epoch (15 s to 2 min); archive chunks left at risk are fetched again every minute within the epoch.
How to compute it. As stated.
Rule activation. None.
Rejections and errors. As listed (P2P status and flags only; nothing on chain).
Vector. computed.
- INPUT: a GetStoragePiece for the piece of §1 by the node key
02A50719C01D3B81030D5BB866B25E69F15668DE15160BA51B43CD0C1B352CA2(a genesis registry key of the TestNet file) at timestamp 1,793,711,377, on the chain whose genesis hash is the vectors' chain identityG=E003E4E3…2871of02§1. EXPECTED OUTPUT: the signed message (117 bytes)5A42432D50494543452D524551 E003E4E3557EF19F0519BD345009DEA7FB43B3445EAA043920C5DC23B3302871 3A37640C3FC158F57CBE24F9F0B2B1E448DDA55DB9738069E6B8A4A3C12EB280 11DDE96A00000000 02A50719C01D3B81030D5BB866B25E69F15668DE15160BA51B43CD0C1B352CA2. - INPUT: a PutStoragePiece of the piece of §1 with
data= the 42 bytes but one byte changed. EXPECTED OUTPUT:accepted false(the hash differs).
Test cases · §9
3 cases · 3 valid
The signed message of a GetStoragePiece request
Loading the test widget…
A push of the piece with one byte changed is not accepted
Loading the test widget…
A push of the piece's own bytes hashes to its id
Loading the test widget…
Defects to match. A node can only hold what some peer served; a piece whose holders all leave is lost with no on-chain trace, and its file keeps paying rent until pruned.
10. Upload admission and the quote (HTTP)
Purpose. The node-local route that cuts a file into pieces and seeds them before the StoreFile, and the route that prices a deposit.
Inputs. POST /api/v1/storage/upload with the raw file as the body;
GET /api/v1/storage/quote?bytes=<int>&blocks=<int>.
Output and effect.
- Upload refusals, in this order: storage off → 503
storage not enabled on this node; empty body → 400empty file body; the node's free disk below 2 GiB → 507storage refused: this node is low on disk; the bytes of the node's unanchored pieces plus this upload above 256 MiB → 507storage refused: this node's budget for not-yet-anchored uploads is full; anchor the pending files (StoreFile) or wait for the hourly sweep; the client over 10 uploads per 600 s or 32 MiB per 3,600 s → 429 with aRetry-Afterheader. Otherwise the file is split (§1), each piece kept locally and pushed to its expected holders of the current epoch, and the answer is 200{"file_root","piece_size","total_size","piece_count","seeded_replicas","piece_ids":[…]}(hex in lower case), what a wallet needs to build the StoreFile. - Quote:
bytes(default 0, negative → 0),blocks(default and any value < 1 → the period);mib = max(1, ceil(bytes / 1,048,576));rent_per_period = ceil(ceil(mib × 1,048,576 × price / 1,048,576) × multiplier_ppm / 1,000,000);periods_covered = max(1, ceil(blocks / period));deposit = max(1,000,000, rent_per_period × periods_covered); answer 200 withbytes,cost_per_mib,storage_oracle_multiplier_ppm,billing_period_blocks,block_time_seconds,rent_per_period,requested_blocks,periods_covered,deposit,min_deposit(1,000,000).
How to compute it. As stated. Node-local: the quote applies storage_oracle_multiplier_ppm,
the rent step of §4 does not; they agree while the multiplier is 1,000,000 (both genesis files).
Rule activation. None.
Rejections and errors. As listed.
Vector. computed (TestNet genesis parameters): the quote of §4 (bytes=42&blocks=172800 →
rent_per_period 5,000,000, deposit 5,000,000); bytes=42&blocks=172801 → periods_covered 2,
deposit 10,000,000. INVALID: an upload with an empty body → 400 empty file body.
Test cases · §10
3 cases · 2 valid · 1 invalid · 1 reference
The quote for 42 bytes over one period
Loading the test widget…
The quote for 42 bytes over one block more than a period
Loading the test widget…
An upload with an empty body is refused
A stated value: there is nothing to compute. The statement is a refusal: the exact text a compatible node answers.
- refusal
{"success":false,"error":"empty file body","code":400}
Defects to match. None.
11. Ledger rows and the consensus/local split
| Event | Row | Written by |
|---|---|---|
| 1 | sender −fee | StoreFile, FundStoredFile (the proofs declare 0) |
| 51 | sender −deposit / −amount | StoreFile, FundStoredFile |
| 69 | storage pool +rent | the rent step (§4) |
| 50 | longevity pool +remainder | the prune (§4) |
| 19 | storage pool −pay, owner +pay | the tally (§7) |
| 77 | longevity pool −Σ, each owner +its parts | the archive reward (§12) |
| 22, 47 | per 04 §5 |
the generic settlement |
Consensus: stored_file and storage_proof (07 §1), the archive's oracle_result rows (§12),
the pool and owner balances, the rent, tally and archive arithmetic, and the accept/refuse rules of
§2, §3 and §6. Node-local: the pieces, their placement and transport, the upkeep loop, the archive
keeper, the prover, the signed-request gate of §9, upload admission, the fetch-side access check,
and the storage audit ledger of §7.
12. The snapshot archive
Purpose. The decentralised storage (not every node) keeps every snapshot from block 0, so
anyone can travel the spine to any past snapshot and rebuild state at any height; every node keeps
only its last three snapshots locally (26). Holders are paid out of the longevity pool for proving
the chunks.
Inputs. The resolved oracle results whose event id starts ZBCSNAP1: (oracle_result, 17);
the registry; the parameters EPOCH, K (5), oracle_quorum (3) and snapshot_reward_share_ppm
(100,000 on both chains; held to 0 … 500,000); the longevity pool 00000000 ‖ "ZBCLONGV" ‖ 24 × 0x00.
Output and effect.
- Membership. After building a snapshot of reference height R, each node sends a fee-free
AttestEvent (
17) with event id"ZBCSNAP1:" ‖ decimal(R)and valuehex64(full_file_hash) ‖ ":" ‖ decimal(chunk_count). A result counts only in exactly that shape: R a decimal without sign or leading zero within u32; the hash 64 lower-case hex digits; the colon at offset 64; the count a decimal without leading zero, 1 … 4,194,304 (2²²). The archive as of height h = every such result withresolved_height ≤ h, sorted by R, thenresolved_height, then hash, keeping the first per R. While the survival flag of a block is true (rulesurvival_mode,19,36), AttestEvent belongs to the frozen Bridge category (refused at submit, held in the pool if already admitted, invalid in that block) and the block's oracle resolution step does not run, so no snapshot joins the archive during survival mode; the held attestations enter the first block after it ends and the event resolves then. - Naming. Chunk i of an archived snapshot is named
SHA3-256("ZBC-ARCHIVE-CHUNK" ‖ full_file_hash ‖ LE32(i))— by its place, not its content. - Holders. The rendezvous selection of §5 over the chunk's name with
seed = full_file_hash(fixed per snapshot) and K = 5: a chunk moves only when a holder leaves the registry. - The epoch sample. For storage epoch e, with
start = e × EPOCH: the archive as ofstart; the chunks numbered in (R, index) order;min(64, total chunks)distinct positions drawn by the sample-drawing rule of26from the hash of blockstart. - Proofs. Each sampled chunk's holders (registry as of
start) prove it in their epoch batch (§6) under its name:SHA3-256(chunk bytes ‖ SHA3-256(epoch seed ‖ name ‖ LE64(e))). - Tally and reward, at a block of height h with
h ≥ 2 × EPOCHandh mod EPOCH = 0, fore = h div EPOCH − 1, before the block's lottery (22): the registry as ofe × EPOCH; for each sampled chunk, only the answers (proof rows for e under its name, prover00000000 ‖ k) of its K holders count; the verdict of §7 step 4 over them; when confirmed, each holder that gave the agreed proof is one honest answer, listed in holder order. With at least one honest answer:budget = floor(pool confirmed balance × share_ppm / 1,000,000)(128-bit),part = budget div (number of honest answers); nothing whenpartis 0. Each node's parts are summed; in ascending node-key order, a node that does not earn at h (09§12) or has no owner as of h − 1 keeps nothing (its parts stay in the pool); otherwise the pool is debited the sum and the owner as of h − 1 credited it as an incoming credit (08§10), with a ledger row of event 77 on the owner; a debit the rules refuse stops the payout; a credit they refuse puts the debit back. Finally one pool row of event 77 for−paid. A silent or wrong holder only forgoes its parts; no score moves; the rounding remainder stays in the pool. - Holding and reading (node-local): each node keeps the chunks it holds (copied from its own snapshot first, else fetched from the chunk's other holders, every copy checked against the manifest's chunk hash; a chunk no longer its own is dropped after 3,600 s); old chunks are served only to registered nodes (§9).
How to compute it. As stated.
Rule activation. survival_mode (the freeze of the membership attestations), active from
height 0 on every chain; nothing else is gated.
Rejections and errors. A failed read of the archive, of the sample's seed block or of the registry as of the epoch's start, a payout view that cannot be read, and a failed owner read make the node refuse the block; an empty registry as of the epoch's start skips the tally (nothing is paid).
Vector. computed (the 11 TestNet genesis registry keys of §5).
- INPUT: a snapshot with
full_file_hasha1b1d5d2d9a01903df2a22cc5f2641e6f9b96f02366359bdff98e51e01068dd8and 3 chunks, R = 172,800. - EXPECTED OUTPUT: event id
ZBCSNAP1:172800, valuea1b1d5d2d9a01903df2a22cc5f2641e6f9b96f02366359bdff98e51e01068dd8:3; chunk names and holders: 04BBB430796FC89AB1370133E53291338C530181E835F66E92B266101C6091C25→02A50719,81E1FFF8,6B9AA5C7,F5692B26,A7E89B25; 1FD29EA20992FAB30C1B76255EAC394B311E72AAB5E7A428F956D055445142688→66A2B2C6,6B9AA5C7,F442F504,EB89F581,A7E89B25; 2760957231B347B2694F1F11D2B35913974B5585A7CCA8FAB904DA03033FC1289→EB89F581,F442F504,6B9AA5C7,715EA8E2,A7E89B25. - INPUT: longevity pool 100,000,000,000 (1,000 ZBC), share 100,000 ppm, 12 honest answers from 4 nodes (3 each), one of them immature. EXPECTED OUTPUT: budget 10,000,000,000, part 833,333,333; three owners +2,499,999,999 each (event 77), pool −7,499,999,997 (one event-77 row); the immature node's 2,499,999,999 and the 4 units of rounding stay in the pool.
- INVALID: a value with upper-case hex (
A1B1…:3), a count03, or a count 0 → not an archive entry (the result is ignored).
Test cases · §12
6 cases · 6 valid
A three-chunk snapshot at R = 172,800: names and holders
Loading the test widget…
The attestation of that snapshot is an archive entry
Loading the test widget…
A value in upper-case hex is not an archive entry
Loading the test widget…
A count with a leading zero is not an archive entry
Loading the test widget…
A count of 0 is not an archive entry
Loading the test widget…
1,000 ZBC in the pool, 12 honest answers from 4 nodes, one immature
Loading the test widget…
Defects to match. (1) A snapshot carries the blocks of its window only (its height and the
1,440 blocks below it, 26 §2), so blocks between windows are in no archived snapshot and, once pruned everywhere, cannot be served. (2) A new node at
height 0 computes the holders over the genesis registry; once every genesis registered node has left, its fast
sync has no holder list to ask.
A question about this chapter, or a statement that does not match the network? Discuss on zoobc.pro.