Skip to content

Commit

Permalink
witness commitment fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Sudarshan-21 committed Apr 30, 2024
1 parent 5dcb9e0 commit 2c382e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def wit_serialize_transaction(transactions):
wtxid_data = little_endian_bytes(version, 4) + tx_data
wtxid_hash = hashlib.sha256(hashlib.sha256(wtxid_data).digest()).digest()
if 'witness' in input:
wtxid_array.append(wtxid_hash[::-1].hex())
wtxid_array.append(wtxid_hash.hex())

return wtxid_array, wtxid_data.hex(), wtxid_hash.hex(), wtxid_hash[::-1].hex()

Expand Down
6 changes: 3 additions & 3 deletions output.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
000000040000000000000000000000000000000000000000000000000000000000000000b480c675e369e9865e56acd4fb8543731e1f93f6406c6f5625e7cc785ac2e5a4ba593166ffff001f81e50000
020000000001010000000000000000000000000000000000000000000000000000000000000000010000000d03951a0610076c0000946e0100000000000200000000000000001976a914acd783f632ad040fc72d9a06ec17ffb2d8a97a5d88ac0000000000000000266a24aa21a9ed835b9049b8ee7f97fd9fd28a7ef7a8da2f0dc97c85e6e744195ea1393c975a310120000000000000000000000000000000000000000000000000000000000000000000000000
046ec29c0da35f516b30fd16ffa314ed5f5676018e3623e3aaec37eb80edb2d8
000000040000000000000000000000000000000000000000000000000000000000000000da9177ed967e3faf47ae8e3d133c9b438630455f15b146c5b8625bb73dfe03e0be5c3166ffff001fd4950000
020000000001010000000000000000000000000000000000000000000000000000000000000000010000000d03951a0610076c0000946e0100000000000200000000000000001976a914acd783f632ad040fc72d9a06ec17ffb2d8a97a5d88ac0000000000000000266a24aa21a9ed24dda05b5ca4ba3762668db006a325c2b942d2242b4736268cb7eb01063c4aab0120000000000000000000000000000000000000000000000000000000000000000000000000
cb50811736b5ac98bdf0916a3f0684fb8f198c19f5ed3eed17a504d6876cdb05
25ce6b8d39d02471c43a804569a72015e81f3400170c1b8f5418e6938cd60b74
34845a0f5eca756d7768ee2f03186ec4d73d86f9ebeaaf96abddf8bb733641b6
93bba324688af65b727f0c9c08f0fb45e2a2389b269939b1414f4818b071c598
Expand Down

0 comments on commit 2c382e5

Please sign in to comment.