Module solution

Source
Expand description

Representation and validation of Equi-X puzzle solutions

Equi-X uses its own tweaked version of the Equihash algorithm. Solutions are arrays of SolutionItems, each representing one item in a space of hash outputs. The SolutionItems form a binary tree with constraints on the sorting order of the items and on the sums of their corresponding hashes.

Structs§

Solution
Potential solution to an EquiX puzzle

Constants§

EQUIHASH_K 🔒
Equihash K parameter for Equi-X, the number of tree layers
EQUIHASH_N 🔒
Equihash N parameter for Equi-X, number of bits used from the hash output

Functions§

branches_are_sorted 🔒
Ordering predicate for each node of the SolutionItem tree
check_all_tree_sums 🔒
Check all tree sums, using the full size defined by EQUIHASH_N.
check_tree_order 🔒
Check tree ordering recursively.
check_tree_sums 🔒
Check hash sums recursively.
item_hash 🔒
Compute a HashValue from a SolutionItem
sort_into_tree_order 🔒
Sort a solution in-place into tree order.

Type Aliases§

HashValue 🔒
One hash value, computed from a SolutionItem
SolutionArray
A bundle of solutions as returned by one invocation of the solver
SolutionByteArray
A byte array of the right length to convert to/from a Solution
SolutionItem
One item in the solution
SolutionItemArray
A raw Item array which may or may not be a well-formed Solution