Adapting for Other Cryptocurrencies
Relevant source files
The following files were used as context for generating this wiki page:
The qib13 system is explicitly designed as a "mnemonic-like tool for qubic" that "can be adopted to other coins." Its core architecture is a deterministic process for transforming a short, memorable "generator code" into a longer, more complex "seed." This process is not fundamentally tied to any specific cryptocurrency's seed format.
Adaptation for other cryptocurrencies or use cases involves modifying the core parameters of the encoding and decoding process. The system's reliance on a master seed and a cryptographically secure pseudo-random number generator (CSPRNG) ensures that any new configuration remains reproducible and deterministic. The primary changes required are adjustments to string lengths, character sets, and the dimensions of the underlying mathematical structures (matrices).
Sources: README.md:2, index.html:189-216
Core Architectural Components for Adaptation
The system's adaptability stems from its modular components, which are generated deterministically from a master seed. To adapt the system, these components must be re-generated with new parameters.
Sources: README.md:16-23, index.html:603-633
Key Parameters
The following table outlines the key parameters in the qib13 implementation that would need to be modified to support different output formats.
| Parameter | Current Value | File Reference | Description of Change Needed |
|---|---|---|---|
| Generator Code Length | 13 | index.html:120, 520 | The length of the input mnemonic. This value is used as the column count for the generator matrices. |
| Seed Length | 55 | index.html:142, 552 | The length of the final output seed. This value determines the size of the permutation array and the total length of the codeword (message + parity). |
| Character Set / Modulo Base | a-z / 26 | index.html:582-599 | The character set for encoding/decoding. The modulo arithmetic (% 26) and character mapping functions (lettersToNumbers, numbersToLetters) must be updated for different character sets (e.g., BIP39 wordlist, Base58). |
| Original System Parity Length | 42 | index.html:613 | The number of parity characters in the "Original" system. Must satisfy Generator Code Length + Parity Length = Seed Length. |
| Deviation System Parity Lengths | 15, 27 | index.html:624-625 | The number of parity characters for the "Deviation" systems. The sum must equal the total parity length. For qib13, 15 + 27 = 42. |
System Generation Flow
The process of generating encoding systems is the central point for adaptation. The generateSystems function orchestrates the creation of both "Original" and "Deviation" systems based on the master seed. Any adaptation would require modifying the parameters passed into the system creation functions.
This diagram shows the flow for generating systems, highlighting the configurable parameters.
This flow demonstrates how the master seed provides the entropy, while the configurable parameters define the structure of the resulting encoding systems.
Sources: index.html:51-92, 603-633
Modifying the Encoding Systems
The EncodingSystem class contains the logic for both generating a seed and recovering the generator code. The core of this logic relies on matrix dimensions and permutation sizes that are currently fixed.
Sources: index.html:499-601
Matrix and Permutation Generation
The functions createOriginalSystem and createDeviationSystem use the seeded RNG to construct the matrices and permutations. The hardcoded dimensions are the primary targets for modification.
Original System Creation:
// index.html:611-619
function createOriginalSystem(id, seed) {
const rng = new CryptoSeedenRandom(seed + "-original-" + id);
const matrixP = generateRandomMatrix(42, 13, rng); // 42 rows (parity), 13 cols (generator)
const permutation = generateRandomPermutation(55, rng); // For 55-char seed
const inversePermutation = generateInversePermutation(permutation);
return new EncodingSystem(/* ... */);
}
Deviation System Creation:
// index.html:622-630
function createDeviationSystem(id, seed) {
const rng = new CryptoSeededRandom(seed);
const matrixP1 = generateRandomMatrix(15, 13, rng); // 15 rows (parity part 1)
const matrixP2 = generateRandomMatrix(27, 13, rng); // 27 rows (parity part 2)
const permutation = generateRandomPermutation(55, rng); // For 55-char seed
const inversePermutation = generateInversePermutation(permutation);
return new EncodingSystem(/* ... */);
}
To adapt this, the numeric literals (42, 13, 15, 27, 55) must be replaced with variables derived from the desired new cryptocurrency seed format.
Sources: index.html:611-630
Encoding and Decoding Process
The sequence diagram below illustrates the encoding process. Adapting this process requires ensuring the vector and matrix operations are compatible with the new, parameterized dimensions.
This diagram shows that each step of the encoding process is dependent on the lengths of the generator code and the final seed. The decoding process follows these steps in reverse, using an inverse permutation and verifying the parity checks.
Sources: index.html:518-540, 582-601
Conclusion
The qib13 project provides a flexible and robust framework that can be adapted for various cryptocurrency seed formats or other mnemonic-based systems. The key to adaptation lies in parameterizing the hardcoded values for generator code length, seed length, character set, and parity check dimensions within the index.html file. The system's deterministic nature, powered by a seeded HMAC-SHA256 RNG, ensures that any new configuration will be just as reproducible as the original implementation for Qubic. The README.md file's statement on adaptability is well-supported by the modular and mathematically-defined structure of the code.
Sources: README.md:2, index.html