What is the main purpose of the code.
How does it store the X points exactly ?
Fast points generation of a full range.
You can see how the affine X coordinate is saved in db.c - what is unclear? The X bytes get stored into an index (little-endian bytes), and the key offset (from 0) as an integer value. This is what you wanted, no? If you want it saved another way, just adapt the code, and support the inevitable slowdowns.