Files
dat-thang/extra/sleep_writer_pass
divorce b735900f2e 0.0.002
ddat interop with dat js
cable interop with cabal js
ddat's frontend = dat-thang
cable fe = cable-thang
dillo support based on cel's dillo-dat
bootstrap node
xplatform support

Signed-off-by: divo <418@cryspace.space>
2026-10-19 00:17:02 -04:00
..
2026-10-19 00:17:02 -04:00
2026-10-19 00:17:02 -04:00
2026-10-19 00:17:02 -04:00

SLEEP writer pass

Files:
  inc/sleep_writer.h
  src/sleep_writer.c
  src/sleep_tree.c

Important change from the previous writer draft:
  SLEEP/Dat root sets for a feed of N blocks use fullRoots(2*N), not fullRoots(2*(N-1)).
  Thus N=83 produces roots 63, 143, 161, 164, matching the historical fixture's signatures.

The writer emits one signature for every feed length, 1..N.

The bitfield writer follows the documented 3328-byte SLEEP V2 layout. The historical fixture supplied with the project has a 3584-byte bitfield entry; the extra 256 bytes remain deliberately unresolved rather than guessed.

The code requires SLEEP_SALT/libsodium for cryptographic operation.