Skip to main content

Module solver

Module solver 

Source
Expand description

Find Equi-X solutions.

This is a particular instance of Equihash, a tree-structured search for partial hash collisions using temporary memory. Equi-X modifies it to use sums instead of XOR, and chooses specific parameters.

Structsยง

OverlayFirst ๐Ÿ”’
First memory overlay, contains the key portion of Layer0
OverlaySecond ๐Ÿ”’
Second overlay, with both parts of Layer2
SolverMemory
Temporary memory used by the Equi-X solver
SolverMemoryInner ๐Ÿ”’
Internal solver memory, inside the heap allocation

Functionsยง

find_solutions ๐Ÿ”’
Search for solutions, iterating the entire SolutionItem space and using temporary memory to locate partial sum collisions at each tree layer.

Type Aliasesยง

Layer0 ๐Ÿ”’
First layer hash table, needs room for the full set of HashValues and SolutionItems. Key remainder is (EQUIHASH_N - 8 == 52) bits here.
Layer0Collision ๐Ÿ”’
Packed collision type for Layer0
Layer0KeyMem ๐Ÿ”’
Key backing storage for Layer0
Layer0ValueMem ๐Ÿ”’
Value backing storage for Layer0
Layer1 ๐Ÿ”’
Next layer maps residual hash (3/4 full width == 45 bits) to packed Layer0Collision. Key remainder is 37 bits after this.
Layer2 ๐Ÿ”’
Final layer maps the (N/2 == 30 bits) residual hash sum to packed Layer1Collision. Key remainder is 22 bits.
Layer1Collision ๐Ÿ”’
Packed collision type for Layer1
Layer1KeyMem ๐Ÿ”’
Key backing storage for Layer1
Layer1ValueMem ๐Ÿ”’
Value backing storage for Layer1
Layer2KeyMem ๐Ÿ”’
Key backing storage for Layer2
Layer2ValueMem ๐Ÿ”’
Value backing storage for Layer2
TempMem ๐Ÿ”’
Temporary value hash for resolving collisions between buckets. This removes 7 bits of key between each of the other layers. Value type may hold a SolutionItem or a temporary item-in-bucket index.

Unionsยง

Overlay ๐Ÿ”’
Union of overlay layouts used in solver memory