Account addresses in the XRP Ledger are base58
encoded public-key representations.
The public-key is a valid point on the curve, sometimes inside a specific subgroup of the curve (when the curve isn't prime order).
XRP supports both edwards25519
and secp256k1
curves.
You reach the public point (which is deterministic but not predictable), by scalar multiplication of the curves generator (or subgroups generator) with a cryptographically secure random number which is approximately of the order 2^256
.
So to answer your question... in a tight loop you need to:
- Generate a cryptographically secure random number between
0
and 2^256
.
- Execute scalar multiplication of this random number by the appropriate group generator.
- Take the resultant raw curve point and follow the XRP spec (including
base58
encoding), to reach the address value.
- Inspect the generated address for desired vanity properties.
- If target is reached, break and securely store the scalar.
Eventually you will find a specific address which matches your requirement. More than a few characters will take a long time, predicated of course on your hardware.