Extract a mining tag from a Kaspa coinbase payload
A mining pool may append identifying bytes to its coinbase payload. Their offset depends on the payout script length.
Read the declared script length
Decode the hex payload into bytes. Require at least nineteen bytes before reading its fixed prefix. If byte 18 is 34, the extra data begins at byte 53 using zero-based offsets. Reject a buffer shorter than that boundary and retain the raw suffix even when a text decoder cannot display it.
offset 0..8 blue score (little endian)
offset 8..16 subsidy (little endian)
offset 16..18 script version
byte 18 script length n
byte 19+n start of extra data
Interpret labels as self-reported
A recognizable pool name is only a byte string chosen by the miner. Preserve the block hash and payout script when grouping observations, and keep unrecognized bytes in a separate bucket. A copied tag cannot authenticate the operator that produced the block.