Skip to main content
Share Your Experience: Take the 2024 Developer Survey
13 votes
Accepted

checksum = SHA256(SHA256(prefix+data)) - why double hashing?

Satoshi standardized on using double-SHA256 for 32-byte hashes, and SHA256+RIPEMD160 (each once) for 20-byte hashes, presumably because of (likely misguided) concern about certain attacks (like length ...
Pieter Wuille's user avatar
8 votes
Accepted

What is the circular dependency in signing a chain of unconfirmed transactions?

What is the circular dependency here if only tx1 depends on tx0? Since tx1 depends on tx0, the txid of tx0 must be known before tx1 can be created and signed. However the legacy transaction format (...
Ava Chow's user avatar
  • 70.8k
7 votes
Accepted

How can a collision attack reveal the private key?

If the attacker just tries random public keys and guesses the correct one, they obviously won't be able to spend the funds. What they can do is try random private keys and derive the public keys from ...
Vojtěch Strnad's user avatar
6 votes
Accepted

Who is the creator of the secp256k1 standard?

It can be found in https://www.secg.org/sec2-v2.pdf: SEC 2: Recommended Elliptic Curve Domain Parameters Certicom Research Contact: Daniel R. L. Brown ([email protected]) January 27, 2010 Version 2....
Pieter Wuille's user avatar
6 votes

What are pros and cons of txindex option?

In addition, txindex=1 used to be required if you wanted to use LND (lightning network daemon). See https://github.com/lightningnetwork/lnd/pull/751
Offer Markovich's user avatar
6 votes

How does copying main stack prevent malformed unlocking scripts vulnerabilities?

you can find explanation here: https://bitcointalk.org/index.php?topic=5095376.msg49150302#msg49150302 the issue was actually with OP_RETURN. What OP_RETURN used to do is it would skip to the end ...
LIU YUE's user avatar
  • 214
4 votes

What's the point for mining pools to set a higher target?

I think the quote is perhaps a little confusing. Higher target means lower difficulty (easier). Mining requires finding a block which hashes to a value lower than the target, so raising the target ...
meshcollider's user avatar
  • 11.8k
4 votes
Accepted

What are all the meanings of the nSequence field?

You are right in saying nodes nowadays do not enforce the original ordering meaning given to the nSequence field, though note this was never implemented as part of block validation (couldn't have been)...
Antoine Poinsot's user avatar
4 votes
Accepted

What is the length of the extended public key?

If it says 513 bits it's referring to the fact that you need at least 513 bits of data to convey the information in an extended public: 256 bits of the chaincode, 256 bits of the X coordinate of the ...
Pieter Wuille's user avatar
4 votes
Accepted

DoS attack and MAX_BLOCKS_IN_TRANSIT_PER_PEER

this limit implies and allows "[...] spreading the load and ensuring that it doesn't overwhelm any peer with requests." and "[...] allowing the peers to control the pace of updates ...
Pieter Wuille's user avatar
4 votes
Accepted

How can a hacker steal the funds received in the future when there is only an xpub on the server?

For websites selling goods for bitcoin it is a common practice to use xPub to derive a new address for each customer. This has two benefits 1) using a fresh address protects the merchants privacy as ...
Juha Siivikko's user avatar
4 votes
Accepted

Question about nextblockhash in bitcoin block struct

The getblock command is used for retrieving historical blocks, not for constructing a new block. For every block in the currently active chain except for the latest block the next block hash is known.
Vojtěch Strnad's user avatar
3 votes

What is the circular dependency in signing a chain of unconfirmed transactions?

In Bitcoin funds are tracked in the form of Unspent Transaction Outputs (UTXOs). When building a transaction you declare exactly which UTXO you are spending by providing the UTXO’s outpoint. The ...
Murch's user avatar
  • 75.7k
3 votes

Will Bitcoin scaling affect the amount of hashing power required to keep the network secure?

This is a comment from page 199 of Mastering Bitcoin. I think its meaning is to be interpreted taking into account the two preceding sentences: Note that the target difficulty is independent of ...
KonKan's user avatar
  • 193
3 votes
Accepted

Is it correct to say that "each transaction input is signed independently"?

You are correct, and the text is misleading. In general, every transaction input signature signs information from all over the transaction, including other inputs. This does not actually involve the ...
Pieter Wuille's user avatar
3 votes

Using more than a 12 word mnemonic phrase

Why roughly 128 bits, and not exactly? Reading BIP39, 12 words seems to imply exactly 128 bits of entropy. Why the additional entropy provided by using more than 12 words is not used? This is ...
Pieter Wuille's user avatar
3 votes
Accepted

Bitcoind with -txindex=1 still no mempool transactions

According to your debug.log file, txindex is not enabled: 2018-04-22 20:40:34 LoadBlockIndexDB: transaction index disabled This indicates that your bitcoin.conf is incorrect. Make sure that your ...
Ava Chow's user avatar
  • 70.8k
3 votes

What are pros and cons of txindex option?

In addition to the other answers, txindex=1 is required if you want to use your wallet with Counterparty. See the installation instructions at https://github.com/CounterpartyXCP/counterparty-lib
alexg's user avatar
  • 263
3 votes
Accepted

A problem on difficulty equation

The code you're citing does not actually deal with difficulty. It deals with targets. The target is the maximum 256-bit value than the block hash is allowed to have. The difficulty is defined as 2^...
Pieter Wuille's user avatar
2 votes

Will Bitcoin scaling affect the amount of hashing power required to keep the network secure?

Yes this is true, however, it's unlikely. As Bitcoin becomes more mainstream, and more people use it, it will attract more miners. This means there will be more hashing power on the network. What ...
Jestin's user avatar
  • 8,812
2 votes
Accepted

How is the clock reset in the Complex Script Example?

If at least two of the partners are cooperative with each other, they can move the funds at any time, even before the 30 days have elapsed. They can spend the output at any time using the second ...
meshcollider's user avatar
  • 11.8k
2 votes

How is the clock reset in the Complex Script Example?

They 'reset' the clock by moving the funds to a new output before the period ends.
Claris's user avatar
  • 15.4k
2 votes
Accepted

Does derivation from public and private keys give the same result in normal key derivation?

The purpose of unhardened derivation is to allow for cases 1 and 2 to derive the same keys as each other. It works because both actually hash the same data, and that adding two scalars will result in ...
Ava Chow's user avatar
  • 70.8k
2 votes
Accepted

Question about Payment Channels

I think I see where the confusion is, but please correct me if I'm not quite understanding your question. It's possible to misinterpret that section in Mastering Bitcoin as saying that there is one ...
Marco's user avatar
  • 395
2 votes
Accepted

Reported value in block diverges from actual block’s value

Other blockchain explorers agree with blockchain.com's valuation. Older versions of rpc_block.py had blockheight = 277316 So I wondered if maybe the total was overlooked in the editing of the ...
RedGrittyBrick's user avatar
1 vote
Accepted

Question about MAST tree in book "mastering bitcoin"

It seems to me that the text should read "we could also have four conditions for the same cost". MAST is a binary tree, which means the number of possible scripts (conditions) grows ...
Vojtěch Strnad's user avatar
1 vote
Accepted

hierarchical deterministic wallets - creation of public keys

In BIP32 key derivation, having the parent extended public (xpub) key suffices for computing child public keys. That parent xpub can be derived in a number of ways, but all eventually boil down to a ...
Pieter Wuille's user avatar
1 vote

checksum = SHA256(SHA256(prefix+data)) - why double hashing?

Prevents some types of attacks. Satoshi wanted to build something for the ages and was trying to prevent any and all attacks. See here for details Why are hashes in the bitcoin protocol typically ...
Paul Otto's user avatar
1 vote
Accepted

QR Scan "Unrecognized format" mycelium "Mastering Bitcoin'

Mh i'm try with Bitcoin android wallet and work, this is the result Can be your wallet have a bug?
vincenzopalazzo's user avatar
1 vote

Extended Public Key 's mechanism misinterpreting in 'Mastering Bitcoin' by Andreas

I have to agree, https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch05.asciidoc still needs a little work. Here is my perspective, the application of BIP32 Deterministic Key Generator and ...
skaht's user avatar
  • 3,067

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