There are several tools in Contractless for manually validating blocks, headers, and torrent files. Some of these tools are fully automated, while others provide more hands-on, granular control.
Block + Torrent Validation: validate_torrent_and_block_headers
The validate_torrent_and_block_headers
tool performs a full validation pass over a torrent file and its matching block file. It checks the following:
- Timestamp in torrent matches block
- Nonce in torrent matches block
- Miner wallet in torrent matches block
- Block difficulty is less than the target difficulty
- VRF number in torrent matches block
- File size in torrent matches the actual block size
- Block header hash matches the value in the torrent
- VRF in block validates against proof
- Proof of VRF is accurate
- Each torrent piece matches the correct bytes in the block
- Final block hash matches torrent’s listed block hash

Viewing File Contents: unpack_torrent
and unpack_block_header
If you prefer to inspect data manually, you can use:
unpack_torrent
: Converts a binary .torrent
file to readable JSON
unpack_block_header
: Converts a block header into readable JSON
unpack_torrent

This shows all metadata stored inside the torrent file, including hashes, file lengths, piece sizes, and more.
unpack_block_header

Key outputs to compare:
- Difficulty of the block (compare with target in
.torrent
)
- Hash of the header (should match hash listed in
.torrent
)
Custom Hashing: skein_hasher
The skein_hasher
tool allows custom hashing using Skein-256. It includes several modes:
Supported Modes
text
– Hashes raw input text
file
– Hashes the contents of a file
bytes
– Hashes a specific byte range in a file
Each mode supports two output sizes:
large
– Standard Skein-256 (256-bit)
small
– Custom Skein-128 (128-bit, explained below)
How Small Hash Mode Works
The small
mode is a custom method used to reduce hash size in Contractless torrent files.
The input is hashed using Skein-256. That 256-bit hash is converted to a lowercase hex string.
The UTF-8 bytes of that hex string are hashed again using Skein-256.
Finally, every other byte from the result is taken to produce a 128-bit (16-byte) output.
This 128-bit hash is used as the info_hash
in the torrent file and can be verified using skein_hasher
.

Verifying File Chunks: bytes
Mode
You can use the bytes
mode of skein_hasher
to hash individual chunks of a block file — typically to verify individual pieces listed in the .torrent
file.
Options
Just like file
mode, bytes
mode supports both small
and large
.
Contractless torrent files only use small
.
Byte Ranges
Bytes mode requires the bytes
feature to be enabled. It takes a start
and stop
byte to define the range being hashed.
Important for non-programmers:
The start byte is zero-based, and the stop byte is exclusive — meaning it is one past the last byte you want.
Examples:
start: 0
, stop: 100
→ bytes 0–99 (100 bytes total)
start: 100
, stop: 200
→ bytes 100–199
Common mistake:
Many users assume start at byte 1 and stop at 100 covers the first 100 bytes — but it only gives 99 bytes (bytes 1–99), and skips the first byte (byte 0).

When validating the last piece, make sure to calculate offsets properly using the length
and piece_length
fields of the torrent file.
Summary
With these tools, Contractless offers complete transparency and verifiability of block data:
- Use
validate_torrent_and_block_headers
for all-in-one checking
- Use
unpack_*
tools for deep inspection
- Use
skein_hasher
with small
mode to reproduce hashes found in torrent metadata
- Use
bytes
mode to verify individual pieces or partial ranges of a file
These tools give users full visibility and manual control over the integrity of data across the Contractless ecosystem.