Bitcoin Forum
June 18, 2024, 05:38:45 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Bitcoin Technical Support / Re: Unable to find the correct transaction hash on: November 23, 2018, 08:55:19 AM
it was cool!
thank you very much!
2  Bitcoin / Bitcoin Technical Support / Re: Unable to find the correct transaction hash on: November 21, 2018, 11:41:08 AM
you did not quite understand my question
This transaction has 237 bytes. (along with SegWit data)
double sha256 does not give the same result as on the blockchain.info.
But what needs to be done in such a transaction instead of double sha256 ?

Thanks.

PS
your link, unfortunately, there is no described algorithm how to get a hash
3  Bitcoin / Bitcoin Technical Support / Unable to find the correct transaction hash on: November 20, 2018, 10:42:58 AM

In the first (coinbase) transaction is 237 bytes.

010000000001010000000000000000000000000000000000000000000000000000000000000000f fffffff4503b5c207fabe6d6de2bf72f174e206a0b32192a50518322f7c58fd1cc2c2f5ebc60a5c a93e7a12450100000000000000626508006c639309c00100bb91182f736c7573682f00000000028 180fb50000000001976a9147c154ed1dc59609e3d26abb2df2ea3d587cd8c4188ac000000000000 0000266a24aa21a9ed470198ecd62086bfb66b96ccf86004de9e00899b00de495fff200cbb17ba5 5c00120000000000000000000000000000000000000000000000000000000000000000000000000

I take sha256 twice from them and get value = 1435ca9c4fd25c012aaff0ed9a608383b5a65ff736ca718a3aec24a55b8d86c1

But in https://www.blockchain.com/en/btc/tx/bb41771ef3f799cff5d97c25846e5a2dffffe1ca7538176fda3b5a7dbede5b2e

i see other value = bb41771ef3f799cff5d97c25846e5a2dffffe1ca7538176fda3b5a7dbede5b2e


At the same time, for all other transactions of this block, hashes are calculated correctly.

What could be the error in my calculation of the hash of this first transaction?
4  Bitcoin / Bitcoin Technical Support / Re: How to parse Address in transaction with SegWit script on: November 19, 2018, 08:29:07 PM

yeaaah!!

Thank You!
5  Bitcoin / Bitcoin Technical Support / Re: How to parse Address in transaction with SegWit script on: November 16, 2018, 08:59:31 AM
I don't think that witness is used to generate the address, since older wallets shouldn't be able to download witness data, but would still be able to send to segwit addresses.

Also, you need to look at the output of the transaction that was referenced in that first input, I believe, since coins aren't spent from addresses, but from unspent transactions. Addresses are there just for humans.


And there is no other (direct) possibility to make an address?

I cannot turn this script
ScriptSig: PUSHDATA(34) [ 002071191892b7ed5764d72cc7232cf99d722b776240d78eb625c389d7f4d03db874 ]

into the address 32mgo47LcUQjPfjYNzAYEsM5fqosiqpuVd   without searching for the previous out-transaction?

6  Bitcoin / Bitcoin Technical Support / How to parse Address in transaction with SegWit script on: November 15, 2018, 01:22:56 PM

Hi all

I have a some problem with understanding how get address from trabsaction with SegWit script

For example Tx= https://www.blockchain.com/en/btc/tx/72ca3ce16f3eaf008bb8961cb448b2b47bfd4041cec09f90415d70adfda3b142

First Input =

ScriptSig: PUSHDATA(34)[002071191892b7ed5764d72cc7232cf99d722b776240d78eb625c389d7f4d03db874]
Witness: 040047304402203649acfc3c0f5a93358402e17d0fe495b35f076de9a368385aeacfc9d5b748b80 2201b588dd66cf31796ab59373de189763ba14c40a744c95f600789d3c24edd18d1014730440220 5bebf834c28bb59376c4f5b0231d56bcc7b37351c838bc69e04c2de9ade53a0a022028667923002 6ab04350ec205e516d6cc52552846b3760a422a735621b6edba6a0169522103df40e0a39f91ce89 0382ea831870a7ff4a6e847c2a9591d8fb6f1388a64a0ad62103ed888901d2014acc967d0d88ecf acae36a0381012489d4354d167d81113f1f742103f662d4ffb3bbc11230482485b0505075822513 2de9ee281e09ed309892ce314253ae


Can you please describe the algorithm with this example how to get result In-address  32mgo47LcUQjPfjYNzAYEsM5fqosiqpuVd  ?
7  Bitcoin / Bitcoin Technical Support / Re: I can not parse files after blk00975.dat (Bitcoin Core) on: June 13, 2018, 02:07:09 PM
and now I have a new question)

----
for example in the blk000976.dat file there is a block

https://blockchain.info/block-height/481824
https://blockchain.info/block-index/1619616/0000000000000000001c8018d9cb3b742ef25114f27563e3fc4a1902167f9893

in which there is a transaction # 13  https://blockchain.info/tx/8f907925d2ebe48765103e6845c06f1f2bb77c6adc1cc002865865eb5cfd5c1c

with SegWit script

Can you describe the algorithm (pseudo code or the order of hash operations) how to get addresses for In- and Out transactions from its scripts?

thank you.
8  Bitcoin / Bitcoin Technical Support / Re: I can not parse files after blk00975.dat (Bitcoin Core) on: June 13, 2018, 01:56:37 PM
I fall into this issue before but still cannot solve it.
I change the way to parse block data.

I got this explanation from https://github.com/bitcoin/bitcoin/blob/master/src/primitives/transaction.h


