Questions tagged [sha256]

A 256-bit variant of Secure Hash Algorithm 2

SHA-256 is a 256-bit variant of the SHA-2 algorithm, that is used heavily in Bitcoin.

154 questions
39
votes
5 answers

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…
35
votes
1 answer

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 constructing the checksum, but why wasn't just the…
Noah
  • 1,469
  • 12
  • 19
25
votes
7 answers

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) 9595c9df90075148eb06860365df33584b75bff782a510c6cd4883a419833d50…
Shomari
  • 665
  • 1
  • 6
  • 20
24
votes
4 answers

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 to the initial question first; My question: Is…
user3023094
  • 367
  • 1
  • 3
  • 4
19
votes
7 answers

Where is Double hashing performed in Bitcoin?

where in the Bitcoin Protocol is SHA256(SHA256(x)) performed and why?
joe
  • 301
  • 1
  • 3
  • 8
17
votes
1 answer

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 private key? I need to be able to do this with a list…
Austin Burk
  • 1,109
  • 2
  • 9
  • 15
17
votes
4 answers

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 obsolescence of SHA-256 encryption entirely, much…
Paul Omans
  • 281
  • 1
  • 2
  • 6
15
votes
1 answer

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 constitutes the bottleneck of the verification…
10
votes
1 answer

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 Bitcoin, did he intend to allow this?
Nick ODell
  • 29,184
  • 11
  • 69
  • 129
9
votes
5 answers

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 #499645. They both have 18 Zeros, then 2=2, but then…
hardfork
  • 2,107
  • 1
  • 10
  • 27
8
votes
2 answers

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 ECSDA is dependent on a hash function such as…
John Smith
  • 93
  • 1
  • 4
8
votes
3 answers

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 Gy =…
Pedro
  • 385
  • 2
  • 9
8
votes
2 answers

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 the private key is generated:…
Will-In-China
  • 468
  • 2
  • 4
  • 11
8
votes
2 answers

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…
user21322
  • 83
  • 1
  • 1
  • 3
8
votes
3 answers

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 sophisticated, there's sure to be a lot of interest…
Mike Battaglia
  • 272
  • 3
  • 7
1
2 3
10 11