익명 03:06

How do nodes fetch unconfirmed transactions?

How do nodes fetch unconfirmed transactions?

I'm taking up a project to build a software in python to mine cryptocurrency (preferably bitcoin). I have an overview of the computation that needs to be done.

I would like to know how nodes fetch unconfirmed transactions.



Top Answer/Comment:

In brief you would use your Bitcoin libraries functions to perform peer discovery and then periodically communicate with a few peers to collect data.

Your question isn't an exact duplicate of any question I can find but existing answers to the following questions will help:

  • How transaction happen in blockchain?
  • How do Bitcoin clients find each other?
  • How are transactions broadcast to the rest of the network?
  • How does a node get information from other nodes?

Other useful resources

  • https://en.bitcoin.it/wiki/Protocol_documentation
  • https://developer.bitcoin.org/devguide/p2p_network.html
    This covers the following topics
    • Peer discovery
    • Connecting to peers
    • Initial Block download
    • Block broadcasting
    • Transaction broadcasting
      This is the part where your node listens for inv messages and issues corresponding messages such as getdata.
상단 광고의 [X] 버튼을 누르면 내용이 보입니다