28

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) using a custom TCP protocol, usually using port 8333. Typical nodes create 8 outgoing connections, and if publicly reachable, accept up to a few 100 incoming ...


15

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 thing. The primary advantages of the Schnorr proposal are: Better privacy, by making different multisig spending policies indistinguishable on chain. When ...


13

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), which relays witnesses along with transactions, and old clients wouldn't understand such messages. But old clients don't see them. Witnesses are only included ...


10

When you create a transaction, your Bitcoin wallet broadcasts it to a few full nodes on the Bitcoin peer-to-peer network. Those full nodes quickly relay it to other full nodes, and it eventually ends up at the full nodes run by the sites you linked to. That's how those sites know the transaction exists. The full nodes also relay the transaction to Bitcoin ...


9

A miner can either verify transactions itself or assume that a transaction is valid as some nodes let him know they verified it. In either case, the miner can enter the transaction in the block he is working on. Note that in pool mining the pool decides what transactions are included, while in solo mining your own bitcoind client does so. An important ...


8

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 upon spending the p2sh as part of the scriptSig data. For the exact specification of how this data is structured, see BIP 16 by Gavin Andresen. This allows the ...


7

You should start here: http://www.youtube.com/watch?v=GmOzih6I1zs As the video mentions, mining is needed to ensure fairness and for keeping th network stable, safe and secure. Now, let's see what that means. But first a very brief explanation of the principle of mining. Mining The Bitcoin network consists of nodes that all store a database with all ...


7

No, miners do not need the entire block chain to be accessible. Technically, they don't even need it at all. The blocks themself are only needed for rescanning wallets, reorganisations, and serving blocks to other nodes. That is why pruning them away will likely become viable in the future. What you need for validating blocks and transactions (a fundamental ...


7

Yes, but that doesn't mean that the network has accepted it. There are rules for accepting a transaction. Miners only include blocks that don't break the rules. The rules include checking that the inputs are valid, that a coin isn't double-spent, that the output isn't more than the input, etc. A miner can choose to include a transaction or not. A miner ...


7

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 revalidation from scratch, start with -reindex-chainstate. This will blow away the UTXO set, and recreate it from the blocks on disk, and revalidate everything in the ...


6

The miner looks into the transactions insofar as they have been digitally signed. This is a public key / private key cryptography pairing that performs the role of your signature on a check. Without this digital signature, a transaction is not considered valid and will not be included in the block calculation. The miner's job is then to amass transactions ...


6

Generally speaking, BIP37 bloom filtering SPV has atrocious scaling though it is hard to say exactly how poor it is in the real works. Every peer must sync the entire block chain from the last they had contact with the network, in the worst case this is approximately 50GB. The node must load every single block from disk, filter it to the clients ...


6

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 output of a previous transaction, along with whatever data is needed to satisfy the previous output's script. A transaction fee is implemented by simply having ...


6

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. There are two rules that must be satisifed here: The hash of the public key must match a certain value. (A failure here means you have the wrong key, or no key.) ...


6

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. Example: tx1 ...


6

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(100, false, REJECT_INVALID, "bad-txns-in-belowout", false, strprintf("value in (%s) < value out (%s)", FormatMoney(nValueIn), FormatMoney(value_out))); ...


5

The clients receiving B->C first will keep it in the memory (transaction pool) and denote is as an orphaned transaction, until they find A->B. So unless network propagation is terribly slow: no, it will not be rendered invalid.


5

There is a maximum standard transaction size since Bitcoin 0.8.2 of 100k per transaction. There are a number of other limits that influence the validation and propagation of a transaction though. Specifically: A block is limited to 20000 signature verifications. The block itself can't be larger than 1Mb. The standard Bitcoin client (Bitcoin Core / bitcoind)...


5

Contrary to the book Mastering Bitcoin, there is no boolean value of "True" in Bitcoin Script. An executed transaction script is valid when the top item remaining in the stack at the conclusion of execution is non-zero. To combat transaction malleability BIP62 (transaction version 3) also introduces the additional validity requirement that the stack must ...


5

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 hash function. For Bitcoin, that is SHA-256 double (SHA-256 done twice). and whether or not it contains the previous owner's signature? It depends. For ...


5

Any script can be used in P2SH/P2WSH technique. Using arbitrary scripts in transaction outputs cause grows of UTXO database and other problems.


4

Short answer: no, this is impossible. Longer answer: some transactions allow changing the inputs used (ANYONECANPAY inputs). It is also possible to have inputs which do not sign the outputs being created (SIGHASH_NONE). However, a transaction where all inputs are of this type, are worthless, as anyone could change the outputs to credit themselves instead. ...


4

It is an accurate abstraction. However, the most computationally expensive part of transaction verification is ECDSA signature verification. And the results of verification are cached and reused when they're done a second time. We don't cache the rest of transaction verification as it is subject to many parameters (new softfork rules can have been activated,...


4

TL;DR: It seems that Bitcoin Wallet for Android incorrectly labels nLockTime transactions as OptInRBF due to a bug in bitcoinj. The issue has been reported. You don't need to do anything. Apparently, Bitcoin Wallet for Android recognized your transaction as OptInRBF (as pointed out by the code you found). The warning you are seeing was only added to the ...


4

This might only be an issue with the terminology, but when a transaction is "mined", it is included in a block. You could do that of course, if you were contributing blocks to the Bitcoin network, but the computing power of the network has grown to levels where it is infeasible to mine at home. What you can do, is to verify the validity of an incoming ...


4

Four methods have been used to decide whether a softfork should apply: The softfork applies to all blocks, past and future. Example: The softfork to remove the integer overflow bug. The softfork applies to all blocks with a timestamp after a flag day. Example: The initial form of BIP30 was applied to all blocks with a timestamp later than 1331769600. (March ...


4

Do full nodes have any incentive to validate transactions they're not directly benefiting from? Yes. If they did not validate all blocks and transactions, they could end up on a blockchain fork which could be facilitated by an attacker. Validating all blocks and transactions allows them to be sure that the node is on the right blockchain. How often do ...


4

No, there is no such mechanism. Bitcoin leaves each miner entirely free to decide how to include valid transactions in the blocks they mine however they choose. With less than 51% of mining power conspiring, at worst they could make transactions take about twice as long. With more than 51% of mining power conspiring, bitcoin loses a lot of its desirable ...


4

As more transactions are added to the block chain, does each individual transaction (ie. I send a bitcoin to a friend) get more expensive (in terms of FLOPS) to verify and commit to the chain? No, it does not get more expensive in terms of anything. It especially does not get more expensive in terms of FLOPS because there are no floating point operations in ...


4

The blockchain consists of blocks which are collections of transactions. The blockchain is a linked list; each block has 0 or 1 previous blocks and 0 or 1 following blocks. A transaction chain is a chain of transactions which is completely independent of the blockchain. A transaction chain is a directed acyclic graph; each transaction must have one or more ...


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