29 votes
Accepted

How are bitcoin transactions and the blockchain transferred over the internet?

The Bitcoin P2P network The Bitcoin P2P network is a randomly-wired gossip network. This means that all nodes make arbitrary connections to other peers (using various ways to discover new addresses) ...
Pieter Wuille's user avatar
23 votes
Accepted

What are the advantages of Schnorr vs ECDSA?

Your question seems to assume that the only goal is minimizing on-chain transaction size. Reducing size and related costs is certainly something that can be improved upon, but it's far from the only ...
Pieter Wuille's user avatar
15 votes
Accepted

Full list of "special cases" during Bitcoin Script execution (p2sh, p2wsh, etc.)?

As of September 2023, "high-level" script validation with all active consensus rules on the network is approximately this: Top level evaluation Execute the scriptSig, and call the resulting ...
Pieter Wuille's user avatar
14 votes
Accepted

How is SegWit a soft fork?

You're confusing transactions (the abstract object) and their serialization (the bytes on the wire in the P2P protocol or on disk). Sure, SegWit introduces an extension to the P2P protocol (BIP144), ...
Pieter Wuille's user avatar
12 votes
Accepted

How to verify if it's Segwit Transaction or not?

A transaction is a segwit tx if at least one of the inputs contain a witness. Or if you are inspecting the raw tx then you check the 5th byte (the input count) and if it is 0x00 then it is a segwit tx....
Mike D's user avatar
  • 3,569
9 votes
Accepted

If I set assumevalid=0 after syncing the blockchain will Bitcoin Core go back and validate historical blocks?

No, it won't. That's also not possible without rebuilding the UTXO set from scratch, as the unspent outputs being spent need to be known to validate spends against. If you want to force a ...
Pieter Wuille's user avatar
8 votes

Where the P2SH script gets written?

The script is maintained by the intended recipient; he is the one responsible to keep it and not to lose it. The nodes do not store any database of the scripts. The script is provided by the spender ...
dionyziz's user avatar
  • 1,012
8 votes
Accepted

Why does IsCoinBase() check if there is exactly one input?

A coinbase transaction is not allowed to have any other inputs, hence this check. Furthermore, because this check is part of consensus code, it is the definition for a coinbase transaction, so this ...
Ava Chow's user avatar
  • 70k
7 votes
Accepted

How many bitcoin transactions can be verified per second on commodity hardware in 2020?

As others have pointed out, this largely depends on what kind of transaction you're verifying. More inputs and more signatures means longer verification, and for pre-SegWit inputs the computational ...
Vojtěch Strnad's user avatar
7 votes
Accepted

How are transactions verified with only the Bitcoin address, not the public key?

When you spend from a Bitcoin address, your transaction includes both the public key corresponding to the hashed address you're trying to spend from, as well as a signature that can be verified with ...
ieatpizza's user avatar
  • 2,068
6 votes

Different error messages under "Mandatory script verify flag failed."

But aren't both errors just variant of a failure in executing the OP_EQUALVERIFY? At what step of the evaluation each error is thrown and what can we make out of it? No, they're different errors. ...
Nick ODell's user avatar
  • 29.4k
6 votes
Accepted

How do miners understand what a transaction does?

Determining the fee of a transaction is actually very easy. As you know, a transaction has inputs and outputs, where each output has an associated amount and a script, and each input is a link to an ...
Nate Eldredge's user avatar
6 votes

Why do nodes trust other nodes to approve their transactions?

I know that the blockchain technologie works so well, because everybody has basically a copy of the last ledger. Yes, every full bitcoin node has a copy of the blockchain (aka ledger). Therefore,...
karask's user avatar
  • 2,530
6 votes
Accepted

How Blockchain transaction verification takes place?

Each node stores the entire history of transactions (the blockchain). When a node hears about a new transaction, it performs a series of checks to make sure that transaction is valid. So, when ...
chytrik's user avatar
  • 18.1k
6 votes
Accepted

Where is sum(vin) > sum(vout) check in Bitcoin Core?

https://github.com/bitcoin/bitcoin/search?q=bad-txns-in-belowout&unscoped_q=bad-txns-in-belowout const CAmount value_out = tx.GetValueOut(); if (nValueIn < value_out) { return state.DoS(...
amaclin's user avatar
  • 6,720
