Skip to content

Instantly share code, notes, and snippets.

@vinarmani
vinarmani / gist:0d57c91ff638b7526e991eaf7fb45974
Last active December 29, 2023 13:19
Generate Ethereum and Bitcoin addresses using the number 1 as a private key
import * as secp from '@noble/secp256k1'
import ripemd160 from 'ripemd160-js/ripemd160.mjs'
import * as sha3 from 'js-sha3'
import { createHash } from 'node:crypto'
import { binary_to_base58 } from 'base58-js'
// Generate public key for private key of number 1 (or any number between 1 and ~10^77)
const privateKey = Buffer.alloc(32)
privateKey.writeUInt8(0x1, 31)