From b0ac68ad4b94fd0423f29cde9a646ad9a7ec427e Mon Sep 17 00:00:00 2001 From: Sudarshan-21 Date: Wed, 1 May 2024 05:55:12 +0530 Subject: [PATCH] witness commitment issue fix --- main.py | 6 +++--- output.txt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index ff1163ef..0a36ce41 100644 --- a/main.py +++ b/main.py @@ -275,7 +275,7 @@ def wit_serialize_transaction(transactions): tx_data += little_endian_bytes(locktime, 4) wtxid_hash = hashlib.sha256(hashlib.sha256(tx_data).digest()).digest() - wtxid_array.append(wtxid_hash[::-1].hex()) + wtxid_array.append(wtxid_hash.hex()) return wtxid_array, tx_data.hex(), wtxid_hash.hex(), wtxid_hash[::-1].hex() @@ -308,7 +308,7 @@ def serialize_coinbase(transactions): # Append txid, prev_tx_out_index, scriptsig tx_data += ( txid + - little_endian_bytes(prev_tx_out_index, 4) + + prev_tx_out_index + varint_encode(len(scriptsig)) + scriptsig + little_endian_bytes(sequence, 4) @@ -372,7 +372,7 @@ def create_coinbase(wTXID_commit, block_Height): "vin": [ { "txid": "0000000000000000000000000000000000000000000000000000000000000000", - "vout": 1, + "vout": "ffffffff", "prevout": { "scriptpubkey": "001481897cd2113b1b0bf0e718cc791d9bd2d246c555", "scriptpubkey_asm": "OP_0 OP_PUSHBYTES_20 81897cd2113b1b0bf0e718cc791d9bd2d246c555", diff --git a/output.txt b/output.txt index 5472e1fb..8b6a0506 100644 --- a/output.txt +++ b/output.txt @@ -1,6 +1,6 @@ -0000000400000000000000000000000000000000000000000000000000000000000000008c051b53b1757da1a8a95187859407be04628aa5bb8af20e960f92bef142b7741c873166ffff001f0ba60300 -020000000001010000000000000000000000000000000000000000000000000000000000000000010000000d03951a0610076c0000946e010000000000020000000000000000266a24aa21a9ed1ef5192773bb609ffbddfcb41c128963d584af8e9cc2fab9f1c756cf3724e74a00000000000000001976a914acd783f632ad040fc72d9a06ec17ffb2d8a97a5d88ac0120000000000000000000000000000000000000000000000000000000000000000000000000 -331a3ba420228f74a3f2a456bfffb7f0ac6ecd394c43df733e5b1ade235298a0 +000000040000000000000000000000000000000000000000000000000000000000000000bc7dde09b014584f1a2ba5560208114166aa61093226403f2226f0da4d20efcdca8a3166ffff001f70200400 +020000000001010000000000000000000000000000000000000000000000000000000000000000010000000d03951a0610076c0000946e010000000000020000000000000000266a24aa21a9edf6580126b35b7a224becbbcd11a23f72f4b9edfb68383bc268a42f972cd57b6d00000000000000001976a914acd783f632ad040fc72d9a06ec17ffb2d8a97a5d88ac0120000000000000000000000000000000000000000000000000000000000000000000000000 +c4e91e60870c1ffa9c29b1153683ac928f4cb30e73e44bbc33e4b016ee858e9d 25ce6b8d39d02471c43a804569a72015e81f3400170c1b8f5418e6938cd60b74 34845a0f5eca756d7768ee2f03186ec4d73d86f9ebeaaf96abddf8bb733641b6 93bba324688af65b727f0c9c08f0fb45e2a2389b269939b1414f4818b071c598