Hot answers tagged

6

EDIT: For clarity, I mean this in the sense of what part of the technology requires me to use a hash function? As opposed, to just constructing something that looks like a valid hash. When determining whether or not a block is valid, each and every bitcoin node on the network will take the header of that block, and run it through a hashing algorithm to see ...


6

Hash functions are unpredictable. You can't simply find an input to the hash function that produces such an output. The only way to accomplish that is by trying lots and lots of candidate blocks as input. If the target is 1000 times smaller, it requires 1000 times as many tries.


5

If you convert the difficulty bits to hex you will get: 0x1F00FFFF Coefficient = 0x00FFFF Exponent = 1F = 31 Target = Coefficient * 2**( 8 * ( exponent-3 ) ) Target = 0xFFFF with 31 - 3 = 28 trailing NULL (0x00) bytes Target: 0x0000FFFF00000000000000000000000000000000000000000000000000000000 Your Hash: ...


4

Sometimes these terms are used more or less interchangeably. Traditionally, a checksum is used to detect corruption and a hash is used to map large elements into slots randomly. In Bitcoin-land we're often concerned with "cryptographic hashes" which are hashes that have special security properties. Things called checksums are usually designed to have ...


4

Is verification of blockchain computationally cheaper than recreating it? Yes, far easier How do you verify the blockchain integrity? Don't you also have to recalculate all the values to see whether they are valid? No. The miner has to find a value for parts of the block they can choose a value for, such that a hash of the block has a certain number of ...


3

