Skip to content

Support NIP-49 encrypted private key (ncryptsec) - #45

Merged
mattn merged 1 commit into
mainfrom
feat/nip49
Nov 18, 2026
Merged

mattn merged 1 commit into
mainfrom
feat/nip49

Conversation

@mattn

@mattn mattn commented Nov 16, 2026

Copy link
Copy Markdown
Owner
  • privatekey may be an ncryptsec. The password is read from the terminal (/dev/tty, so --stdin still works) or $ALGIA_PASSWORD, only when the key is actually needed
  • The public key is cached in ncryptsec-pubkey[-<profile>].json (0600, keyed by the ncryptsec's sha256), so read-only commands don't prompt
  • New algia key encrypt [--logn N] prints the ncryptsec for the profile's nsec

Verified with nak serve: key encrypt, post with password, profile without password (cache), wrong password, no-tty error.

privatekey may now be an ncryptsec. The password is read from the
terminal (or $ALGIA_PASSWORD) only when a command needs the key; the
public key is cached so read-only commands don't ask for it.

Add "algia key encrypt" to convert the profile's nsec.
@mattn
mattn merged commit c02ef7f into main Nov 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant