feat(schema): add pool_basis to say how a pool was identified - #7
Merged
Merged
Conversation
pool was defined as the pool identified from the coinbase tag, but 474294 carries 1Hash from contemporary reports and records being prepared attribute by payout address. pool_basis takes one of tag, reported or address, is required whenever pool is present and rejected otherwise, and is descriptive like parent_kind. The 28 existing pool attributions are backfilled: 27 tag (each name verified in its coinbase scriptSig) and 474294 reported.
This was referenced Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The schema defined
poolas the pool "identified from the coinbase tag", but the dataset already holds one attribution that is not a tag: 474294 carries1Hashon the strength of contemporary reports, while its coinbase tag is/NYA/. Records being prepared need two more kinds of attribution. 363731 and 363967 pay addresses that bitcoin-data/mining-pools lists for BTC Nuggets and Bitsolo, with no tag in either coinbase, and 477115 and the three 2013 mmpool blocks are known only from reports of the time.Rather than stretch what
poolmeans, this change adds an optional context field,pool_basis, with exactly one of three values.tagmeans the pool name appears as a tag in the coinbase scriptSig.addressmeans the coinbase payout address is listed for the pool in mining-pools.reportedmeans only a contemporaneous report names the pool. The validator requirespool_basiswheneverpoolis present, rejects it whenpoolis absent, and rejects any other value. Likeparent_kind, the field is descriptive: CI checks the value, not the attribution, which stays a review question.All 28 existing records with a
poolare backfilled. Twenty-seven becometag; each of those pool names was checked to appear byte-for-byte in the record'scoinbase_scriptsig_hex. 474294 becomesreported. Nothing else in those records changes.Testing
python -m unittest discover -s ci -p 'test_*.py'passes all 32 tests. The three new cases (poolwithoutpool_basis,pool_basiswithoutpool, unknown value) sit in the existing malformed-fields table, so no test function was added; the backfilled records exercise the valid values through the dataset check. Offlinepython ci/sanity-check.pyreports 47 blocks, 47 contexts, 190 observations and 6 block files, unchanged.git diff -U0 data/invalid-blocks.jsonltouches 28 lines, and each differs from its original only by the inserted"pool_basis"entry directly after"pool"; the compact one-record-per-line JSONL formatting is preserved.