Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sha256]

A 256-bit variant of Secure Hash Algorithm 2

32
votes
4answers
5k views

Why are hashes in the bitcoin protocol typically computed twice (double computed)?

According to the wiki specification of the bitcoin protocol, hashes are typically "computed twice". For example: hello 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 (first round of ...
26
votes
1answer
5k views

Why are Bitcoin addresses hashes of public keys?

Currently, Bitcoin addresses and their checksums are constructed from the public key by a using repeated hashing with SHA256 and RIPEMD160. Now I understand the reasoning behind using hashing for ...
22
votes
4answers
18k views

Is bitcoin mining itself compromising the security of SHA256

Following good scientific practice I propose a Theory/Hypothesis and now ask you to test it. Initially this is a "thought" experiment but may progress to real testing depending on your thoughts. Back ...
17
votes
4answers
14k views

How do you perform double-SHA-256 encoding?

The Bitcoin Protocol-specification gives an example of double-SHA-256 encoding. hello 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 (first round of sha-256) ...
15
votes
2answers
21k views

How can I convert a SHA256 hash into a Bitcoin base58 private key?

How can I take the output of sha256sum sudofox@ubuntu:~$ echo -n 'Hi guys!' | sha256sum 7542fb6685f9fd8f37d56faf62f0bb4563684a51539e4b26f0840db361e0027c - and turn it into a Base58Check encoded ...
11
votes
4answers
17k views

Won't ASIC miners eventually break SHA-256 encryption?

I might be confused as to how Bitcoin works, but as far as I can tell, ASIC miners are getting better every year and faster at cracking SHA-256 encryption. Won't this cause the eventual complete ...
11
votes
4answers
5k views

Where is Double hashing performed in Bitcoin?

where in the Bitcoin Protocol is SHA256(SHA256(x)) performed and why?
10
votes
1answer
710 views

Did Satoshi intend to allow midstate computation to speed up hashing?

The design of Bitcoin allows computers to compute a hash with 2 iterations of the SHA256 compression function instead of 3 on all but 1 out of every 2^32 attempts. When Satoshi chose SHA256d for ...
9
votes
2answers
15k views

How to generate a Bitcoin Private Key Checksum

I want to understand how a bitcoin private key is made up. Looking at this graphical generator https://royalforkblog.github.io/2014/08/11/graphical-address-generator/#hello I understand step 1, how ...
8
votes
3answers
2k views

If SHA256 were compromised tomorrow, would Bitcoin collapse, or is there some contingency plan to move the network to a new hashing algorithm?

Hashing algorithms have a long history of becoming widespread and then declared insecure - MD5 is a good example. As Bitcoin increases ever more in popularity, and cryptanalysis becomes ever more ...
7
votes
2answers
2k views

If SHA256 and/or RIPEMD-160 were broken, would all bitcoin addresses be compromised?

If not, what else would be needed to steal all funds from all people and completely break bitcoin? I bet some will say ECSDA gives bitcoin an additional layer of protection. I counter this by saying ...
7
votes
1answer
3k views

Can an SHA256 hash be used as an ECDSA private key?

Is it possible to map a pass-phrase directly to a Bitcoin private key by using its SHA256 hash? I remember reading somewhere that not all 256 bit values are valid ECDSA private keys. If so, how can I ...
7
votes
1answer
3k views

How does a miner perform hashing?

I'm trying to walk my way through the process by which a miner hashes. Let's say the getwork request returns a data field of: ...
6
votes
3answers
1k views

Does every nonce really have an equal chance of winning?

I set out to test the claim: "Every nonce has an equal chance of winning." Time Evolution So, I plotted, with gnuplot, the nonce values vs. hashes for all the valid blocks in the blockchain:(Also, ...
6
votes
1answer
767 views

Is this how I should calculate a Double SHA256

So I have a function called sha256 which will take a string and return the SHA-256 hash. var First = sha256('myfirstSHA'); And the output is the hex: ...
5
votes
3answers
114k views

How many hashes create one Bitcoin?

Irrespective of the length of time required to calculate one hash, how many hash operations are required to produce one Bitcoin?
5
votes
3answers
989 views

Visualize Bitcoin Hashing

According to https://en.bitcoin.it/wiki/Hash, BitCoin uses the SHA-256 hash algorithm to generate verifiably "random" numbers in a way that requires a predictable amount of CPU effort. ...
5
votes
3answers
6k views

Where can I see an input that will hash to a solution?

So as my understanding goes, there's some input (block header) that needs to be altered (via a nonce or other mechanism) which is run through a SHA256 to generate an output with X amount of leading 0'...
5
votes
2answers
894 views

Can the bitcoin network hashrate be used for a 51% attack on other coins?

Please correct me if I am wrong. The difficulty constantly changes according to the current hash rate. It changes to ensure that a block is mined every 10 minutes. If the hash rate was 1000 TH/s and ...
5
votes
2answers
269 views

Are Bitcoin ASICs Optimized for Fixed Length Messages?

Bitcoin block headers are 80 bytes. int32_t nVersion; // 4 bytes uint256 hashPrevBlock; // 32 bytes uint256 hashMerkleRoot; // 32 bytes uint32_t nTime; // 4 bytes uint32_t nBits; ...
5
votes
2answers
7k views

How do I calculate the txid of this raw transaction?

I'm trying to parse a bitcoin block using Python. I called getrawtransaction over JSON-RPC. I got this: ...
5
votes
2answers
3k views

Why was the RIPEMD-160 hash algorithms chosen before SHA-1?

Bitcoin uses both SHA-256 and RIPEMD-160 hashes. Most often a double-round SHA-256 is used, but for address generating, RIPEMD-160 is used because it generates a shorter hash value. RIPEMD-160 has a ...
5
votes
1answer
469 views

bitcoins can use different algorithm, how and implications

I read that if sha-256 was compromised at some point in the future, or for any other reason, bitcoin could switch to a different algorithm can someone detail how exactly that would work, and what the ...
4
votes
3answers
388 views

Is the SHA256 value in the bitcoin address wiki accurate?

From the wiki page https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses the example of "How to Create Bitcoin Address" shows the SHA256 of: ...
4
votes
2answers
929 views

What is a midstate? How does using a midstate speed up hashing?

This defines "midstate" as the "precomputed hash state after hashing the first half of the data." I've heard "midstate" used in the context of speeding up hashing. How does using a midstate speed up ...
4
votes
1answer
201 views

Theoretical minimum # of logic operations to perform double iterated SHA256?

What is the theoretical minimum number of logical operations an ASIC needs to perform to compute double iterated SHA256, i.e., sha(sha(•))?
4
votes
1answer
105 views

What is the point of comparing sha256 of downloaded file with published on the same website code? [closed]

Some websites publish sha256 to check authenticity of downloaded file. I suppose this is to protect against man-in-the-middle attack - that my file was not altered during download. What prevents man-...
4
votes
1answer
270 views

Which is the smallest hash that has ever been hashed?

Let's assume, the hash 00000000000000000024c0bdbec66a889778c00bc69be0a96cbbd98b75c3ce09 of block #499644 is smaller than 0000000000000000002d429f39afec70c938e888c3417d690bbc85e83529991c of block #...
4
votes
1answer
1k views

SHA256 Implementation Gate Equivalent

I needed help in understanding how to calculate the GE for a SHA256 implementation. I need to calculate the GE of individual functions in the SHA256 hashing algorithm. Could anyone please direct me ...
4
votes
1answer
3k views

Can Artificial Intelligence be used to mine BitCoins faster?

Can Artificial Intelligence be used to find more efficient mining algorithms? Is there only one algorithm that can be used to mine? EDIT: Asking about running the SHA(SHA(block header)) more ...
4
votes
2answers
837 views

Private Brain Key Generation and Public Address Not Matching Java

I am trying to generate a public and private key set from a input string in Java. (Yes I am aware this can be a dangerous practice) I am using bitcoinj for a outside library. I currently have: //...
3
votes
4answers
5k views

If SHA256 produces an alphanumeric hash, how can a hash be “less than a certain value”?

I was under the impression that Bitcoin's method for validating a hash involved making sure the hash started with a pre-determined number of zeroes. However, after reading the docs here, I see the ...
3
votes
1answer
328 views

How to compute double sha256 shown in examples of bip 143?

How do I compute the double sha256 shown in example of bip 143? The example in Native P2WPKH hashPrevouts: dSHA256(...
3
votes
2answers
1k views

Can ASIC miners easily be used to guess brainwallet passphrases?

After reading the Bitcoin wiki page for brainwallets it seems to me that mining equipment can be used to brute force brainwallet passphrases. Is this correct? "...so hackers can collectively try ...
3
votes
1answer
1k views

What values are hashed in the SHA-256 algorithm, and what would be the next iteration until a possible header is found?

I've been doing a lot of reading on mining and software related to mining but I can't quite get my head wrapped around the specific nature of what is being hashed together. So far I feel like the ...
3
votes
1answer
473 views

Is there a guaranteed hash for every block? [duplicate]

Possible Duplicate: Nonce size - Will it always be big enough? My question may be misphrased, if so, I'll correct it if you let me know in the comments. My understanding of mining is that the ...
3
votes
2answers
81 views

Is it computationally feasible to find two transaction IDs with the same first 20 bytes?

Transaction hashes uses sha256, so they are 32 bytes long. If I have to store a very large database of transaction hashes, only for the purpose of checking existence later on, is it really necessary ...
3
votes
1answer
2k views

Why is the block header 80 bytes, not 128 bytes (= two SHA-256 blocks)?

According to the Bitcoin Developer Reference, the block header is 80 bytes total: BYTES NAME 4 version 32 previous block header hash 32 merkle root hash 4 time 4 nonce ...
3
votes
2answers
737 views

Are Bitcoin Block Hashes Predictable

to create the block chain, the Bitcoin network runs hashing algorithms for each block, is it mathematically possible to predict the hash value of say, the 100th block from the last block currently in ...
3
votes
2answers
1k views

How long would it take to crack an 8-word brain wallet?

Assuming my private key for a bitcoin wallet is derived from SHA256(passphrase) and the passphrase is 8 words long, how long would it take the average attacker to crack my bitcoin wallet through a ...
3
votes
3answers
1k views

Convert between String/Hex/Byte in Java for sha256 - wrong format?

I am trying to convert a bitcoin address and have the following code from here (Calculate Segwit address from public address, 2nd answer): Step1: $ printf 1L88S26C5oyjL1gkXsBeYwHHjvGvCcidr9 > adr....
3
votes
1answer
2k views

How to calculate the BIP34Hash?

I know this going to be a repeat question, however I am still puzzled with the implementation of the BIP34 especially where it come to its hash. Referring to the chainparams.cpp at github : https://...
3
votes
1answer
249 views

Mining for nil-transaction blocks only - gaming the incentive scheme by rogue miners / consortium?

I understand that there is incentive to include transactions where the output is less than the input so that the block creator can pocket the difference. But I'm wondering if that is really worthwhile ...
3
votes
5answers
8k views

Using ASIC for password cracking - mad concept?

All ASIC for Bitcoin do a double SHA256 hash on an arbitrary string. But maybe they might be used for pen testing :-) Lets assume we have single SHA256 hash we want to crack. We also have an ASIC ...
3
votes
2answers
2k views

What determines SHA256 performance on different types of hardware?

I know the answers to many questions on here briefly touch on this point, but I'd like to get a consolidated answer that really touches on the key differences between different types of hardware which ...
3
votes
3answers
2k views

How to generate bitcoin address?

I'm currently studying Bitcoin and I followed Bitcoin wiki's instructions to make an address. But my program never responds as the site above does. Supposedly, the ECDSA key ...
3
votes
1answer
809 views

Using a Bitcoin or Litecoin miner for attacking PBKDF2 / SHA-256 [duplicate]

I'm wondering if it would be possible to utilize a Bitcoin or Litecoin miner to attack, say, a password database that uses PKBDF2 with HMAC / SHA-256. PBKDF2 uses multiple iterations of a PRF - ...
3
votes
1answer
518 views

Checking the Merkle Root for Block #100000

The below text is copied from the Bitcoin Developer Reference at bitcoin.org: If a block has three or more transactions, intermediate merkle tree rows are formed. The TXIDs are placed in order and ...
3
votes
2answers
283 views

SHA256 * 2 on header - what am I doing wrong?

I've been experimenting with the php code here: https://en.bitcoin.it/wiki/Block_hashing_algorithm (after correcting the small bug of $x=; to $x=""; ) With these blocks 0 and 125552 (for example) it ...
3
votes
1answer
85 views

Understanding what is being run through Sha256

When I am running through an example for Sha256 I am not understanding how to arrive at the right answer. If I use the following Hex string: ...