Skip to content

Coinbase transaction parser#1391

Merged
WantClue merged 20 commits intobitaxeorg:masterfrom
mutatrum:coinbase-tx-parser
Feb 3, 2026
Merged

Coinbase transaction parser#1391
WantClue merged 20 commits intobitaxeorg:masterfrom
mutatrum:coinbase-tx-parser

Conversation

@mutatrum
Copy link
Collaborator

@mutatrum mutatrum commented Nov 25, 2025

This PR adds parsing of the coinbase transaction outputs. Needs testing on as many pools as possible.

It incorporates segwit_address.c from pwuille and base58.c from luke-jr. These are a big part of all the new code (558 lines). They are copied without any changes.

One limitation is that the network (mainnet/testnet/signet) is not known, so if you mine on testnet/signet, the addresses are shown as mainnet. Suggestions welcome here.

The are shown on the dashboard, if the address matches the address part of the pool user, it's printed bold with a star:
image

It also works with the sensitive-data flag:
image

If the payout is above 95%, it shows the pool fee, otherwise it will show the share percentage and a warning banner

Example log from solo ckpool (address masked, first output is the same as my pool address:

I (16952) stratum_task: Coinbase outputs: 3, total value: 315205815 sat
I (16962) stratum_task:   Output 0: 312253878 sat -> bc1q**************************************  (Your payout address)
I (16971) stratum_task:   Output 1: 6372528 sat -> bc1q**************************************
I (16980) stratum_task:   Output 2: 0 sat -> OP_RETURN: .!.._..Vv0......d...rqz..S..6.*D..k{

For the dashboard, the address abbreviation has changed to split the address in 4 segments, removing middle segments until it falls below a certain length. This was done after review by the bitcoin design community, which you can read the thread in the Bitcoin Design Discord at https://discord.com/channels/903125802726596648/1443584935305678878.

We came to this mechanism because that's also usable on the display and yields the best results for verification for all address types:
image

@github-actions
Copy link

github-actions bot commented Nov 25, 2025

Test Results

41 tests  +18   41 ✅ +18   0s ⏱️ ±0s
 1 suites ± 0    0 💤 ± 0 
 1 files   ± 0    0 ❌ ± 0 

Results for commit a4bd0a9. ± Comparison against base commit f843079.

♻️ This comment has been updated with latest results.

@WantClue WantClue added the enhancement New feature or request label Nov 26, 2025
@WantClue WantClue self-requested a review November 26, 2025 19:35
@0xf0xx0
Copy link
Contributor

0xf0xx0 commented Nov 27, 2025

idea for the network detection, why not use the active pools mining address? assuming the user is actually configured correctly, their address will reveal which network the pool is on.

@WantClue
Copy link
Collaborator

@mutatrum please resolve conflicts

@shufps
Copy link
Contributor

shufps commented Nov 29, 2025

love that! I was thinking about adding some solo-mining verification that checks if all coins go to the own address - like I had on the piaxe python code but it seems you are almost finished 🙌

@mutatrum
Copy link
Collaborator Author

love that! I was thinking about adding some solo-mining verification that checks if all coins go to the own address - like I had on the piaxe python code but it seems you are almost finished 🙌

Need to think how to show this on the front-end. Especially with pools like OCEAN that can have dozens of payout addresses.

@shufps
Copy link
Contributor

shufps commented Dec 1, 2025

love that! I was thinking about adding some solo-mining verification that checks if all coins go to the own address - like I had on the piaxe python code but it seems you are almost finished 🙌

Need to think how to show this on the front-end. Especially with pools like OCEAN that can have dozens of payout addresses.

IMHO a real verficiation would need a % field that allows a certain value to not be sent to the own address because ckpool is solo mining with 2% fee.

A more easy approach that would work without any settings (besides a "solo verification" checkbox) would be to check if the address is amongst the payout addresses and maybe just accept it on >95% or so.

A little bit of a safety net, to prevent the biggest scams.

edit: hmm ... or a checkbox on the stratum settings with just "Solo Pool" and enable a slight check automatically. This could be tuned later but just to make sure it's not complete scam.

I would like that 🥰

IMHO this is important because every solo pool could steal some hashrate by just letting it mine on its own address now and then and nobody would ever notice

@WantClue WantClue added this to the 2.13.0 milestone Dec 2, 2025
@WantClue
Copy link
Collaborator

please resolve conflicts

@mutatrum
Copy link
Collaborator Author

please resolve conflicts

Resolved. Only thing I can't get to work is the sensitive-data attribute on the payout address.

@duckaxe
Copy link
Collaborator

duckaxe commented Dec 12, 2025

Please add demo data to system.service.ts

@mutatrum
Copy link
Collaborator Author

mutatrum commented Dec 15, 2025

Tested on Ocean:

image

There is a limit of 100 coinbase tx outputs. There have been blocks with more than 100, even close to 1000, but that's not recent.

Edit: I've reduced the number of decoded tx outputs to 6. This should cover most solo pools. If there are more outputs, they are still checked if it's the user's address, but they are not sent to the front-end.

@mutatrum
Copy link
Collaborator Author

Also fixes #1446

@mutatrum mutatrum linked an issue Dec 16, 2025 that may be closed by this pull request
@WantClue
Copy link
Collaborator

will be reviewed today

@mutatrum
Copy link
Collaborator Author

mutatrum commented Jan 29, 2026

will be reviewed today

Looking forward to it. Take note of this:

It incorporates segwit_address.c from pwuille and base58.c from luke-jr. These are a big part of all the new code (558 lines). They are copied without any changes.

That'll save you some reviewing. I think that code is batlle-tested.

@WantClue WantClue merged commit b122e6a into bitaxeorg:master Feb 3, 2026
3 checks passed
@mutatrum mutatrum deleted the coinbase-tx-parser branch February 3, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tooltip interferes with sensitive-data

6 participants