Skip to content

verify: Document GPG environment variable in help synopsis - #78

Open
Mahajan-Sachin wants to merge 1 commit into
bitcoin-core:mainfrom
Mahajan-Sachin:fix-verify-key-import-and-docs
Open

Mahajan-Sachin wants to merge 1 commit into
bitcoin-core:mainfrom
Mahajan-Sachin:fix-verify-key-import-and-docs

Conversation

@Mahajan-Sachin

@Mahajan-Sachin Mahajan-Sachin commented Oct 20, 2026 •

Copy link
Copy Markdown

Document the GPG environment variable in the usage synopsis and environment variables list of asmap-verify so users know the GPG binary path can be overridden.

@hodlinator

Copy link
Copy Markdown
Contributor

One could argue that keys should be trusted by everyone once committed to the main branch, but I'm not sure we want to add automatic importing. Feels safer to keep it a conscious action performed by the user. Keeping it that way might also catch invalid keys that the user expected to work.

Curious to hear what other people think.


Thanks for adding GPG to the help text!

@Mahajan-Sachin

Copy link
Copy Markdown
Author

Thanks for the review and the thoughtful point, @hodlinator!

That makes total sense from a security and key-management perspective — avoiding implicit modifications to the user's local GPG keyring is a very valid concern.

If we prefer not to auto-import by default, here are two alternative approaches we could take:

  1. Helpful hint on failure: If verification fails because the public key isn't found in the keyring, check if builder-keys/<signer>.gpg exists and print a clear suggestion to the user (e.g., Key not found in keyring. You can import it with: gpg --import builder-keys/<signer>.gpg).
  2. Opt-in flag: Only auto-import if an explicit flag or environment variable is passed (e.g., --import-keys or AUTO_IMPORT_KEYS=1).

Happy to update the PR based on what you and others think is the cleanest approach!

@hodlinator

Copy link
Copy Markdown
Contributor
  1. Helpful hint on failure: If verification fails because the public key isn't found in the keyring, check if builder-keys/<signer>.gpg exists and print a clear suggestion to the user (e.g., Key not found in keyring. You can import it with: gpg --import builder-keys/<signer>.gpg).

Isn't this what we do on the main branch already?

@Mahajan-Sachin

Copy link
Copy Markdown
Author

Ah, you're completely right! I double-checked main and see that the hint is indeed already in place.

Since keeping key imports explicit is preferred and the hint is already handling the UX, I'm happy to simplify this PR to just document the GPG environment variable in the usage synopsis so users know it can be overridden.

Let me know if you'd like me to update the branch accordingly!

@hodlinator

Copy link
Copy Markdown
Contributor

Since keeping key imports explicit is preferred and the hint is already handling the UX, I'm happy to simplify this PR to just document the GPG environment variable in the usage synopsis so users know it can be overridden.

Sounds good to me. 👍

@Mahajan-Sachin
Mahajan-Sachin force-pushed the fix-verify-key-import-and-docs branch from 32349f1 to b12896e Compare October 22, 2026 17:41
@Mahajan-Sachin Mahajan-Sachin changed the title verify: Auto-import builder keys before verification verify: Document GPG environment variable in help synopsis Oct 22, 2026
@Mahajan-Sachin

Copy link
Copy Markdown
Author

@hodlinator Updated! The PR has been simplified to solely document the GPG environment variable in the usage synopsis.

@hodlinator hodlinator left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK b12896e

Comment thread asmap-verify

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the PR description to match the current state.

@Mahajan-Sachin

Copy link
Copy Markdown
Author

@hodlinator Done! Updated the PR description. Thanks for the review and ACK!

This branch has not been deployed

No deployments
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.

2 participants