ed25519-keygen
Advanced tools
Comparing version 0.4.1 to 0.4.8
{ | ||
"name": "ed25519-keygen", | ||
"version": "0.4.1", | ||
"version": "0.4.8", | ||
"description": "Generate ed25519 keys for SSH, PGP (GPG), TOR and SLIP-0010 hdkey", | ||
@@ -9,31 +9,35 @@ "type": "module", | ||
"files": [ | ||
"src/index.ts", | ||
"index.js", | ||
"index.d.ts", | ||
"index.d.ts.map", | ||
"src/hdkey.ts", | ||
"ipns.js", | ||
"ipns.d.ts", | ||
"ipns.d.ts.map", | ||
"hdkey.js", | ||
"hdkey.d.ts", | ||
"hdkey.d.ts.map", | ||
"src/pgp.ts", | ||
"pgp.js", | ||
"pgp.d.ts", | ||
"pgp.d.ts.map", | ||
"src/ssh.ts", | ||
"ssh.js", | ||
"ssh.d.ts", | ||
"ssh.d.ts.map", | ||
"src/tor.ts", | ||
"tor.js", | ||
"tor.d.ts", | ||
"tor.d.ts.map", | ||
"src/utils.ts", | ||
"utils.js", | ||
"utils.d.ts", | ||
"utils.d.ts.map" | ||
"utils.d.ts.map", | ||
"src/index.ts", | ||
"src/ipns.ts", | ||
"src/hdkey.ts", | ||
"src/pgp.ts", | ||
"src/ssh.ts", | ||
"src/tor.ts", | ||
"src/utils.ts" | ||
], | ||
"dependencies": { | ||
"@noble/curves": "~0.8.3", | ||
"@noble/hashes": "~1.3.0", | ||
"@scure/base": "~1.1.0", | ||
"@noble/curves": "~1.2.0", | ||
"@noble/hashes": "~1.3.2", | ||
"@scure/base": "~1.1.2", | ||
"micro-packed": "^0.3.2" | ||
@@ -51,2 +55,6 @@ }, | ||
}, | ||
"./ipns": { | ||
"types": "./ipns.d.ts", | ||
"default": "./ipns.js" | ||
}, | ||
"./hdkey": { | ||
@@ -73,8 +81,2 @@ "types": "./hdkey.d.ts", | ||
}, | ||
"scripts": { | ||
"build": "tsc", | ||
"lint": "prettier --check src", | ||
"format": "prettier --write 'src/**/*.{js,ts}' 'test/*.js'", | ||
"test": "node test/index.js" | ||
}, | ||
"author": "Paul Miller (https://paulmillr.com)", | ||
@@ -105,3 +107,9 @@ "license": "MIT", | ||
} | ||
] | ||
} | ||
], | ||
"scripts": { | ||
"build": "tsc", | ||
"lint": "prettier --check src", | ||
"format": "prettier --write 'src/**/*.{js,ts}' 'test/*.js'", | ||
"test": "node test/index.js" | ||
} | ||
} |
# ed25519-keygen | ||
Generate ed25519 keys for SSH, PGP (GPG), TOR and SLIP-0010 hdkey. | ||
Generate ed25519 keys for SSH, PGP (GPG), TOR, IPNS and SLIP-0010 hdkey. | ||
Generation is deterministic and done in pure javascript, without CLI tools. Uses audited [@noble/ed25519](https://github.com/paulmillr/noble-ed25519) under the hood. | ||
Generation is deterministic and done in pure javascript, without CLI tools. | ||
Uses [noble-curves](https://github.com/paulmillr/noble-curves) under the hood. | ||
Includes SLIP-0010 / BIP32 HDKey implementation, | ||
sponsored by the Kin Foundation for [Kinetic](https://github.com/kin-labs/kinetic). | ||
Includes SLIP-0010 / BIP32 HDKey implementation, sponsored by the Kin Foundation for [Kinetic](https://github.com/kin-labs/kinetic). | ||
For the apps made with the library, check out: | ||
For the apps made with the library, check out: [terminal7 WebRTC terminal multiplexer](https://github.com/tuzig/terminal7). | ||
- [terminal7 WebRTC terminal multiplexer](https://github.com/tuzig/terminal7) | ||
@@ -15,3 +18,3 @@ ## Usage | ||
The package exports five modules: | ||
The package exports six modules: | ||
@@ -21,2 +24,3 @@ - [`ed25519-keygen/ssh`](#sshseed-username) for SSH key generation | ||
- [`ed25519-keygen/tor`](#torseed) for TOR onion addresses | ||
- [`ed25519-keygen/ipns`](#ipnsseed) for IPNS addresses | ||
- [`ed25519-keygen/hdkey`](#hdkey) for [SLIP-0010](https://github.com/satoshilabs/slips/blob/master/slip-0010.md)/[BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) HDKey | ||
@@ -152,3 +156,30 @@ - [`ed25519-keygen/utils`](#randombyteslength) for cryptographically secure random number generator (CSPRNG) | ||
``` | ||
## `ipns(seed)` | ||
Generates IPNS addresses. | ||
- `seed: Uint8Array` | ||
- Returns `{ privateKey: string, publicKey: string, base36: string, base32: string, base16: string, contenthash: string}` | ||
```js | ||
import ipns from 'ed25519-keygen/ipns'; | ||
import { randomBytes } from 'ed25519-keygen/utils'; | ||
const iseed = randomBytes(32); | ||
const ikeys = await ipns(iseed); | ||
console.log(ikeys.privateKey); | ||
console.log(ikeys.publicKey); | ||
console.log(ikeys.base16); | ||
console.log(ikeys.base32); | ||
console.log(ikeys.base36); | ||
console.log(ikeys.contenthash); | ||
/* | ||
0x080112400681d6420abb1ba47acd5c03c8e5ee84185a2673576b262e234e50c46d86f59712c8299ec2c51dffbbcb4f9fccadcee1424cb237e9b30d3cd72d47c18103689d | ||
0x017200240801122012c8299ec2c51dffbbcb4f9fccadcee1424cb237e9b30d3cd72d47c18103689d | ||
ipns://f017200240801122012c8299ec2c51dffbbcb4f9fccadcee1424cb237e9b30d3cd72d47c18103689d | ||
ipns://bafzaajaiaejcaewifgpmfri57654wt47zsw45ykcjszdp2ntbu6nolkhygaqg2e5 | ||
ipns://k51qzi5uqu5dgnfwbc46une4upw1vc9hxznymyeykmg6rev1513yrnbyrwmmql | ||
0xe501017200240801122012c8299ec2c51dffbbcb4f9fccadcee1424cb237e9b30d3cd72d47c18103689d | ||
*/ | ||
``` | ||
## hdkey | ||
@@ -155,0 +186,0 @@ |
90172
31
2038
240
+ Added@noble/curves@1.2.0(transitive)
+ Added@noble/hashes@1.3.2(transitive)
- Removed@noble/curves@0.8.3(transitive)
- Removed@noble/hashes@1.3.0(transitive)
Updated@noble/curves@~1.2.0
Updated@noble/hashes@~1.3.2
Updated@scure/base@~1.1.2