Title: R value parse from signature on Blockchain input transactions Post by: mamuu on January 26, 2021, 07:59:41 PM Hi!
Can I export all signatures from blockchain and parse R values of signatures? Can you suggest a method? https://gz.blockchair.com/bitcoin/inputs/ from the files at this address I did it with Python but it's very slow Do you know a code with C? Thank you. Title: Re: R value parse from signature on Blockchain input transactions Post by: MixMAx123 on January 26, 2021, 08:20:42 PM If you're looking for double r-values, forget about it!
You are definitely not the first to search the blockchain for it. I wrote a blockchain explorer that you can use to search for anything in the blockchain. But it's not finished yet and needs a lot of memory and RAM. Title: Re: R value parse from signature on Blockchain input transactions Post by: pooya87 on January 27, 2021, 05:17:45 AM Can I export all signatures from blockchain and parse R values of signatures? There are billions of signatures on the bitcoin blockchain, why do you need to export "all" of them?Quote I did it with Python but it's very slow Things aren't "very slow" because of the programming language, they are usually slow because of bad code or simply slow process.Do you know a code with C? As for other code, there are general blockchain parsers but there is no point in extracting signatures alone so there isn't any "good" code for it. Title: Re: R value parse from signature on Blockchain input transactions Post by: mamuu on January 27, 2021, 08:42:02 AM If you're looking for double r-values, forget about it! You are definitely not the first to search the blockchain for it. I wrote a blockchain explorer that you can use to search for anything in the blockchain. But it's not finished yet and needs a lot of memory and RAM. Thank you I will not be looking at repeating R values. I will use it in some tests and at the same time I am trying to learn and develop the parse operation in the blockchain. Can I export all signatures from blockchain and parse R values of signatures? There are billions of signatures on the bitcoin blockchain, why do you need to export "all" of them?Quote I did it with Python but it's very slow Things aren't "very slow" because of the programming language, they are usually slow because of bad code or simply slow process.Do you know a code with C? As for other code, there are general blockchain parsers but there is no point in extracting signatures alone so there isn't any "good" code for it. Thank you for the explanation pooya87. I had such an idea after reviewing the video here. https://www.youtube.com/watch?v=C6zrPMnyWSw Title: Re: R value parse from signature on Blockchain input transactions Post by: PawGo on January 27, 2021, 09:04:19 AM Download the whole blockchain (bitcoin-core).
Use https://github.com/gcarq/rusty-blockparser to parse blockchain. As you are developer you will manage to export only sigscript from each transaction input. (hint: change file https://github.com/gcarq/rusty-blockparser/blob/master/src/callbacks/csvdump.rs) Then you may write your program to extract R from each sigscript. Title: Re: R value parse from signature on Blockchain input transactions Post by: pooya87 on January 27, 2021, 10:05:54 AM I had such an idea after reviewing the video here. That's a pretty bad example.https://www.youtube.com/watch?v=C6zrPMnyWSw First of all that is not the correct way of benchmarking a code, as you can see the repeated execution of the same command reports different times (totals) that have a spread with a difference as big as 68% to my calculation. The correct way would be a warm-up, then execution of the same method (aka a function) in a loop with an accurate timer attached that measures the time it takes to run that chunk of code then reports the mean with deviance discarding any value that is way off the mark. This also eliminates the time it takes for the first execution of the program. I don't know much about python but I can write a C# program that takes a longer time to open for the first time (eg. self-contained without ReadyToRun) but then runs just as fast C. Secondly the speed of an application as a whole depends on the quality of the code and the amount of optimization that has gone into it. A bad C application runs just as slowly as A bad python application. It comes down to how familiar that developer is with the language and how correctly they can benchmark it and how effectively they can improve their code. For example there are certain cases where the following runs faster: Code: for (int i=0; i<n; i+=4) Finally C is faster than most other languages in certain cases and only if you have squeezed every ounce of performance from codes written in each language. Take a look at these two posts, different people write the same code in different languages some even rewrite the same code in python and get faster results than the starter: https://codegolf.stackexchange.com/questions/26323/how-slow-is-python-really-or-how-fast-is-your-language https://codegolf.stackexchange.com/questions/26371/how-slow-is-python-really-part-ii Title: Re: R value parse from signature on Blockchain input transactions Post by: NotATether on January 27, 2021, 11:10:40 AM Bear in mind that any program that extracts R values will need to use different procedures for segwit and non-segwit transactions, because segwit transactions have the signatures in the witness data while normal transactions (including "wrapped" segwit transactions) have them in the scriptSig.
Secondly the speed of an application as a whole depends on the quality of the code and the amount of optimization that has gone into it. A bad C application runs just as slowly as A bad python application. It comes down to how familiar that developer is with the language and how correctly they can benchmark it and how effectively they can improve their code. For example there are certain cases where the following runs faster:i C# is actually much faster than Python because the files are compiled down to byte code that .NET runtime understands. Same with Java and other languages with a runtime. Python has an not well documented feature where it can compile the python files down into its own bytecode separately, and you can get similar performance as C# from that since the burden of parsing statements is removed. C is just compiling all its statements down to assembly code for x86 processors which is just a tiny bit faster than C# for all code that isn't doing some scientific for math work because nearly all programs for the most part spend most of their time making system calls or altering data structures for which native assembly code cannot optimize (there are SSE registers, AVX registers, the L1 and L2 cache but they are all too small to store complex data structures and are useless for shortening the overhead programs transition between user land and OS land). And of course all performance advantages of C (and C++ which for speed purposes is just C with classes) are lost the moment you use a big general-purpose library inside your program. There are bitcoin-related programs written in C and the reason they are so fast is because they use their own hand-written functions, and this works because they know their application requirements so they only write the functionality that will actually be used, unlike a general-purpose library (such as Boost) which cannot make this assumption. Title: Re: R value parse from signature on Blockchain input transactions Post by: LoyceV on January 27, 2021, 05:57:18 PM https://gz.blockchair.com/bitcoin/inputs/ If it helps, I made [~500 GB work in progress] Bitcoin block data: inputs, outputs and transactions (https://bitcointalk.org/index.php?topic=5307550.0):from the files at this address I did it with Python but it's very slow See blockdata.loyce.club (http://blockdata.loyce.club/) It's not complete yet, and unfortunately I only now noticed my download got stuck 7 days ago. Currently, I have 220-ish GB of data from "inputs" available at much better download speed than Blockchair.com itself offers.blockdata.loyce.club/inputs/ (http://blockdata.loyce.club/inputs/) (159 GB - currently incomplete, growing 8 GB per day) blockdata.loyce.club/outputs/ (http://blockdata.loyce.club/outputs/) (117 GB) blockdata.loyce.club/transactions/ (http://blockdata.loyce.club/transactions/) (43 GB) Sample: blockchair_bitcoin_addresses_and_balance_DATE.tsv.gz (sorted by balance, highest first (in satoshis)): Title: Re: R value parse from signature on Blockchain input transactions Post by: mamuu on December 11, 2021, 07:26:20 AM Hi
My question went like this I understand asserts in python. but I didn't understand the first '48' part. my aim is to separate the "signature" and separate it as in the link below, of course together with the PubKey Can you give me information about conditions (assert) that will help me? Thanks. information that helps me https://bitcoin.stackexchange.com/questions/58853/how-do-you-figure-out-the-r-and-s-out-of-a-signature-using-python type : pubkeyhash spending_signature_hex : 483045022100cbee7b355c737bccdaaaf566b52e07c6e560fa33861b3035d37feffad94f66e6022 053114a529ab13eba906f9e08288bcf02dd5142ae0ecb117f10d54f56868443af014104d720973d f5c090aa1dd17adefd9f575baa2f0547dd2913fb4982bf423f1cf82623b700e0d1b7f2b7b5dcfa9 301f8c197dd0b601204d00e02b544251c5d9ac45a information I want to parse r = 00cbee7b355c737bccdaaaf566b52e07c6e560fa33861b3035d37feffad94f66e6 s = 53114a529ab13eba906f9e08288bcf02dd5142ae0ecb117f10d54f56868443af PubKey= 04d720973df5c090aa1dd17adefd9f575baa2f0547dd2913fb4982bf423f1cf82623b700e0d1b7f 2b7b5dcfa9301f8c197dd0b601204d00e02b544251c5d9ac45a Code: def parse_element(hex_str, offset, element_size): Title: Re: R value parse from signature on Blockchain input transactions Post by: alexeyneu on December 11, 2021, 07:45:50 AM There are bitcoin-related programs written in C and the reason they are so fast is because they use their own hand-written functions, and this works because they know their application requirements so they only write the functionality that will actually be used, unlike a general-purpose library (such as Boost) which cannot make this assumption. say Code: std::cout <<"\nCoinbase: "<< txScriptSig <<"\nPubkeyScript: "<< pubScriptSig <<"\nMerkle Hash: "<< merkleHash <<"\nByteswapped: "<< merkleHashSw <<"\nGenerating block...\n\n"; 48 stuff looks like some hex'ed ascii phase(readable) Title: Re: R value parse from signature on Blockchain input transactions Post by: COBRAS on December 11, 2021, 06:22:30 PM Hi! Can I export all signatures from blockchain and parse R values of signatures? Can you suggest a method? https://gz.blockchair.com/bitcoin/inputs/ from the files at this address I did it with Python but it's very slow Do you know a code with C? Thank you. I use this - rscan + rsz scrypt https://cryptoxploit.com/rsz-key/ But data need recheck, because public key not for rsz ome time Title: Re: R value parse from signature on Blockchain input transactions Post by: mamuu on December 12, 2021, 08:08:06 AM There are bitcoin-related programs written in C and the reason they are so fast is because they use their own hand-written functions, and this works because they know their application requirements so they only write the functionality that will actually be used, unlike a general-purpose library (such as Boost) which cannot make this assumption. say Code: std::cout <<"\nCoinbase: "<< txScriptSig <<"\nPubkeyScript: "<< pubScriptSig <<"\nMerkle Hash: "<< merkleHash <<"\nByteswapped: "<< merkleHashSw <<"\nGenerating block...\n\n"; 48 stuff looks like some hex'ed ascii phase(readable) i will review Thanks alexeyneu Title: Re: R value parse from signature on Blockchain input transactions Post by: gmaxwell on December 27, 2021, 06:40:09 AM anyone want to take bets on the above 'precompiled binary' from the newbie account being malware?
Title: Re: R value parse from signature on Blockchain input transactions Post by: mamuu on December 27, 2021, 08:30:03 AM anyone want to take bets on the above 'precompiled binary' from the newbie account being malware? We are not being optimistic anymore, I agree and increase the bet. Title: Re: R value parse from signature on Blockchain input transactions Post by: COBRAS on May 30, 2024, 06:19:51 PM Good day
What files from this: blockdata.loyce.club/inputs/ (159 GB - currently incomplete, growing 8 GB per day) blockdata.loyce.club/outputs/ (117 GB) blockdata.loyce.club/transactions/ (43 GB) contain r,s,z transaction data ? Thank you Thank you |