Questions tagged [sha256]

A 256-bit variant of Secure Hash Algorithm 2

Filter by
Sorted by
Tagged with
3
votes
4answers
645 views

checksum = SHA256(SHA256(prefix+data)) - why double hashing?

From 'Mastering bitcoin' - checksum = SHA256(SHA256(prefix+data)) The 'data' is, for example, an address, which was calculated using SHA256 and then RIPEMD160. Why do we need double hashing when ...
0
votes
0answers
25 views

How many SHA256 hashes can a single thread compute?

ASICs use many threads to compute SHA256 hash functions in parallel. At the time of this post, Antminer S19 can compute 110TH/s. How many SHA256 hash functions per thread can the best SHA256 ASIC ...
1
vote
1answer
54 views

Can we benefit from Collatz conjecture-based proof of work?

Can we benefit from Collatz conjecture proof of work to enhance bitcoin utility? F Bocart 2018:"Inflation Propensity of Collatz Orbits: A New Proof-of-Work for Blockchain Application" argues ...
0
votes
1answer
40 views

Can we have multiple possible nonce making same number of leading zeroes in the hash?

Is it possible to have different nonce which are satisfying the same condition of having let's say 4 leading zeroes in the hash? Is it possible that one node suggests 89123 nonce and other node ...
3
votes
1answer
278 views

Why does the TXID have 256 bits when Bitcoin's address security is 160-bit?

Commonly used Bitcoin addresses have the security of 2160 (due to the RIPEMD-160 hash). This means that Bitcoin is based on the fact that 160-bit security is good enough. If someone breaks 160-bit ...
0
votes
1answer
39 views

Is there a list of processes within Bitcoin that use hash functions?

Hashing within Bitcoin is done in several different areas of the code. EG: We have the SHA-256 mining algorithm, the Merkle tree hashing, and I believe double hashing within certain areas (SHA-256D). ...
0
votes
1answer
38 views

For a block containing 'x' number of unverified transactions, how many SHA256d hashes are performed to obtain the hashmerkleroot?

I've been trying to understand this for a few days now. I understand that the hashmerkleroot is the root node of a fully perfect binary tree. I also understand that the sha256d hashes would be the non-...
1
vote
2answers
196 views

As a developer, what steps do I need to take to generate private-public keys?

