Refuse the generator-point pool_pubkey placeholder at mint startup #35
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
vnprc/hashpool#35
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refuse the placeholder
pool_pubkeyat mint startup, so shipping prod config unedited fails loudly instead of naming real epochs after a well-known constant.Primary goals:
Current state and specifics
config/prod/mint.config.tomlships apool_pubkeyplaceholder which is the secp256k1 generator point. Because that is a structurally valid compressed pubkey,naming::validate_pool_pubkeyaccepts it, and the mint proceeds to namespace every epoch unit with it: units becomehash_0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798_<height>, and each gets a keyset derived under that identity.This is not hypothetical. A dev-stack run produced exactly those unit names, so the placeholder path is the one that actually executes when nobody edits the config. The failure is silent: nothing in the logs distinguishes "the operator set a real pool key" from "the operator shipped the example file", and the mistake is baked into the currency unit identifiers and keyset identities, which are the things ecash is denominated in. Discovering it later means the units already issued carry a meaningless pool identity.
The generator point is a good placeholder precisely because it is recognisable, so rejecting that one value costs nothing and catches the whole class.
Scope
In scope: reject the generator point as a
pool_pubkeyduring the existing startup validation, with a message naming the config key and the file. Consider whether the prod config should instead ship no value at all, so the mint fails on a missing key rather than a sentinel one, and say which you chose.Out of scope: broader
pool_pubkeyvalidation, which already rejects malformed and uncompressed keys.Validation
Start the mint against the unedited
config/prod/mint.config.tomland confirm it refuses to start, namingpool_pubkey. Start it with a different valid compressed pubkey and confirm it starts and names epoch units with that key. Confirm the dev config path is unaffected.