A fast, interactive IPFS/IPNS Peer ID vanity generator in Rust
Forge the Peer ID You Want
- Ed25519 key generation (fully compatible with IPFS/Libp2p; significantly faster than RSA).
- Multi-threaded generation with zero locks on the hot path; disk I/O only on matches.
- Flexible matching: substring, prefix, and suffix; optional case-insensitive mode.
- Highlight matched segment in logs for quick visual confirmation.
- Interactive mode to guide parameter input with sensible defaults.
- Export directly to a go-ipfs compatible keystore filename for
ipfs name publish.
cargo install --git https://github.com/LeUKi/kooforge
# Interactive mode: step through mode/threads/export etc.
kooforge
# Prefix match (stop after first hit)
kooforge 12 --mode prefix --limit 1
# Substring match (default case-insensitive, 8 threads)
kooforge KoOw --mode any --threads 8
# Export as go-ipfs keystore (filename: dupa)
kooforge dupa --mode any --limit 1 --export-ipfs --key-name dupa
cp keystore/dupa ~/.ipfs/keystore/dupa
ipfs name publish --key=dupa {ipfs-path}
pattern: Base58 substring to match (optional in interactive mode).--mode [any|prefix|suffix]: matching mode; defaultany.--threads N: number of threads; defaults to CPU logical cores.--limit N: stop after N matches; default 10; set0for unlimited.--out DIR: output directory; defaultkeystore.--case-insensitive: case-insensitive matching (default on).--case-sensitive: force case-sensitive matching (overrides above).--print-only: print PeerId only; do not write the private key.--stats-interval SECS: stats print interval in seconds;0disables.--export-ipfs: also write a go-ipfs compatible keystore file using--key-name.--key-name NAME: filename for the keystore export.--no-color: disable match highlighting.--interactive: interactive parameter prompts.
- On match, writes the private key to
./keystore/named by thePeerId; encoded using libp2p protobuf. - With
--export-ipfs --key-name NAME, additionally writes./keystore/NAME, ready to copy to~/.ipfs/keystore/NAME. - Logs print the matched
PeerIdwith ANSI highlighting (disable via--no-color).
- Use Ed25519 for best throughput and full IPFS/Libp2p compatibility.
- Build with
--releaseand enable native CPU optimizations:-C target-cpu=native. - Avoid regex and excessive allocations on the hot path; only send/write on matches.
- Prefix/suffix matches tend to hit faster than arbitrary substrings.
- Private keys are never logged; writes use atomic file moves and
0600permissions on Unix. - Store keystore files securely and restrict access to prevent leakage.
- "Koo" nods to the common
12D3KooPeer ID prefix in the IPFS/Libp2p ecosystem. - "Forge" highlights the act of crafting IDs that match your desired pattern.
- Short, memorable, and directly tied to the tool’s purpose.
- Inspired by tooling and best practices in the IPFS/IPNS ecosystem.