Questions tagged [sha256]

A 256-bit variant of Secure Hash Algorithm 2

Filter by
Sorted by
Tagged with
3
votes
1answer
362 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 ...
2
votes
1answer
66 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
104 views

How do i setup 2x TTbiT Usb Miners on CGminer?

I'm having trouble connecting 2x TTbiT Usb Miners(sha256) through CGminer. Does anyone know how to set them up to mine BCH on Multipool?
1
vote
2answers
86 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
0answers
47 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
29 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 ...
0
votes
1answer
37 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 ...
3
votes
1answer
145 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
24 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 ...
2
votes
4answers
11k 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. ...
0
votes
1answer
146 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 ...
0
votes
1answer
43 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 + ...
3
votes
3answers
901 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
68 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 ...
3
votes
3answers
403 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: ...
0
votes
0answers
48 views

SHA256 hash generating python

Can somebody give me complete python code that outputs a valid and random sha256 mining hash using python? I know bitcoin with a laptop is incredibly unprofitable, especially with python, I am just ...
3
votes
2answers
2k 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 ...
0
votes
2answers
85 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 ...
1
vote
1answer
56 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. ...
6
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: ...
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 ...
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) ...
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 ...
1
vote
1answer
96 views

What does cloud instance owned means?

I am using this website for cloud mining cryptocurrency for free. I was reading about How the Cloud Mining/Hashing Works when I came to this point in which says (Cloud SHA-256) SHA-256 algorithm, 1.0 ...
3
votes
1answer
581 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 ...
11
votes
4answers
6k views

Where is Double hashing performed in Bitcoin?

where in the Bitcoin Protocol is SHA256(SHA256(x)) performed and why?
0
votes
2answers
117 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
104 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 ...
1
vote
1answer
105 views

Creating a Bitcoin address using the 9 steps. Stuck on stage 2

I need to write a script using C++ and the OPENSSL library that takes this: 0250863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b2352 performs a SHA256 Hash using the sha256 function from the ...
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 ...
4
votes
1answer
301 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
1answer
35 views

How easily can asics be ported over to other sha algorithms?

Let's say I want to rewrite the software behind the hardware of current asics. Would it still mine, for example, sha1 algorithms orders of magnitude faster than a normal cpu would?
1
vote
0answers
34 views

Can you use a mining hardware to find a string for a certian hash

Using a computer to brute force a sha256 will take very long time, but with a mining hardware, it still takes long, but at least chances of finding it are better. But the question is, are mining ...
11
votes
4answers
18k 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 ...
0
votes
1answer
125 views

Is pre-image attack useful for mining?

I know that SHA256d is strong enough and it's not likely that will be broken soon but let's say someone knows how to find pre-image. The adversary chooses random hash starting with n zeroes (less than ...
1
vote
1answer
134 views

Why do we inverse the hash of the blockheader?

Let's pick this example blockheader-hashing in Python: from hashlib import sha256 import hashlib header = "...
0
votes
1answer
48 views

How important is the hash power in solving a block?

What is the role of hash power in solving a black, I have read at numerous place it's more like a lottery to successfully form a block in bitcoin and any such crypto blockchain currencies. Is it ...
0
votes
3answers
480 views

How do you generate a receive address from a string? [closed]

I already have a an address with Bitcoin and would like to generate a receive address using SHA256 hash which is based on a string. I've found an example of creating an address using a SHA256 hash: ...
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, ...
0
votes
0answers
100 views

retail hardware SHA256d hash rates [duplicate]

Obviously it hasn't been profitable to mine bitcoin on retail hardware for years at this point. Nevertheless, I'm curious. Does anybody have any benchmarks on what the hash rates for retail ...
0
votes
1answer
365 views

Difference between scrypt and sha-256 mining?

So in detail my question is: are both these two algorithms different from each other?. I read somewhere that this two algorithm is used for the different cryptocurrency. if that's true. then why? ...
0
votes
2answers
261 views

Attacking Blochcain/Bitcoin by hash

Assuming that SHA-256 is not save anymore. How could the Bitcoin blockchain get attacked? Ok I could get the input value for the hash function but could I now easily add my own blocks to the chain? I'...
0
votes
1answer
516 views

Bitcoin hash calculation [duplicate]

Best regards I have been doing a lot of research about bitcoin and blockchain. A lot of informacion across the Internet can be found where many people explains the basics of bitcoin an it´s ...
0
votes
2answers
328 views

Understanding the Hash Function

Can someone please explain in detail the components of the final hash that determines the winner of the block? My understanding is that the miners are taking The Merkle Root, The time stamp, The ...
3
votes
1answer
91 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: ...
2
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....
2
votes
2answers
839 views

How can I check the hash of a bitcoin block?

Let's pick an example bitcoin block: #499583 This is the block: https://insight.bitpay.com/api/rawblock/000000000000000000677c4077da7c9f01dde5f332ba2fbff962ee699714d5da It starts with ...
8
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 ...
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 ...
5
votes
3answers
1k 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. ...