Bitcoin Forum
May 22, 2024, 02:39:19 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Broadcast raw transaction (Bitcoin testnet)  (Read 107 times)
bytcoin (OP)
Member
**
Offline Offline

Activity: 211
Merit: 20

$$$$$$$$$$$$$$$$$$$$$$$$$


View Profile
September 02, 2021, 03:34:30 PM
Last edit: September 02, 2021, 04:08:09 PM by bytcoin
 #1

For about 2 years I like to create raw transactions and test some things on the TESTNET network. After months...Today I decided to create some raw transactions and do some tests as usual. But now my raw transactions are no longer accepted!

Months ago:

Raw transaction:
0100000001b9c222461de38f9fcdc121a47e27c5a08932232b00adc1e2c3fbfb55041b942201000 0006a4730440220503434f27f0d5dc23c01a5d2b2b2abb902e2816987515dafa619ffded8fc2ec6 02204c30c0b82c9afd623e140bf2d6badfa2f02414ef3ffc603e83f2f65a264ce2b801210355d77 643f9bbccde7a1f05d8fa72c0b6c53075cdc299753242320ef9c6611233ffffffff01905f010000 0000001976a914b95bfe11c932408ae44da26872b3c8cd5d61691a88ac00000000



Raw transaction:
0100000001d96c0ed0e9dda1efef19a51b68bb54cad4f384c3a943c17b77c3b77e3352711a00000 0006b483045022100dcf17de661e280dbf62e03ef1655d1baaabc301da9fc6b29a63e52e7780c11 5d022059bbf685149a0975b6305d14fa7823a9a96aa00ccf1799eb1b4336e04bb4010f01210355d 77643f9bbccde7a1f05d8fa72c0b6c53075cdc299753242320ef9c6611233ffffffff0188130000 000000001976a914b95bfe11c932408ae44da26872b3c8cd5d61691a88ac00000000

Today I've tried to send 5 transactions, but all are giving an error! I'm doing as I always did

This was my last attempt:

Raw:
0100000001dfee7c0aa6cb1cf8f4c9ac9339d9b6078d792a106267f93802ac75b52a6ad0de00000 0006a47304402203e408f62cf85e326dc4066636c306b85ce0b94dd94c001fbfd35da58979def3f 022075255c85e927340d4777963357cb03482566e29f93cc9f590398dfb3a89cbb970121028ce82 9db535d42389defbf9ba58731f56ddb1cc7a189e5e30a85d63eb225b5d2ffffffff018813000000 0000001976a91496a07833918317f2e0e23eea585970831da66f8988ac00000000


Did I unlearn or are things different now?
BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1526
Merit: 7401


Farewell, Leo


View Profile
September 02, 2021, 06:02:17 PM
 #2

These are invalid transactions. In the last one, you use an input from this transaction to create one output of 0.05 BTC to this address while the inputs are 0.01224182 BTC summed.

Did you use a wallet software to sign this or did it by hand?

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
bytcoin (OP)
Member
**
Offline Offline

Activity: 211
Merit: 20

$$$$$$$$$$$$$$$$$$$$$$$$$


View Profile
September 02, 2021, 08:49:27 PM
Last edit: September 02, 2021, 09:14:18 PM by bytcoin
 #3

These are invalid transactions. In the last one, you use an input from this transaction to create one output of 0.05 BTC to this address while the inputs are 0.01224182 BTC summed.

Did you use a wallet software to sign this or did it by hand?

I calculated manually and offline. Including those two who worked months ago.

I received tBTC 0.0001 and am trying to send tBTC 0.00005 to muFPtSuYmYpaqdrNFtwNfm5j2fK2WMtRoz
pooya87
Legendary
*
Offline Offline

Activity: 3458
Merit: 10572



View Profile
September 03, 2021, 03:07:25 AM
Merited by mocacinno (1)
 #4

These are invalid transactions. In the last one, you use an input from this transaction to create one output of 0.05 BTC to this address while the inputs are 0.01224182 BTC summed.
You messed up some decimals there.
The last transaction has one input with the amount = 0.00010000BTC and there is one output with the amount = 0.00005000BTC.

The problem with this tx is not its amount but its invalid signature, which is either because OP's signing function is buggy or OP's calculation of the sighash for signing.
I'm betting it's the latter so here is what sighash should be in case OP wants to double check: c8d3c14a3b190b6ea53ce4317fdd51ca1cf1a235dffbc3ce566507061f901a5a

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1526
Merit: 7401


Farewell, Leo


View Profile
September 03, 2021, 07:33:07 AM
Last edit: September 03, 2021, 08:00:31 AM by BlackHatCoiner
 #5

The last transaction has one input with the amount = 0.00010000BTC and there is one output with the amount = 0.00005000BTC.
Weird. I imported the transaction in Electrum and it showed me a 0.05 output, but it may meant 0.05 mBTC. It indeed is a 0.00005 BTC output now that I decoded it with Bitcoin Core.



Hey @pooya87, how did you check that the signature actually verifies, or in this case, doesn't verify? We have the message which is probably the transaction:
Code:
0100000001dfee7c0aa6cb1cf8f4c9ac9339d9b6078d792a106267f93802ac75b52a6ad0de000000006a47304402203e408f62cf85e326dc4066636c306b85ce0b94dd94c001fbfd35da58979def3f022075255c85e927340d4777963357cb03482566e29f93cc9f590398dfb3a89cbb970121028ce829db535d42389defbf9ba58731f56ddb1cc7a189e5e30a85d63eb225b5d2ffffffff0188130000000000001976a91496a07833918317f2e0e23eea585970831da66f8988ac00000000

By decoding the scriptSig, we get both public key:
Code:
028ce829db535d42389defbf9ba58731f56ddb1cc7a189e5e30a85d63eb225b5d2

And the signature in hexadecimal:
Code:
304402203e408f62cf85e326dc4066636c306b85ce0b94dd94c001fbfd35da58979def3f022075255c85e927340d4777963357cb03482566e29f93cc9f590398dfb3a89cbb9701

It's just that I'm not used to verify that way and I was wondering if there's an internal function of Bitcoin Core that does it for me.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
pooya87
Legendary
*
Offline Offline

Activity: 3458
Merit: 10572



View Profile
September 03, 2021, 09:07:16 AM
 #6

Hey @pooya87, how did you check that the signature actually verifies, or in this case, doesn't verify?
I ran the transaction with its UTXO through a verifier and it failed on OP_CheckSig with the reason being invalid ECDSA signature. Everything else (scripts up to OP_CheckSig, amounts, tx size/weight) is fined though.

Quote
It's just that I'm not used to verify that way and I was wondering if there's an internal function of Bitcoin Core that does it for me.
Probably, but I used my own code.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
bytcoin (OP)
Member
**
Offline Offline

Activity: 211
Merit: 20

$$$$$$$$$$$$$$$$$$$$$$$$$


View Profile
September 03, 2021, 04:04:47 PM
Merited by BlackHatCoiner (1)
 #7

IT IS RESOLVED!

I would like to thank users @BlackHatCoiner and @pooya87 for trying to help me and being helpful

Yesterday when I was doing the transactions... I was doing several things at the same time and I didn't pay attention and used the RIPEMD-160 from my uncompressed address. Today with more attention... I used the RIPEMD-160 from my compressed address and worked perfectly!

https://tbtc.bitaps.com/0faeffb396eebecdade89ef0f66aa002893c3dcb2787283f2d2e6a38edd1da1c

Roll Eyes Roll Eyes Roll Eyes
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!