Questions tagged [sha256]

A 256-bit variant of Secure Hash Algorithm 2

Filter by
Sorted by
Tagged with
0 votes
0 answers
22 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(...
eason's user avatar
  • 3
1 vote
1 answer
47 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 ...
PurpleSand's user avatar
1 vote
0 answers
67 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 ...
vnprc's user avatar
  • 385
6 votes
1 answer
309 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 ...
Matt Tainsh's user avatar
0 votes
0 answers
37 views

how does n work in Type 1 Deterministic Wallet?

According to Bitcoin wiki: A type 1 deterministic wallet is a simple method of generating addresses from a known starting string. [...] To generate a private key take SHA256(string + n), where n is ...
Alexio puk2sefu's user avatar
1 vote
1 answer
278 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: ...
FKAjasmine's user avatar
0 votes
1 answer
135 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 ...
Darcy Sutton's user avatar
1 vote
1 answer
162 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": "...
davidbak's user avatar
  • 261
0 votes
2 answers
194 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 ...
HeyDoeFarm's user avatar
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. ...
Adam's user avatar
  • 11
0 votes
1 answer
70 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 ...
bitcash complex's user avatar
1 vote
2 answers
211 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, ...
AncientTides's user avatar
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 ...
Zephyrus's user avatar
  • 658
0 votes
1 answer
98 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 ...
LeetSpeech's user avatar
0 votes
2 answers
106 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 ...
AncientTides's user avatar
0 votes
0 answers
213 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 ...
Mustafa antar's user avatar
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 ...
Rony Tesler's user avatar
0 votes
0 answers
158 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 ...
satya's user avatar
  • 171
2 votes
2 answers
180 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 ...
Tabo's user avatar
  • 21
0 votes
2 answers
256 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 ...
Mathew Pitcher's user avatar
3 votes
1 answer
700 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 ...
Aleš Janda's user avatar
0 votes
1 answer
88 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). ...
Mikey Mike's user avatar
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-...
arikachimoaririki's user avatar
0 votes
2 answers
498 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)? ...
user avatar
0 votes
1 answer
311 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:...
kendfss's user avatar
  • 103
0 votes
1 answer
108 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 ...
J.Doe's user avatar
  • 127
3 votes
1 answer
486 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 ...
sphpmp's user avatar
  • 127
1 vote
1 answer
116 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 ...
Jaisal Francis's user avatar
2 votes
1 answer
146 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, ...
potuz's user avatar
  • 151
1 vote
3 answers
439 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 ...
septerr's user avatar
  • 173
0 votes
2 answers
182 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 ...
explore's user avatar
1 vote
1 answer
153 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 ...
Chris's user avatar
  • 113
4 votes
1 answer
193 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 ...
tjr226's user avatar
  • 185
1 vote
1 answer
36 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?
user avatar
0 votes
0 answers
22 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 -...
Prince M's user avatar
  • 340
0 votes
1 answer
69 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 ...
Michał Kuczyński's user avatar
1 vote
2 answers
662 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 ...
Virej Dasani's user avatar
1 vote
0 answers
31 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 - ...
seberm's user avatar
  • 11
0 votes
1 answer
116 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 - ...
hodddl's user avatar
  • 101
1 vote
1 answer
189 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. ...
Mitten File's user avatar
1 vote
1 answer
249 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?
mengeroshi's user avatar
15 votes
1 answer
826 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 ...
Rene Pickhardt's user avatar
0 votes
0 answers
175 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: ...
Eagle1's user avatar
  • 163
1 vote
1 answer
5k 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 ...
James Palmer's user avatar
0 votes
1 answer
509 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 ...
Pretty Girl's user avatar
3 votes
0 answers
128 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 ...
Biology nerd's user avatar
1 vote
0 answers
54 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 ...
johnsmiththelird's user avatar
2 votes
1 answer
91 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 ...
hypergogeta's user avatar
3 votes
1 answer
924 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 ...
B221D9's user avatar
  • 31
0 votes
1 answer
271 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: ...
Zippo76's user avatar