Author

Topic: How are unconfirmed transactions relayed? (Read 1033 times)

legendary
Activity: 2618
Merit: 1007
Relays don't need that much protection, the new default setting is not a hard standard (and there is actually an incentive to set this to 21 million for anyone who doesn't mine...) and in my opinion I'd rather have a measurement/setting based on transaction size and UTXO set impact than transacted amount...
sr. member
Activity: 420
Merit: 250
How do you come to this conclusion?
It costs spammers much more to get junk transactions verified.
However, fees don't protect relays. Hopefully, the new minimum transaction amount will in the future.
legendary
Activity: 2618
Merit: 1007
How do you come to this conclusion?
sr. member
Activity: 420
Merit: 250
If it's adding unconfirmed tx's to the memory pool, couldn't a person attack via this way?  Everyone adds all the BS spam tx's and it overloads?

As I already wrote above, there are no "BS spam tx" - they either really do cost real coin or are not relayed if your client deems them to be "BS". If a client sends you a lot of these (to DoS you maybe), your client will simply cut the connection to that one and move on with it's life.
And transactions fees serve as DoS protection!
hero member
Activity: 756
Merit: 501
There is more to Bitcoin than bitcoins.
legendary
Activity: 2618
Merit: 1007
If it's adding unconfirmed tx's to the memory pool, couldn't a person attack via this way?  Everyone adds all the BS spam tx's and it overloads?

As I already wrote above, there are no "BS spam tx" - they either really do cost real coin or are not relayed if your client deems them to be "BS". If a client sends you a lot of these (to DoS you maybe), your client will simply cut the connection to that one and move on with it's life.
hero member
Activity: 784
Merit: 1000
A bit off-topic, sorry OP. But I always wonder why can't merchants just reject/put on hold transactions from addresses with still unconfirmed transactions to prevent race-attacks? Should be a fair request with a deterministic wallet as it's recommended to use every address only once.
legendary
Activity: 1190
Merit: 1000
www.bitcointrading.com
Your node (node here refers to full node i.e. running bitcoin-qt client or bitcoind) has connections with multiple clients.  When your node learns of a new tx (including one you create) it relays it to all the peers it is connected to.  Those peers verify the tx and relay it to all peers they know, who do the same.

All nodes all new unconfirmed tx to the memory pool which is just a list of tx the node "knows about".  Miners (in case of pool mining it is the pool actually doing the mining) use their copy of the memory pool to decide which tx to include in the next block they are working on.

When a miner broadcasts a block the same process happens at the block level.  The node relays the block to all its peers who verify the block and relays it on.

When your node confirms that a new block extends the longest chain it removes all the tx from the memory pool (as they are now unconfirmed).  If a new block orphans an existing block your node will add back any tx from the orphaned block to the memory pool and then remove any tx from the memory pool in the new block.

TL/DR: all nodes maintain a list of unconfirmed tx and relay them to another nodes.
Node learns of a new tx - add to memory pool
Node learns of a new block on longest chain - remove tx in block from memory pool
Node leans an existing block on the longest chain has been orphaned - add orphaned block's tx back to memory pool

If it's adding unconfirmed tx's to the memory pool, couldn't a person attack via this way?  Everyone adds all the BS spam tx's and it overloads?
sr. member
Activity: 420
Merit: 250
How is the data transmitted in a decentralized way? Please be as technical as possible. Smiley

Did you check this page yet?
Just read. Thanks for the link.
sr. member
Activity: 420
Merit: 250
Your node (node here refers to full node i.e. running bitcoin-qt client or bitcoind) has connections with multiple clients.  When your node learns of a new tx (including one you create) it relays it to all the peers it is connected to.  Those peers verify the tx and relay it to all peers they know, who do the same.

All nodes all new unconfirmed tx to the memory pool which is just a list of tx the node "knows about".  Miners (in case of pool mining it is the pool actually doing the mining) use their copy of the memory pool to decide which tx to include in the next block they are working on.

When a miner broadcasts a block the same process happens at the block level.  The node relays the block to all its peers who verify the block and relays it on.

When your node confirms that a new block extends the longest chain it removes all the tx from the memory pool (as they are now unconfirmed).  If a new block orphans an existing block your node will add back any tx from the orphaned block to the memory pool and then remove any tx from the memory pool in the new block.

TL/DR: all nodes maintain a list of unconfirmed tx and relay them to another nodes.
Node learns of a new tx - add to memory pool
Node learns of a new block on longest chain - remove tx in block from memory pool
Node leans an existing block on the longest chain has been orphaned - add orphaned block's tx back to memory pool

Thank you very much!
I've tried googling "bitcoin network protocol", and read the wiki. I still have one more question.
How do nodes learn about other nodes? Is it via trackers, similar to BitTorrent? However, trackers would require some form of centralization. I'm curious about this.
kjj
legendary
Activity: 1302
Merit: 1026
How is the data transmitted in a decentralized way? Please be as technical as possible. Smiley

Did you check this page yet?
legendary
Activity: 2618
Merit: 1007
As far as I get it, your client will also actually take a look at the transactions, to make sure it doesn't spread fake/bogus/spamming/double-spending transactions - it will on one hand check if the script(s) of the transaction adheres to certain standards, that are deemed "safe". Also it will not allow the spreading of transactions that spend inputs that are already spent in another transaction in the memory pool.

The recent inclusion of transactions that have less than 5430 Satoshis as output in the "is not standard" category (which is blocked by default on clients to limit the capabilities of the transaction scripting language to a safe set of instructions) caused some uproar yesterday, as the option is now configurable, but not set by default at the previous implicit level of 1 Satoshi.
donator
Activity: 1218
Merit: 1079
Gerald Davis
Your node (node here refers to full node i.e. running bitcoin-qt client or bitcoind) has connections with multiple clients.  When your node learns of a new tx (including one you create) it relays it to all the peers it is connected to.  Those peers verify the tx and relay it to all peers they know, who do the same.

All nodes all new unconfirmed tx to the memory pool which is just a list of tx the node "knows about".  Miners (in case of pool mining it is the pool actually doing the mining) use their copy of the memory pool to decide which tx to include in the next block they are working on.

When a miner broadcasts a block the same process happens at the block level.  The node relays the block to all its peers who verify the block and relays it on.

When your node confirms that a new block extends the longest chain it removes all the tx from the memory pool (as they are now unconfirmed).  If a new block orphans an existing block your node will add back any tx from the orphaned block to the memory pool and then remove any tx from the memory pool in the new block.

TL/DR: all nodes maintain a list of unconfirmed tx and relay them to another nodes.
Node learns of a new tx - add to memory pool
Node learns of a new block on longest chain - remove tx in block from memory pool
Node leans an existing block on the longest chain has been orphaned - add orphaned block's tx back to memory pool
sr. member
Activity: 420
Merit: 250
Hi everyone.
I'm currently curious as to how new transactions are relayed to the clients and miners.
Without confirmations, they aren't in the blockchain. How do the miners and clients know they happened?

How is the data transmitted in a decentralized way? Please be as technical as possible. Smiley
Jump to: