/** * Nostr utilities * Convert between G1 keys and Nostr bech32 format (npub/nsec) * * Nostr uses Ed25519 keys encoded in bech32 format: * - npub: public key (shareable) * - nsec: private key (secret, never share) * * Since G1/GTest also uses Ed25519, the same mnemonic can be used * for both G1 and Nostr identities. */ /** * Convert a public key to Nostr npub format * @param publicKey - Ed25519 public key (32 bytes) * @returns Nostr public key in bech32 format (npub1...) * @example * ```ts * const npub = pubkeyToNpub(keyPair.publicKey) * // → 'npub1abc123...' * ``` */ export declare function pubkeyToNpub(publicKey: Uint8Array): string; /** * Convert a mini-secret to Nostr nsec format * WARNING: Never share your nsec! It's your private key. * @param miniSecret - Ed25519 mini-secret/seed (32 bytes) * @returns Nostr private key in bech32 format (nsec1...) * @example * ```ts * const nsec = miniSecretToNsec(miniSecret) * // → 'nsec1xyz789...' * ``` */ export declare function miniSecretToNsec(miniSecret: Uint8Array): string; /** * Convert a Nostr npub to public key * @param npub - Nostr public key in bech32 format (npub1...) * @returns Ed25519 public key (32 bytes) * @example * ```ts * const publicKey = npubToPubkey('npub1abc123...') * ``` */ export declare function npubToPubkey(npub: string): Uint8Array; /** * Convert a Nostr nsec to mini-secret * @param nsec - Nostr private key in bech32 format (nsec1...) * @returns Ed25519 mini-secret/seed (32 bytes) * @example * ```ts * const miniSecret = nsecToMiniSecret('nsec1xyz789...') * ``` */ export declare function nsecToMiniSecret(nsec: string): Uint8Array; /** * Convert a mnemonic to Nostr nsec * Use the same mnemonic as your G1 wallet to get a Nostr identity. * WARNING: Never share your nsec! * @param mnemonic - BIP39 mnemonic phrase * @returns Nostr private key in bech32 format (nsec1...) * @example * ```ts * const nsec = mnemonicToNsec('bottom drive obey lake...') * // → 'nsec1...' * ``` */ export declare function mnemonicToNsec(mnemonic: string): string; /** * Convert a mnemonic to Nostr npub * @param mnemonic - BIP39 mnemonic phrase * @param derivation - Optional derivation path (e.g., '//0') * @returns Nostr public key in bech32 format (npub1...) * @example * ```ts * const npub = mnemonicToNpub('bottom drive obey lake...') * // → 'npub1...' * ``` */ export declare function mnemonicToNpub(mnemonic: string, derivation?: string): string; /** * Get both Nostr identifiers from a mnemonic * @param mnemonic - BIP39 mnemonic phrase * @param derivation - Optional derivation path * @returns Object with npub and nsec * @example * ```ts * const { npub, nsec } = mnemonicToNostr('bottom drive obey lake...') * // npub is safe to share, nsec is SECRET * ``` */ export declare function mnemonicToNostr(mnemonic: string, derivation?: string): { npub: string; nsec: string; };