6 votes
Accepted

Why is there no such thing as a redirected, forged, or fake transaction?

The Bitcoin protocol follows a Unspent Transaction Output system to track the existence and state of all Bitcoin in the system. These are known as UTXOs. All transactions that transfer Bitcoin do so ...
Raghav Sood's user avatar
6 votes
Accepted

Function combinerawtransaction is not working

The issue here is that the two transactions are different, and combinerawtransaction does not operate on different transactions (it apparently just silently does nothing). It sounds like you expect ...
Ava Chow's user avatar
  • 70k
6 votes
Accepted

Does running a standard Bitcoin full node mean your node verifies transactions of other members?

The purpose of a full node in Bitcoin is to independently verify the consensus rules for transactions and blocks. This means your node will check every transaction and every block before accepting it ...
josie's user avatar
  • 681
6 votes
Accepted

Certain spent P2PKH outputs give error: Non-canonical DER signature

The requirement for canonical DER signatures was only added in the BIP66 softfork in 2015. Before that time, such non-canonical signatures were legal, and your transaction predates the BIP66 ...
Pieter Wuille's user avatar
5 votes

Which sender is banned in case of invalid transactions or blocks?

There is no way to know which node created a transaction or block, unless they publish that information themselves. Nodes should not have an identity that leaks into transaction or block data. So ...
Pieter Wuille's user avatar
5 votes

Which kinds of transactions show quadratic signature-hashing scaling?

Quadratic means that something grows as a square function of something else. If you're just talking about a one-input transaction, there is nothing that changes. The quadratic hashing issue is that ...
Pieter Wuille's user avatar
5 votes
Accepted

Satoshi Nakamoto's Transaction Chain Diagram Hash Value

Can anyone confirm exactly how the Hash value shown is computed By taking the raw data for the transaction (as in the bytes that are sent over the wire for the transaction) and passing it through a ...
Ava Chow's user avatar
  • 70k
5 votes
Accepted

What happens to rejected transactions (i.e double spend or invalid transactions)?

Invalid transactions are never included in valid blocks. They can be included in a block, but that block would be rejected as invalid (and not classified as an orphan block).
Ava Chow's user avatar
  • 70k
5 votes
Accepted

Why are only specific transaction types accepted into the mempool?

Any script can be used in P2SH/P2WSH technique. Using arbitrary scripts in transaction outputs cause grows of UTXO database and other problems.
amaclin's user avatar
  • 6,720
5 votes
Accepted

Bitcoin transactions validation process

Everything MCCCS wrote is good, but just to clarify on your last question: How many nodes must approve/verify the winning hash before it is accepted into the bitcoin network as the next block to be ...
chytrik's user avatar
  • 18.1k
5 votes
Accepted

Is verification of a blockchain computationally cheaper than recreating it?

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 ...
RedGrittyBrick's user avatar
5 votes
Accepted

Verifying a bitcoin Signature and what is the transaction data that is signed?

What you described only works for transactions with one input and one output. In general, what you do is you take the transaction that you want to verify, remove the scriptSigs from all of the inputs,...
Ava Chow's user avatar
  • 70k
5 votes
Accepted

What's the blocksize limit after segwit and how do legacy nodes deal with segwit transactions?

Normally I heard that the bitcoin blocksize is 1MB, but with the Segwit update the blocksize can be up to 4mb, so we should say that the blocksize is 4MB, right? Before the activation of segwit, the ...
Murch's user avatar
  • 74.5k
5 votes
Accepted

how does bitcoin solve the same chain replay attack?

In all cases what you are describing is a double-spend. Bitcoin uses a UTXO model (not an account based model) which means that there is a set of coins also known as the UTXO set or Unspent ...
pinhead's user avatar
  • 5,074
5 votes
Accepted

When the UTXO in the cache is full, what strategy is used to replace one UTXO with another in the cache?

The UTXO set cache is not a fixed size and the limit isn't a hard limit. New entries can be added to the cache without regards for the maximum cache size. In fact, the cache object itself doesn't even ...
Ava Chow's user avatar
  • 70k

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