/ **
  * Basic transaction serialization format:
  * - int32_t nVersion
  * - std :: vector <CTxIn> vin
  * - std :: vector <CTxOut> vout
  * - uint32_t nLockTime
  *
  * Extended transaction serialization format:
  * - int32_t nVersion
  * - unsigned char dummy = 0x00
  * - unsigned char flags (! = 0)
  * - std :: vector <CTxIn> vin
  * - std :: vector <CTxOut> vout
  * - if (flags & 1):
  * - CTxWitness wit;
  * - uint32_t nLockTime
  * /

and from here https://bitcoin.stackexchange.com/questions/55232/parsing-a-segwit-transaction-what-is-the-size-of-witness-data/55234

for each input {
     stackItems = read integer
     if stackItems> 0 {
         for each stackItem {
             bytes = read integer
             // witness data is bytes long
         }
     }
}
9  Bitcoin / Bitcoin Technical Support / Re: I can not parse files after blk00975.dat (Bitcoin Core) on: June 13, 2018, 10:30:33 AM
Also, I have checked the blocks included in blk00971.dat & I've noticed that the timestamps range from last week of August to Mid September 2017.
And blk00975.dat's blocks are from September 2017, one month after SegWit (BIP144) activation.

SegWit input/output scripts structure is a lot different than the regular transaction's.

That "parser" doesn't support and cannot read SegWit Txs.
Disclaimer: I could be wrong.



Thanks !
10  Bitcoin / Bitcoin Technical Support / Re: I can not parse files after blk00975.dat (Bitcoin Core) on: June 12, 2018, 09:51:31 AM
Try to delete blk0097X.dat from the default data directory then re-sync your node.
For Windows, open file explorer/my computer and browse to: C:\Users\"UserName"\Appdata\Roaming\Bitcoin

Yes. so I did several times.
Errors in blocks or transactions (extra bytes or incorrect headers) can appear in different places in the downloaded files - from 97X to the last dat file.
11  Bitcoin / Bitcoin Technical Support / I can not parse files after blk00975.dat (Bitcoin Core) on: June 12, 2018, 08:14:49 AM
Bitcoin Core download the blockchain to blkXXXXX.dat files.
also there is a parser of blkXXXXX.dat files, which created in compliance with the documentation https://bitcoin.org/en/developer-reference

At the beginning, all files are parsed without errors. Blocks and transactions are correct.
But since the file blk00975.dat in blocks there are some additional bytes, and incorrect transaction headers.

Unfortunately, I can not find any regular features. And the documentation does not say anything about any changes to the protocol.
I tried to completely reinstall Bitcoin Core, installed previous versions, and reloaded the *.dat files .
But all the same, since blk0097X.dat files are not valid on some blocks. And errors can appear in other places after reload.

Have you encountered such mistakes? Is there a way to fix them?
Or is there an alternative way, how else can I download a full blockchain?
12  Bitcoin / Development & Technical Discussion / How to get address from in-transaction on: April 05, 2018, 11:50:05 AM
I do a quick parsing of blockchain file and there was a question on definition of a address for an input transaction.

How from the specified sriptSig calculate the address correctly?

So, scriptSig is hex:

Code:
 len:       107
 scriptSig: 483045022100fffc98a7bcbe7fc6d6716775794f59551e335914683fd1ed6fcdae40c68918310220763ceeb8b9bf168f75b98e4a1dd774072e8816fec384a6228b1ecbfbcbf8239d012102d939f9164fc61e89eaf18841cc13f08721ce9ef671f3751a1536a10af752881f

or

Code:
PUSHDATA[72] 3045022100fffc98a7bcbe7fc6d6716775794f59551e335914683fd1ed6fcdae40c68918310220763ceeb8b9bf168f75b98e4a1dd774072e8816fec384a6228b1ecbfbcbf8239d01
PUSHDATA[33] 02d939f9164fc61e89eaf18841cc13f08721ce9ef671f3751a1536a10af752881f

Is correctly that to calculate the address we first need to get from compressed key (pushdata [33]) - uncompressed by the method https://en.bitcoin.it/wiki/Secp256k1 ?

I tried this method using OpenSSL
Code:
EC_KEY* key=EC_KEY_new_by_curve_name(NID_secp256k1);
if (key)
{
  EC_KEY* r=o2i_ECPublicKey(&key, &keypart, 33);
  if (r)
  {
    EC_KEY_set_conv_form(key, POINT_CONVERSION_UNCOMPRESSED);
    char key_result[65];
    int size=i2o_ECPublicKey(key, &key_result);
  }
  EC_KEY_free(key);
}

openssl specifies that

Code:
key_result [65] = 04d939f9164fc61e89eaf18841cc13f08721ce9ef671f3751a1536a10af752881f42a2f60dd229dca9adbc86f16104a0114f8d1458fda83d4a747476d137e0fd18
-

From which I then determine the address (according to the algorithm described in https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses)

but unfortunately I get the wrong 1LzATNQX57AEZ1qXKbHemS1gRxMayito1n

Quote
It's about the block #170058 https://blockexplorer.com/block/000000000000047e131d31e3cd3c8e673c117136b72fd5d67b8b1bffbde04772 and its last transaction #17 from the 1KqydgzrzK28T6rdPVoLaASp3i4BZ5CGTb (1.75723208 BTC)

that is, instead of 1KqydgzrzK28T6rdPVoLaASp3i4BZ5CGTb I get another.  Sad
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!