<p>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). </p>

<p>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?).</p>

<p>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.</p>

<p>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.</p>

CC BY-SA 4.0
2019-08-27T21:27:14.067Z
2019-08-27T21:27:14.067Z
chytrik
<p>How do I verify a unconfirmed transaction using <strong>JavaScript</strong> ?</p>

CC BY-SA 4.0
2019-08-27T20:37:40.500Z
To verify any transaction, you must be running a full node. Since you mention JavaScript, you might be interested in bcoin: https://github.com/bcoin-org/bcoin
pinhead
CC BY-SA 4.0
2019-08-27T20:39:41.613Z
@pinhead Please share some demo codes.
Hide7
CC BY-SA 4.0
2019-08-27T21:08:03.937Z
There’s more docs and guides at https://bcoin.io if you can’t find what you need there, join our slack or chat with us on IRC #bcoin
pinhead
<mining-reward><javascript>
JavaScript Mining System Design
Hide7
# JavaScript Mining System Design

(Asked by: username_0 on 2019-08-27)

How do I verify a unconfirmed transaction using **JavaScript** ?

**Tags:** mining-reward, javascript

> **Comments:**
> **username_1**: To verify any transaction, you must be running a full node. Since you mention JavaScript, you might be interested in bcoin: https://github.com/bcoin-org/bcoin  
> **username_0**: @username_1 Please share some demo codes.  
> **username_1**: There’s more docs and guides at https://bcoin.io if you can’t find what you need there, join our slack or chat with us on IRC #bcoin  

---

## 1 answers

### Answer by username_2 on 2019-08-27. Score: 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.


---

