Skip to main content
2 of 2
added 163 characters in body
RedGrittyBrick
  • 28.5k
  • 3
  • 25
  • 53

I always suspected that I had lost the miner's address.

True, you have the BIP-141 witness commitment (an OP_RETURN) but you do not have an output that pays the miner.

Currently it looks to me like you are burning the BTC 50 you assigned to the OP_RETURN vout. I think you should instead assign that value to a second vout that pays the miner through an appropriate locking script (scriptPubKey).

So I guess you want outCount=unhexlify('02') and when you construct coinbase= ... append a second set of +amount2+scriptSize2+script2 before +lockTime

RedGrittyBrick
  • 28.5k
  • 3
  • 25
  • 53