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.

  • I think that's too big a question to be answerable here. You could break your question down into much smaller parts and research those separately and ask questions here about specific individual points. See what is mining etc. Commented Feb 8, 2022 at 16:53
  • @RedGrittyBrick Thanks! Commented Feb 10, 2022 at 11:19
  • So, there are three sub problems to focus on here: 1.) Fetching unconfirmed transactions 2.) Finding the nonce for hashing based on the difficulty and creating a new block 3.) Submitting/broadcasting the new block to the network for verification. I'm stuck at subproblem 1 and 3 from a programming point of view. Commented Feb 10, 2022 at 11:24
  • You seem to be struggling a little. I will edit your question for you -- though you can do this yourself. If you don't like my edits you can use the "rollback" option under "edit". Commented Feb 10, 2022 at 11:49
  • Thanks @RedGrittyBrick for making the question more appropriate. I'm gathering a lot of info from the materials provided. Commented Feb 18, 2022 at 8:18

1 Answer 1


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:

Other useful resources

Your Answer

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

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