bitcoinjs-lib icon indicating copy to clipboard operation
bitcoinjs-lib copied to clipboard

Add witness option to Transaction toBuffer()

Open benjamin-wilson opened this issue 2 years ago • 2 comments
trafficstars

During construction of a coinbase transaction for mining I have to get the serialized coinbase transaction to send to the miners. The miners do not expect the witness data to be in the header. Currently I resort to using the private __toBuffer() method. coinbaseTransaction.__toBuffer().toString('hex'); It would be nice if the toBuffer() and toHex() methods had an option to exclude the witness data.

benjamin-wilson avatar Jun 27 '23 01:06 benjamin-wilson

@benjamin-wilson @ljluestc Which scenario requires excluding witness data?

jasonandjay avatar Apr 30 '24 10:04 jasonandjay

This is a step in the construction of coinbase transactions for mining

benjamin-wilson avatar Apr 30 '24 11:04 benjamin-wilson