(This answer is a selection of quotes from an email I got from David Harding where he replied to my email reply to the newsletter. In the answer below, the quoted text is from my email question and the non-quoted text is from David Harding's reply) I think it is indeed a collision attack. The attack you describe is based on a database of preimages and ...


3

A Bitcoin mining ASIC: does not attempt to complete a single hash, rather fragments of two SHA256 compression rounds which is then compared to a target, the result is never returned can not accept arbitrary information that is not in the form of a partial SHA256 compression round So in terms of competitiveness, a CPU can actually complete a SHA256 hash, ...


3

Normally, one of the purposes of hashing a string (such as a transaction) is summarizing the data to save the size because of the space limitation. No, that would be a compression function. Hash functions are not compression functions, there is no reversing a hash. The point of a hash is to get a unique representation of the data that is the same size for ...


3

The reason that is often stated is that you would have to re-calculate all the headers with all the hash values of the whole chain which is practically un-doable. It's not the mere recalculation of new headers: miners currently create about 8×10^19 block candidates every second. However, at current difficulty levels, it takes about 4.8×10^22 block ...


2

Recall that in order to be a valid block, it has to have a valid proof of work: the hash of the header has to be below the current target value (i.e. start with a sufficient number of zeros). If you just alter something in the block (e.g. the destination of the coinbase transaction), its hash will change and almost certainly will no longer meet the proof-of-...


2

The speed of the hash is roughly linear in the number of bytes processed: SHA2 processes block of 64 bytes at a time, and the time taken is equal to the number of blocks processed. Computing a hashtree processes more blocks due to the intermediate levels but almost all the processing can be done in parallel unlike the linear hash which must be done ...


2

I can't say I'm familiar with all of the cryptocurrencies you mentioned, but the Bitcoin clones generally use elliptic curve (secp256k1) cryptography and the same address generation scheme. Keys A private key is any 256 bit number. However, for the EC used by Bitcoin, it must be between 0x1 and 0xFFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFE BAAE DCE6 AF48 A03B ...


2

A checksum is an application of a hash function. From wikipedia - cryptographic hash function: A cryptographic hash... is a mathematical algorithm that maps data of arbitrary size to a bit string of a fixed size (a hash) and is designed to be a one-way function, that is, a function which is infeasible to invert. From wikipedia - checksum: A checksum ...


2

No, and this will not happen in the foreseeable future. Any given hash calculation will result in any one of 2^256 possible numbers. That means, the odds of finding any one exact number is 1/2^256. Even at today's hashrate of ~47000000 TH/s, it would take you 7.812×10^49 years to find a preimage for every one of those 2^256 numbers, assuming each hash you ...


2

It doesn't matter which nonces you test or in what order that other than you need to avoid testing the exact same block header twice (since that would obviously be a waste of time). It's useful to test all the nonce values since if you don't test them all you will need to update extranonce more often, though not critical. Even though miners increment their ...


2

It's possible, and this does happen (refered to as extraNonce), but this is orders of magnitude more resource intensive to do, as you need at least the left hand side of the merkle tree, rather than just 64 bytes of the header. In Bitcoin the nonce is only 32 bits, which means every 4.2 Billion hashes you need to either update the timestamp, or modify the ...


2

The hash rate is literally how many distinct block header hashes you can try per second. Nothing more, nothing less. Note that I say "try" and not "compute". Determining whether a particular block header is interesting is somewhat faster than fully computing the hash: You can drop the last few rounds of the hash implementation, and only compute the first 32 ...


2

Where in the source code do we check whether hash(blockheader*nonce) < Difficulty The function you are looking for is in pow.cpp: bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params& params) { bool fNegative; bool fOverflow; arith_uint256 bnTarget; bnTarget.SetCompact(nBits, &fNegative, &...


2

As the protocol is upgraded with soft-forks changing script interpreter behaviour, the script-machine is extended with additional runs. Each new upgrade brings a new script run with new rules, whilst previous script runs continue to be evaluated according to older rules. Arguments need to be supplied to determine whether the newer script runs are to be ...


2

The P2WPKH actually uses the HASH160 hashing algorithm, which is just RIPEMD160(SHA256(pubkey)). The reason for using SHA256 is mentioned in BIP141: The increased size improves security against possible collision attacks, as 2^80 work is not infeasible anymore (By the end of 2015, 2^84 hashes have been calculated in Bitcoin mining since the creation ...


2

combined together to get the penultimate hash which together with the nonce That's not correct. The "penultimate hash" is the merkle root. The nonce is not part of the merkle root at all. That is part of the block header and is hashed along with the merkle root and several other things in order to get the block hash. This merkle tree structure is ...


1

Because they aren't the same. It appears that this script IDE interprets things inside of angle brackets (< and >) as strings, not as hex values. However a hash is not a string, it is a sequence of bytes which may be represented using hexadecimal values. So what your script is actually doing is putting the string 1PUzZ61FSVTn12CafJC85Vy1ts3BoFcXdU on ...


1

Merkle root is a part of the block header and is calculated based on the transactions included in the block. If transactions in the block are changed, it would change the merkle root in the header. If the merkle root is changed, the block header will change and the header hash which was calculated initially will no longer be valid. When a node receive a ...


1

giving them a number H(studentID||Bi) where Bi is the ith block header in the Bitcoin blockchain.Would the scheme be me more secure if you instead used H(studentID||Bi-1|| Bi)? For this purposes of this question, the bitcoin header Bi = H(Bi-1 || other stuff). Under a black box assumption of H()'s behavior, the two schemes are practically equivalent. You ...


1

Yes, the order matters. Changing the order of bytes of data being hashed will result in a different hash. Thus changing the order of transactions for the merkle root will also result in a different merkle root. There is no requirement that miners try different orders of transactions. But they may choose to do that instead of re-selecting transactions for the ...


1

New to BTC world Be very very careful about who you trust. Do your own independent research. Reading old questions on this website is a good start. what can I do with newly generated coins People often ask this sort of question after downloading a mining game to their phone and "mining Bitcoin" on their phone. Unfortunately those are not real. If you ...


1

There is no correlation between hash-power and number of validating full-nodes in the network. Consider the following: Hashrate is necessarily anonymous. Therefore, there is no way to determine how many miners are operating on the network. Furthermore, a miner may operate an arbitrary number of full-validation nodes, from which it creates its candidate ...


1

Your address 32feVAD9Haq1CtfT6JCLTt4L5qef3UnVpY is a P2SH mainnet address, with a 05 address prefix and represents the base58 encoding of the following data: [05][20-byte hash][4-byte checksum] So, the [05] prefix tells your wallet that your address represents a P2SH embedded script presage (20B). On the other hand, a [00] prefix tells your wallet that ...


1

POS distributes valid block rewards proportionally to stakers. However, majority stakers cannot be unseated if they do not wish to trade their stake. A 51% staker can control/censor the system indefinitely. POW always allows for new hashrate to come online. If fees increase, new mining will join, thereby diluting a potential 51% miner. Because external ...


1

How am I suppose to get the txid of this transaction? The same way you get the txid of any other transaction, by hashing it (unless it is segwit). Note that the transaction you linked to is not a segwit transaction, so you can just take its hash. If the transaction is a segwit transaction (as indicated by the marker and flag bytes of 0x0001 following the ...


Only top voted, non community-wiki answers of a minimum length are eligible