New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
ipns address #10
ipns address #10
Conversation
|
||
- [`ed25519-keygen/ssh`](#sshseed-username) for SSH key generation | ||
- [`ed25519-keygen/pgp`](#pgpseed-user-password) for [RFC 4880](https://datatracker.ietf.org/doc/html/rfc4880) + [RFC 6637](https://datatracker.ietf.org/doc/html/rfc6637) | ||
- [`ed25519-keygen/tor`](#torseed) for TOR onion addresses | ||
- [`ed25519-keygen/ipns`](#ipnsseed) for IPNS addresses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IPNS (ed25519/libp2p-key)
src/ipns.ts
Outdated
//b58/ old format, not recommended | ||
//base58: `${base58.encode(pubKeyBytes)}`, | ||
//b36/ subdomain safe,recommended, ??scure/base36? | ||
//base36: `k${base36.encode(pubKeyBytes).toLowerCase()}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
base36: k51qzi5uqu5dgnfwbc46une4upw1vc9hxznymyeykmg6rev1513yrnbyrwmmql
You can implement base36 by yourself. It should be straightforward, maybe 10 lines of code. Check out source code of scure-base for base32 implementation. It makes it really easy. |
That base36 implementation doesn't seem right. See this: https://github.com/paulmillr/scure-base/blob/b266c73dde977b1dd7ef40ef7a23cc15aab526b3/index.ts#L283 |
I tried
// throw new Error('radix2: bits should be in (0..32]'); |
it's not radix2 -- it's radix for padding maybe no padding |
* natspec + minor re-factoring * linted + formatted * formatted with prettier * sync and stash * compact comments & code * reinstate ?question * remove extra at top * Use scure-base for base36 * Forgot to format --------- Co-authored-by: 0xc0de4c0ffee <43116881+0xc0de4c0ffee@users.noreply.github.com>
For future we'll try to explore multi-sig keys and full IPNS records signing features. +I've learn more from scure-base as we need max optimized base-x encoder/decoder in Solidity contracts for our deeper ENS+IPFS integration. Our current base36 decoder function is ticking ~350k gas *(view only) without overflowing. |
Err, sorry.. |
Update IPNS example
thanks @0xc0de4c0ffee |
resolves #9
I've some questions commented out on codes for review 馃檹