60 votes

Can someone explain how the Bitcoin Blockchain works?

For user32260: Bill sells Sally some apples for £2.50 Bill is a fruit vendor. Sally wants to buy some apples for £2.50. Sally wishes to use Bitcoin to pay Bill for the apples. Bill presents Sally his ...
user avatar
  • 64.4k
55 votes
Accepted

What are the keys used in the blockchain levelDB (ie what are the key:value pairs)?

Bitcoind since 0.8 maintains two databases, the block index (in $DATADIR/blocks/index) and the chainstate (in $DATADIR/chainstate). The block index maintains information for every block, and where it ...
user avatar
39 votes
Accepted

How can I run bitcoind in pruning mode?

By setting the -prune option. -prune= Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete ...
user avatar
  • 6,208
36 votes
Accepted

Does blockchain without currency make any sense?

There are a number of research papers that cover the question "Do you need a blockchain?", e.g. the eponymous paper by Wüst & Gervais (2017) and the extensive Blockchain Technology ...
user avatar
  • 64.4k
31 votes
Accepted

How is the whitepaper decoded from the blockchain (Tx with ~1000x m of n multisig outputs)

This is a fun little puzzle on the blockchain, basically. First, you need to know a little about pdf's and how they're structured, which you can find here. Second, you'll note from section 3.4.1 that ...
user avatar
  • 7,639
30 votes
Accepted

Why can't we fight Bitcoin thieves by not accepting payments from hacked accounts?

Fungibility. Money needs to be fungible, otherwise it's not money at all. Blacklists allow censorship and confiscation of wealth by centralized/powerful players (like governments) which will be ...
user avatar
  • 6,208
26 votes

What is the Merkle root?

"Figure 7-2. Calculating the nodes in a merkle tree" from Mastering Bitcoin shows the Merkle Root (HABCD) of a list of four transactions: Tx A, Tx B, Tx C, and Tx D: To verify that a transaction—for ...
user avatar
  • 4,307
26 votes
Accepted

How are transactions broadcast to the rest of the network?

If a person sends a transaction to another person, and Bitcoin is a peer-to-peer application, how will the transaction get to the rest of the Bitcoin community? Think of it like how gossip would ...
user avatar
  • 13.7k
23 votes
Accepted

What are the equations to convert between bits and difficulty?

Answer shamelessly stolen from stackexchange: Difficulty encoding is thoroughly described here. Hexadecimal representation like 0x182815ee consists of two parts: 0x18 -- number of ...
user avatar
  • 28.7k
23 votes

Why does each block store a Merkle root?

Merkle roots do not verify transactions, they verify a set of transactions. Transaction ID's are hashes of the transaction, and the Merkle tree is constructed from these hashes. It means that if a ...
user avatar
  • 8,734
21 votes
Accepted

Why can't mining pools provide fake transactions within the generated blocks?

Suppose Alice wants to add a fake transaction where she receives X ammount of BTC. I understand that in order to add that transaction to the blockchain she would have to compete against all the other ...
user avatar
19 votes
Accepted

Is it chain of headers rather than a chain of blocks?

Blocks contain a header, and headers are chained, so blocks are chained also. Note the merkle root from your question: this attaches the transactions in the block to the header, making them a logical ...
user avatar
18 votes

Can Bitcoin-Qt be configured to trim the blockchain?

Since Bitcoin-Core 0.11.0 you can prune (trim) the blockchain in Bitcoin-Qt. But not from the UI. You need to add prune=550 to your bitcoin.conf file and restart Bitcoin-Qt. Explanation: -prune=<...
user avatar
18 votes
Accepted

What is a step by step way to insert data in OP_RETURN?

I wrote a little demo program which puts a snippet of data into an OP_RETURN script. It requires a bitcoin instance that accepts RPC connections, though it could be implemented without that. You can ...
user avatar
  • 28.7k
18 votes

How can I run bitcoind in pruning mode?

