How do I verify a unconfirmed transaction using JavaScript ?

  • 1
    To verify any transaction, you must be running a full node. Since you mention JavaScript, you might be interested in bcoin: github.com/bcoin-org/bcoin
    – pinhead
    Aug 27, 2019 at 20:37
  • @pinhead Please share some demo codes.
    – Hide7
    Aug 27, 2019 at 20:39
  • 1
    There’s more docs and guides at bcoin.io if you can’t find what you need there, join our slack or chat with us on IRC #bcoin
    – pinhead
    Aug 27, 2019 at 21:08

1 Answer 1


It is not possible to verify just a single transaction, without knowing the state of the network. To know the state of the network, you must verify all of it's historical transactions (aka, run a full node).

So this means it is not possible to just take a single transaction alone, and verify it using some bit of code. Rather, you will need the entire history of transactions, so that you can determine whether the transaction is valid in relation to the current state of the network (ie, does the person who is attempting to spend some coins rightfully own them?).

There are various implementations of a bitcoin node available, written in various languages. You'll want to find one that you can interact with programmatically using javascript.

EDIT: I now see you seem to be asking about building some mining software. My answer above still holds true (you'll need a full node to determine the network state and create block templates), but otherwise I think your question (build mining software) is overly broad.

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.