mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Signed-off-by: Tyler Longwell <tlongwell@block.xyz> Co-authored-by: npub1qyvc0c5kl4gqv2fd97fsk46tu378sqgy35vc83rvgfwne90sel7s0ed67d <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Max <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Mari <95cae996907d7cab9f5dbf43c0f53edeac6ab0b032a6feae4abfd784e467b3f5@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Quinn <96f056ad5f2305c8ddf637dc65d048aa4c12d7daeb8867690e34fca46b0ef64c@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Sami <f4a42a97e594b77bdbd8ee35191c8b28a94a4cb871d96f32921558275421fb68@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Perci <5a968df9a7494b4e019b9ecf739e088ba61097b4312124e9a88ae5b42e3f5f3e@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Tyler Longwell <tlongwell@block.xyz>
git-sign-nostr
NIP-GS signing program — signs git commits and tags with Nostr secp256k1 keys using BIP-340 Schnorr signatures.
Usage
# Configure git to use nostr signing
git config gpg.format x509
git config gpg.x509.program /path/to/git-sign-nostr
git config commit.gpgsign true
git config tag.gpgsign true
git config user.signingkey <hex-pubkey>
# Set the private key (env var)
export NOSTR_PRIVATE_KEY=<hex-or-nsec>
# Optional: NIP-OA owner attestation
export BUZZ_AUTH_TAG='["auth","<owner-pk>","<conditions>","<owner-sig>"]'
# Commits are now automatically signed
git commit -m "signed with nostr"
# Verify
git verify-commit HEAD
Key Loading Priority
NOSTR_PRIVATE_KEYenvironment variableBUZZ_PRIVATE_KEYenvironment variable- Keyfile at path from
git config nostr.keyfile
Keys may be hex (64 chars) or NIP-19 bech32 (nsec1...).
How It Works
Git invokes this program as a signing/verification backend:
- Sign:
git-sign-nostr --status-fd=2 -bsau <keyid>— reads payload from stdin, writes armored signature to stdout, status lines to fd 2 (stderr) - Verify:
git-sign-nostr --status-fd=1 --verify <sigfile> -— reads payload from stdin, verifies signature from file, status lines to fd 1 (stdout)
See NIP-GS for the full specification.