There are more details in the release notes. To enable block pruning set prune=<N> on the command line or in bitcoin.conf, where N is the number of MiB to allot for raw block & undo data. A ...
user avatar
18 votes

Why can't we fight Bitcoin thieves by not accepting payments from hacked accounts?

It wouldn't work. Imagine if you get to a grocery store and try to pay in cash and they say, "Sorry, your dollars are no good, their serial numbers are on a list of bills that have been stolen". You ...
user avatar
18 votes

Why does each block store a Merkle root?

Merkle roots are stored in Bitcoin block headers so as to enable efficient membership proofs for transactions in a block, which are necessary for Simple Verified Payment verification (SPV) nodes that ...
user avatar
  • 1,297
17 votes

Where do I find the *actual* blockchain size?

The blockchain sizes of Bitcoin, Litecoin, Dash, Dogecoin, Peercoin and Namecoin are listed here at https://bitinfocharts.com/ (scroll down to Blockchain Size) As of today (2015-07-12) the sizes are (...
user avatar
  • 567
17 votes
Accepted

How often does a block have only one transaction?

It's possible that this could happen just because there aren't any transactions to be mined. Early on in the bitcoin block chain, this was often the case. This could also happen if two blocks are ...
user avatar
  • 13.7k
17 votes
Accepted

How does Bitcoin read from/write to LevelDB

In the specific example you asked, it does so by querying the LevelDB located in ./bitcoin/chainstate (there is where the UTXO set is stored). UTXOs are identified by its txid (Little Endian ...
user avatar
  • 2,712
17 votes

Should I share my seed phrase to earn airdrop tokens?

No, it is not safe. Never share your 12 word phrase. It is a backup of your private key and allows people to spend your money. They only need your public key or Bitcoin address to give you money, not ...
user avatar
  • 412
16 votes
Accepted

So I mined a block, but why would other nodes accept my mined block?

The incentive to mine on the currently longest chain is that there is a risk to the dishonest miner that honest, non-mining nodes may have already propagated the first block and hence reject and not ...
user avatar
15 votes

Can there be a blockchain without mining?

I don't know anything about Multichain so I'm not sure if this is the answer you're looking for, but here's one answer that might help you. The interesting thing about proof-of-work (Nakamoto) ...
user avatar
  • 1,297
15 votes
Accepted

What would happen if two blocks had the same hash?

Blocks are identified by their hash. This means that in your story, in Jan 2017, when B gets broadcast, any node that it is advertized to will think "I already have this block", and ignore it. ...
user avatar
14 votes

Creating my own bootstrap.dat?

Bitcoin Core contains a tool to do this properly (filtering out any orphan blocks, putting everything in the correct order — which will work a lot better than just concatenating the block files. It's ...
user avatar
14 votes
Accepted

Why does Bitcoin store all transaction inputs and outputs, instead of just an "account/balance" ledger?

In order to be sure that an address balance is correct, you need to check that all the transactions on that address are valid. So in order to generate a list of addresses and balances that you trust, ...
user avatar
14 votes
Accepted

Is there some client like Bitcoin core, but which highly compresses the blockchain?

The Bitcoin blockchain is mostly comprised of signatures (mostly non-compressible) and hashes (non-compressible), there's some space to be gained by eliminating redundancies due to people re-using ...
user avatar
  • 15.1k
14 votes
Accepted

Why do we need blockchains?

Let's look at what happens without the blockchain: You create a transaction and it is relayed through the network. Every node that receives it updates their ledger to reflect your transaction. So far, ...
user avatar
  • 64.4k
13 votes
Accepted

hash versus hash pointer

I believe that the use of the term "pointer" in the this sentence is not referring to the low-level data type, such as int *pointer_to_int; would be in C. I think it's more referring to a "pointer" ...
user avatar
  • 8,734
13 votes
Accepted

Blockchain synchronization is painfully slow / Best way to download blockchain

What usually takes time is the validation of the transactions in the blockchain, not downloading it. Bitcoin Core implements a fully validating node, which does not trust any of the information other ...
user avatar

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