1

Suppose a node begins broadcasting a signed transaction.

Question 1. At what stage is the signature verified? In §5 of the whitepaper, verification only appears during block acceptance after mining. Isn't it more sensible for a node to verify the signature on any transaction it tentatively places in a block?

Question 2. For how long does a node broadcast a transaction? How does it know when to stop broadcasting a transaction, either because it was accepted, or because it is invalid?

1 Answer 1

3

The whitepaper is only a high-level overview of Bitcoin, basically a marketing document. You may be interested in this errata and associated comments for the whitepaper created by David Harding.

Every node will verify the signatures on a transaction when it first receives it. If the transaction is deemed valid and passes is_standard policies, the node will then add the transaction to its mempool and relay it to the node's peers. The node will cache the result of the transaction verification for some time, to be able to skip repeating this check if the transaction is included in a block soon after.

A node will only rebroadcast a transaction once to all of its peers. However, the receivers and senders of transactions may rebroadcast transactions more often given their personal investment in the transaction's success if it doesn't confirm promptly.

8
  • 2
    The receiver's wallet may also rebroadcast regularly. Mar 17, 2022 at 20:27
  • Thanks for the very instructive answer! A few follow-ups. 1. So how does a transaction enter the network? Is it broadcast by something other than a node at first? 2. You wrote a node rebroadcasts once - I'm assuming this refers to verified transactions. What about signed-but-unverified transactions? 3. How does a node know when to use the single rebroadcast?
    – user516728
    Mar 17, 2022 at 22:00
  • A wallet creates the transaction and submits it to at least one Bitcoin Node. Bitcoin Core nodes track all the Unspent Transaction Outputs, i.e. all pieces of bitcoin that are available for spending, so each node can unilaterally assess whether a transaction could currently be included in the blockchain. That's the check that each node performs on unconfirmed transactions when it receives them. Then the node will forward the unconfirmed transaction once to each of its peers, right after receiving it and deeming it valid.
    – Murch
    Mar 17, 2022 at 22:36
  • 1
    I don't know what you mean with "verified" and "signed-but-unverified" transactions. Bitcoin nodes will simply discard any transactions they assess to be invalid, and only forward valid transactions. When a transaction is included in the blockchain it's confirmed, which means it's probabilistically final and gets "more final" the more blocks get found (i.e. unchangeable unless the chaintip gets reorganized which happens seldom, and less likely the more other blocks have followed).
    – Murch
    Mar 17, 2022 at 22:38
  • Anyway, since each node forwards each of the unconfirmed transactions it sees to all of its peers, (or rather, offers to forward them via an inventory announcement), the transactions get gossiped through the network and generally every other online node should hear about them within a minute or so. Nodes that aren't online don't get them until they're included in a block, since everyone gets every block when they synchronize with the network to catch up to the chaintip. You may also find this post interesting: bitcoin.stackexchange.com/q/12427/5406
    – Murch
    Mar 17, 2022 at 22:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.