Questions tagged [sha256]

A 256-bit variant of Secure Hash Algorithm 2

Filter by
Sorted by
Tagged with
1 vote
2 answers
133 views

Is it always possible to find a number whose hash starts with a certain number of zeros?

As I understand it, proof of work requires nodes to "scanning for a value that when hashed, such as with SHA-256, the hash begins with a number of zero bits" ([bitcoin paper])1. Specifically,...
0 votes
1 answer
43 views

Verify Hash from bitaddress.org without the original HTML file

Can I verify that I used an authentic version of bitaddress.org if I only have the SHA256 hash string I generated from the HTML file? >> sha1sum bitaddress.org.html How can I do this on Linux? ...
2 votes
0 answers
58 views

Does the hashrate/hash power represent the number of single or double sha256 operations that can be done per second? [duplicate]

When we state that someone has, for example, a hashrate of 240 H/s, does it imply the capability to perform 240 SHA256 hash operations (equivalent to 120 double-SHA256 operations) or 240 double-SHA256 ...
1 vote
1 answer
101 views

SHA-256 hashing algorithm

Where in the Bitcoin github repo is the SHA-256 hashing algorithm defined? Is it a methematical formula?
0 votes
0 answers
26 views

calc Block Header hash

I use the following code to calculate the header hash. function serializeBlockHeader(blockHeader) { const version = Buffer.alloc(4); version.writeUInt32LE(blockHeader.version); console.log(...
0 votes
2 answers
186 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 ...
17 votes
1 answer
32k 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 ...
25 votes
7 answers
22k 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) ...
5 votes
6 answers
17k 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 ...
1 vote
1 answer
48 views

Verifiable way to share knowledge of bitcoin address

I am looking for a simple or standard way (government bureaucrat-proof) to share knowledge of a bitcoin address in a legal contract without revealing the address itself. Having to reveal the address ...
10 votes
5 answers
2k 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 #...
0 votes
2 answers
212 views

Why does SHA256 miner hash have to be lower than the current target 256bit hex? [duplicate]

I'd like to ask if someone can help explain this definition found on https://en.bitcoin.it/wiki/Target "The SHA-256 hash of a block's header must be lower than or equal to the current target for ...
1 vote
0 answers
88 views

How can I hash a block header using bitcoin-cli and terminal commands?

I would like to hash a block header using terminal commands and look at all the pretty leading 0s, but I can't figure out how to do this correctly using block header data from bitcoin-cli. Here is ...
3 votes
6 answers
20k views

Correct way to convert a 256-bit private key to WIF?

On the Bitcoin wiki it has steps to convert a private key to WIF. So I tried following these steps in attempt to get the same result. So I took the private key. ...
8 votes
1 answer
328 views

Are miners advertised hash rate single or double hash speeds?

Modern miners on the market have up to 110 TH/s. Is this the true hash rate (singular SHA-256 hashes per second) or the net hashes relating to Bitcoin specifically (since Bitcoin involves double ...
1 vote
1 answer
381 views

replicating Hash160 with SHA256/RIPEMD160

I have a dumb question about Hash160 (specifically, going from a public key to Hash160). If I take a public key: ...
0 votes
1 answer
145 views

How long would it take for all smartphones on the planet to fully reverse a SHA-256 hash?

I am aware that, theoretically speaking, there is no way to guarantee that a reversed hash is actually what is inputted to the hashing function. However, let's say that I have an image, I write down ...
1 vote
2 answers
707 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
2 answers
5k views

Proper way to get sha256 hash in c++ using openssl?

Given the following variables: unsigned char text [] = "Test String"; unsigned int len = strlen ((const char*) text); unsigned char hash [SHA256_DIGEST_LENGTH]; Is there any reason to do ...
1 vote
2 answers
397 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 ...
15 votes
1 answer
848 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 ...
4 votes
1 answer
3k 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
1 answer
533 views

Why is the tag repeated twice in a tagged hash?

I noticed that the hash message for the tagged hash in BIP340 is prefixed with SHA256(tag) || SHA256(tag), which also describes the reason Because this is a 64-byte long context-specific constant and ...
1 vote
1 answer
188 views

Baffled by endianness: How do I compute the HASH160 of the public key of a base58 address?

Given an address as follows: > spend_address=$(btc-cli getnewaddress '' legacy) > btc-cli getaddressinfo $spend_address spend_address info { "address": "...
-1 votes
2 answers
120 views

How do i create/implement a midstate function (One that can accurately calculate the midstate of already mined blocks)

I'm creating an AI controlled bitcoin miner but I'm having trouble manually & locally creating a midstate function to be used for optimizing the mining process. Basically I've created independent ...
1 vote
0 answers
107 views

What needs to be changed in Bitcoin if SHA-256 is broken? [duplicate]

I come up with a little bit "catastrophical“ question. I declare that I understand the degree of improbability of such a scenario in our lifetime, but I would still be interested in your opinion. ...
19 votes
7 answers
14k views

Where is Double hashing performed in Bitcoin?

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

How does the bitcoin network difficulty syntax work?

So, essentially what my question is what does the "syntax" of a bdiff (bitcoin target difficulty) look like? I know that its a number, i.e the current network difficulty is set at around ...
39 votes
5 answers
9k 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 ...
8 votes
5 answers
2k 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
2 answers
276 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 ...
0 votes
1 answer
106 views

BitCoin SHA256 - ShortCut

just a general question, would it be ethical to start mining bitcoin using a shortcut, in the SHA256 hash (if that may even be possible), and mining at a much much faster speed using very less ...
7 votes
2 answers
2k 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: ...
0 votes
2 answers
530 views

How do you hash data for mining?

I was examining the block hashing algorithm and I tried to hash some blocks with my c++ sha256 to check results. The hashes were wrong all the time so I thought I couldn't build the block header ...
1 vote
2 answers
230 views

What is the actual working implementation code used in double hashing a block header in c++?

I need to successfully generate a hash value based on what i feel so far has been described as a hexadecimal filtered sha256 implementation... or something like that. I've been here , here , here, ...
0 votes
1 answer
316 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
2 answers
447 views

How do I double SHA-256 the header of block #59,500?

I'm not sure how to combine all of this information. https://blockchain.info/block/00000000096af43105123c499521e1d131d172e7e1bf2ed0843290a921f1f6a7 Version 1 Time Bits 470771548 (is this the right ...
2 votes
2 answers
189 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
0 answers
222 views

can i diy an asic miner?

Iam interested in mining bitcoin so Iam wondering if I can get a pcb for hashing and bring asic chip that algorithms are sha-256 and stick them together with some other electronics and have a control ...
0 votes
0 answers
167 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 ...
3 votes
1 answer
756 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 ...
1 vote
3 answers
478 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
1 answer
89 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
1 answer
53 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-...
0 votes
2 answers
543 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)? ...
4 votes
1 answer
4k 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 ...
0 votes
1 answer
120 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 ...
1 vote
1 answer
117 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
1 answer
147 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, ...
1 vote
1 answer
159 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 ...