Bitcoin Forum
June 20, 2024, 08:00:22 AM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: In need of TxID and WTxID of BIP143 transactions for UnitTesting  (Read 198 times)
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
August 06, 2018, 05:22:04 AM
Merited by ABCbits (1)
 #1

There are a bunch of transactions in BIP143 [1] which are good for testing since it is broken down into parts and has the signing process included. But it lacks transaction IDs. Now I have only 1 function that doesn't have any unit tests. Also looked at Bitcoin Core's test data [2] but it doesn't seem to have all the transaction IDs.

Is there a way to get both Transaction IDs and Witness Transaction IDs for the serialized signed transaction listed in [1]?

[1] https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki
[2] https://github.com/bitcoin/bitcoin/tree/master/src/test/data

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3430
Merit: 6720


Just writing some code


View Profile WWW
August 07, 2018, 06:29:31 AM
Merited by gmaxwell (1), ABCbits (1)
 #2

Yes. The TXID is the nversion, txin, txout, and nlocktime fields. The wtxid is everything. Just concatenate everything together from the part where each field is broken down. The lengths are still there so you can just stick them all together.

Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
August 07, 2018, 03:49:45 PM
 #3

Yes. The TXID is the nversion, txin, txout, and nlocktime fields. The wtxid is everything. Just concatenate everything together from the part where each field is broken down. The lengths are still there so you can just stick them all together.

I think you misunderstood my question!
I already know how they is calculated. I am making a library and I just want data (the two hashes) to feed my Unit Tests.
For example the TxID of the first transaction in [1] above is:
Code:
e8151a2af31c368a35053ddd4bdb285a8595c769a3ad83e0fa02314a602d4609

I ended up using Electrum to get the transaction IDs. But I still don't have WTxIDs and I don't know how to get them. For instance is there any command in Bitcoin Core that I can use to get it?

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
amaclin1
Sr. Member
****
Offline Offline

Activity: 784
Merit: 305


View Profile
August 07, 2018, 04:46:38 PM
Merited by ABCbits (1), Coding Enthusiast (1)
 #4

For example the TxID of the first transaction in [1] above is:
Code:
e8151a2af31c368a35053ddd4bdb285a8595c769a3ad83e0fa02314a602d4609

I ended up using Electrum to get the transaction IDs. But I still don't have WTxIDs and I don't know how to get them. For instance is there any command in Bitcoin Core that I can use to get it?


Bitcoin SV GUI client for Windows and Linux
https://github.com/AlisterMaclin/bitcoin-sv/releases
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!