When developing (I'm using Apple Swift), what steps are needed in order to independently create my own pair of private-public keys (with the ability to restore a private key from a mnemonic phrase)? ...
1
vote
1answer
248 views

Determination of Block Size Limit

In Bitcoin Mining, there is a limit on the size of any block added to the chain. What happens if, for instance, a block's nonce is so large that the block's size exceeds the limit? Secondary questions:...
0
votes
1answer
32 views

How to pad Bitcoin Header in the SHA Algorithm Passes?

For any bitcoin block we combine various Header fields to create a string which is an input to a 2 pass SHA algorithm. The resultant hash must match with the Hash in the Block header for the Block to ...
2
votes
1answer
93 views

Already mined block hash showing zeros at the end when I hash it in online sha256 two times

Hi I tried hashing a already mined block with this block header ...
2
votes
1answer
105 views

sha256 implementation

Hi I'm trying to use bitcoind's vectorized SHA256 implementation in src/crytpo/sha256_*.cpp in my project. On a first try feeding a block of 64 null bytes to SHA256D64 I obtain the hash {0xe2, 0xf6, ...
2
votes
3answers
115 views

Can a blockchain have duplicate block hashes?

I am writing an indexer that will work with various blockchains and not just Bitcoin. I am wondering if it is safe to assume that block hashes will be unique for a given blockchain, across reorgs. Is ...
0
votes
2answers
79 views

Merkle tree hash - Computing hash manually doesnt match the one computed by SHA256D64

I am trying to go through the code to check the merkle tree hash computation done by BlockMerkleRoot in bitcoin core. The hash computed using online tools by appending transaction hashes is different ...
0
votes
1answer
40 views

Assemble Miner at Home

is it possible to assemble multiple boardd with required chips to create home miner. I have seen some miners with certain amount of boards and chips on them, so i was wondering 8f i can substitute ...
2
votes
1answer
48 views

Translate c++ function into python: sha256 hash mismatch [closed]

This is not related to bitcoin but it uses most of the bitcoin codebase. I would like to translate some c++ code into python but struggle really hard to get the hashes right. This is the function I ...
4
votes
1answer
147 views

What previously existing technologies made Bitcoin possible?

When watching a tutorial, they mentioned that Bitcoin is based off 4 or 5 technologies that existed for at least a decade before Bitcoin. Satoshi Nakamoto was the first person to combine them all into ...
1
vote
1answer
26 views

What exactly happens to leaves when forming nodes?

If you hash TXIDs with sha256 twice, you get the leaves of the merkle tree. As far as I understand the two outputs of the TXIDs are concatenated / paired. What does that mean? Are they added together?
0
votes
0answers
14 views

Why is the SHA256 regularly applied twice? [duplicate]

I have come across at least two times in bitcoin computations that the sha256 algorithm is applied twice - merkle root computation and address computation. Why is this? Not sure of an appropriate tag -...
0
votes
1answer
53 views

Why is SHA-256 mining secure?

My understanding is the when you are mining bitcoin you are looking for a string, or maybe a binary number (a) such that if you 'add' a to the block (b) you get a number (c) whose hash begins with a ...
1
vote
1answer
317 views

I found a BTC hash. Now what?

I used a mining program written in python and after a lot of time, it found a hash that looks something like this: 0000de957fbfdfc77582e0d0b20c53d2d1d83d8bb8cfe3693521f672bf2a6021 except it has 19 0's ...
1
vote
0answers
26 views

Minimum characters to uniquely identify bitcoin trasanction in blockchain

What is the minimum number of characters (TXID from the beginning) which is generally considered to uniquely identify a bitcoin transaction in the blockchain? (Similarly to git and a commit SHA - ...
0
votes
1answer
82 views

Will a recursive sha256 run over all 2^256 inputs before a collision?

Will a recursive sha256 run over all 2^256 inputs before a collision? Here'a a python program showing my question - will this loop for 2^256 times - given endless memory or will it terminate before - ...
1
vote
1answer
121 views

Lowest numbered Bitcoin hash? [duplicate]

I was thinking about which bitcoin block has the lowest numbered hash. What I mean by a hash as a number is that. For example, the number "1" has a lower hash than "2" in SHA256. ...
1
vote
1answer
91 views

What will happen when a collision in SHA256 be found?

Would the protocol migrate to another Hash Algorithm inmediatly? What would be the next? SHA3 or BLAKE 2?
5
votes
0answers
275 views

How many bitcoin transactions can be verified per second on commodity hardware in 2020?

I am trying to figure out how many Bitcoin transactions could be verified per second. Am I correct that signature verification is more expensive than computing Merkletrees and hashes and therefore ...
0
votes
0answers
90 views

download bitcoin core safely: wrong checksum

I've downloaded the "classic" linux bitcoin core 0.19.1 (tgz) on https://bitcoincore.org/en/download/ In the SHA file that's on the website this is the key: ...
1
vote
1answer
3k views

Can you crack SHA-256?

From my understanding, a hash function is an algorithm that takes a unique input and produces a unique output, and a secure hash like SHA-256 cannot be reverse engineered. I saw this thread Won't ...
0
votes
1answer
234 views

How to generate the hash of public key in Bitcoin [closed]

I'm trying to hash the public key with SHA256 and then ripemed160 and get the hash. but it gives the wrong hash Public key: 2b4632d08485ff1df2db55b9dafd23347d1c47a457072a1e87be26896549a8737 Hash ...
3
votes
0answers
98 views

Why can't Grover's algorithm be used for bitcoin mining?

Similar questions have been asked before: Can quantum computing improve Bitcoin mining? Can a Qubit Miner ASIC device be created and what would its impact be on the mining community? However, none ...
1
vote
0answers
38 views

security of the mining algorithms litecoin vs bitcoin - scrypt vs sha256?

how is the cryptanalysis' current state on both sha256 and litecoin's scrypt? is litecoin's scrypt on a security level like sha256? by security i simply mean ways to "break"/"de-cipher" the hash ...
2
votes
1answer
67 views

How does Bitcoin utilize cryptography and secure hash algorithm (SHA) to link records in the blockchain?

I am wondering how Bitcoin uses cryptography and secure hash algorithm such as SHA256 to link the records in the blockchain. And if possible I think it will give me a better understanding if there is ...
3
votes
1answer
583 views

Get a correct SHA256 of a PublicKey as bytes

I’m new in code develop and I’m studying it by myself (books, tutorials, official help of sites…) since a year VB.NET. A lot of information I read is in C# that I rewrite in VB.NET. I’ve started four ...
0
votes
1answer
157 views

Merkle Root for Block 100000: calculation in Excel

I am stuck doing the calculations for the infamous block 100000. I am doing those in excel. I am trying to add as much detail here of the operation I am doing and intermediate results. TX1: ...
0
votes
1answer
107 views

Where is the string that generates the hash with 18-20 zeroes?

When bitcoin miners mine, they have to solve a difficult and extremely repetitive math problem using the SHA256 algorithm. The miners are trying (basically playing lottery and almost always working in ...
5
votes
1answer
509 views

Is Bitcoin PoW actually SHA256 + Merkle generation? Or have I misunderstood coinbase/append?

Miners can mutate nonce (32 bits) + time (mutates once a second). This allows for 232 (~4 billion) hashes per second. That's not enough anymore for our ASICs as they perform in the TH/s now rather ...
0
votes
0answers
148 views

Generating TXID from transaction's data [duplicate]

As I understand, we can generate a TXID by hashing transaction data through SHA256 twice, and as you know probably, A bitcoin transaction is just a bunch of data that describes the movement of ...
0
votes
1answer
112 views

What's the purpose of CSHA256::Write and CSHA256::Finalize

Looking at Bitcoin Core implementation of SHA256, I noticed it was a bit different from OpenSSL's implementation. In OpenSSL, you would initialize a variable with SHA256_CTX when in Bitcoin Core it's ...
1
vote
1answer
146 views

Confused on using SHA256 code from Bitcoin Core

I was looking at Bitcoin Core code to use its SHA256 code but am confused on where I should be looking at. In bitcoin/src/crypto/sha256.h there is CSHA256 and in bitcoin/src/crypto/sha256.cpp there ...
4
votes
1answer
240 views

What are the 3 arguments called in function SHA256?

void sha256(struct sha256 *sha, const void *p, size_t size) { struct sha256_ctx ctx; sha256_init(&ctx); sha256_update(&ctx, p, size); sha256_done(&ctx, sha); } I'm trying ...
0
votes
1answer
39 views

Learning + checking the bitcoin address creation process at each step

I’m learning how hashing algorithms are used around the process of bitcoin address creation. I’ve read lots of great examples online that, step by step, show the output of each sequential hashing ...
4
votes
2answers
162 views

How to make a homomorphic preimage/payment hash with current lightning network / Bitcoin implementations?

If I remember / understand it correctly by using the mechanisms from the scriptless scripts paper we could easily create homomorphic preimages / paymenthashes. I think this would be a very desirable ...
0
votes
1answer
186 views

Create a Double sha256 block and trandaction

I have same problem whit create a double sha256 of the transactions and blocks with C++. The hash block it is created with the concatenation of these data, version + previusBlock + merkleRoot + ...
6
votes
3answers
2k views

What is the reasoning behind the choice of 2^256-2^32-977 for the prime on the secp256k1 curve?

In Bitcoin's elliptic curve (secp256k1), the prime p = 2^256 - 2^32 - 2^9 -2^8 - 2^7 - 2^6 - 2^4 - 1 the generator point Gx = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 ...
0
votes
3answers
198 views

Repeated sha256 on brain wallet [closed]

The writer of this article https://pastebin.com/raw/jCDFcESz explains that Sha256('sender') x 2 yields the address 18aMGf2AxQ3YXyNv9sKxiHYCXcBJeJv9d1 I am however getting the address ...
1
vote
2answers
282 views

Electrum's "script hash" form with NBitcoin?

I've come across how scripts are hashed in the electrum (stratum) protocol implementation by looking at the docs. I'm using NBitcoin, and I've tried to generate this hash from a segwit address, first ...
0
votes
2answers
320 views

SHA256 vs RIPEMD160 in SegWit

In Pay-To-Witness-Public-Key-Hash (P2WPKH), the RIPEMD160 hash function is used to hash the public key of the recipient in the locking script. On the contrary, Pay-To-Witness-Script-Hash (P2WSH) uses ...
2
votes
1answer
100 views

Do pools distribute "jobs" to miners based on "failed" solutions which have already been submitted?

My question is this: How exactly does the stratum protocol distribute "work" to miners? More specifically, since mining can be compared (in many regards) to "brute forcing" a cryptographic hash (i.e. ...
0
votes
2answers
163 views

How would you find the Merkle Root with a Block that contains 6 transactions?

Let's use block #100205 https://www.blockchain.com/en/btc/block/0000000000033d0de6f4ebe93b3b142424cdbecf4bd98b948e856c4a55f09f76 This block contains 6 transactions. After the second level of hashing ...
0
votes
1answer
239 views

How to Build Block Header in stratum?

When I studied the stratum on here,I found that there were little difference between the stratum and solo mining for building block header. The stratum tell us that we needed to pad the header to ...