blockchain – Fix btc transaction’s bad data structure

[ad_1]

i have problem with my raw bitcoin transaction data structure, and after committing it i get error, some on internet said it’s because of bad implementation of priv key and pub key and some others said it’s because of bad data structure, so i’m checking my data structure with stackoverflow community if it was good to go, i’ll figure out the problem with my signing implementation on my own.

this is the transaction i made and put 10000 satoshi in address bc1qqs5lcmj58lmmfd6ap34xqqfuzfvz02nxjayrjx and i want to send 2500 to my self and 2500 back to the address it came from.

this is the data structure before signing the tx:

01000000
01
14fe532eec4ddc9bfd8686a7234300c24a47c60e437ae26e966a43e47f947def
00000000
16
00140429fc6e543ff7b4b75d0c6a60013c125827aa66
ffffffff

02
c409000000000000
1976a9140429fc6e543ff7b4b75d0c6a60013c125827aa6688ac

c409000000000000
1976a9145951ac8720b1865ba633d19eaa6473afae7c46b388ac
00000000
01000000

and this is the data structure after signing it:

01000000
01
14fe532eec4ddc9bfd8686a7234300c24a47c60e437ae26e966a43e47f947def
00000000
6b48304402206b6fde1ca4cac9873f5f2c08edcdf65b621d4c5f49bf187bcd457e2bccbd4dfd02202002f6f82c98979a79efd54234691fdbda684bd33395d810a077effebb0e910f6f01210280a1bfa268074c9171ed0e30f332706789c5138e1428e92506e671b1997eb874
ffffffff

02c409000000000000
1976a9140429fc6e543ff7b4b75d0c6a60013c125827aa6688ac
c409000000000000
1976a9145951ac8720b1865ba633d19eaa6473afae7c46b388ac
00000000

i get error : “Code: -26, Error: non-mandatory-script-verify-flag (Witness requires empty scriptSig)”

i did research on the error but the anwsers did not help.

[ad_2]

Source link

Leave a Comment