Questions tagged [sha256]

A 256-bit variant of Secure Hash Algorithm 2

Filter by
Sorted by
Tagged with
2
votes
1answer
42 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 ...
3
votes
0answers
38 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 ...
0
votes
1answer
85 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: ...
0
votes
1answer
38 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 ...
5
votes
1answer
451 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 ...
0
votes
0answers
51 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
38 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
63 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 ...
4
votes
1answer
155 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
28 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 ...
0
votes
1answer
250 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?
2
votes
1answer
87 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
74 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
1k 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
80 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 ...
0
votes
0answers
68 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 ...
1
vote
2answers
128 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
2answers
129 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 ...
2
votes
1answer
71 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. ...
0
votes
2answers
131 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
136 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
124 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 ...
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
35 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 ...
0
votes
1answer
171 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
136 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 ...
0
votes
1answer
51 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
575 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: ...
0
votes
0answers
108 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
398 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
284 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
555 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 ...
1
vote
1answer
151 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 = "...
3
votes
2answers
690 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 ...
0
votes
2answers
357 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
100 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: ...
1
vote
1answer
98 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 ...
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....
4
votes
1answer
383 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 #...
2
votes
2answers
899 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 ...
1
vote
1answer
638 views

if a Bitcoin mining nounce is just 32 bits long how come is it increasingly difficult to find the winning hash? [duplicate]

I'm learning about mining and the first thing that surprised me is that the nounce part of the algorithm which is supposed to be randomly looped until you get a number smaller than the target hash .. ...
0
votes
0answers
55 views

btc mining, the largest supercomuter in existence? [duplicate]

I'm not sure of the best place to ask this so I'll ask it here. I had read that as far as computing power, the Bitcoin nodes represent the largest distributed super computer in the world in finding ...
1
vote
0answers
249 views

What parts of SHA-256 hashing an ASIC miner really does, and what remains a CPU job?

I know that ASIC does not perform transactions ledgering, it is a CPU job. I also know that SHA256 consists of two logical parts: a digest function, which reduces any big message, like ~1MB block, to ...
0
votes
1answer
1k views

Converting a bitcoin miner for other use [duplicate]

Is it possible if you purchased a bitcoin miner such as an antminer that cracks sha256 and edit the software so it could just crack normal sha256 hashes such as that you could use it with things like ...
0
votes
1answer
2k views

New params of chainparams.cpp. What put on them and how generate?

What do these parameters do and what to insert there uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); //what this do ? end what put to here consensus....
2
votes
0answers
160 views

Double Hashing Merkle Trees [duplicate]

I under that merkle tree use double hashing (HA = SHA256(SHA256(Transaction A)). Curious for answers to the following: Why is there a need to hash it twice? What is the difference between hashing it ...
0
votes
1answer
122 views

How to check two hashes are equal using block data and the nonce?

This is my first question on this community (the 100 points were just given to me by the site). The information given is from a block i found looking from the docs api. What am supposed to do with the ...
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://...
8
votes
2answers
16k 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 ...
5
votes
1answer
843 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: ...