Check Dogecoin block headers yourself: a light node that downloads headers from peers and verifies the proof of work on your own computer.
Live demo · Documentation · All DogeJS projects
- Connects to Dogecoin peers over the peer-to-peer protocol, from DNS seeds or the peers you name.
- Downloads block headers only (80 bytes each, about 470 MB for the whole chain) and checks every one: proof of work, difficulty, merged-mining (AuxPoW) proof, checkpoints and timestamps.
- Follows the chain with the most work and reports "synced" only when enough peers agree.
- Checks a transaction against a verified header with a merkle proof (
gettxoutproof). - Has a pure verification entry (
@dogejs/node/verify, about 40 KB, no sockets, no storage) that also runs in a browser or a worker.
Verify a real mainnet block header in your browser, check a merkle proof and follow a simulated sync: https://dogejs.com/node/
npm install github:DogeJS-Dev/light-node#v0.2.1Check a merkle proof against a real mainnet block, then change one byte.
Follow a simulated sync step by step, including a peer that sends false proof of work.
Nothing is on npm yet, so install straight from this repository (it needs a public repository, or a GitHub login that can read it). The prepare script builds dist as part of the install. Syncing needs Node.js 20 or later, because browsers cannot open the raw TCP connections that Dogecoin peers use.
npm install github:DogeJS-Dev/light-node#v0.2.1Open a header store and read the testnet genesis block (this runs with no network):
import { getChainParams, HeaderChain } from '@dogejs/node';
import { mkdtempSync, rmSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
const dir = mkdtempSync(join(tmpdir(), 'dogejs-node-'));
const chain = HeaderChain.open(getChainParams('testnet'), dir);
console.log(chain.height, chain.tip.hashHex); // 0 bb0a78264637406b6360aad926284d544d7049f45189db5664f3c4d07350559e (the testnet genesis block)
chain.close();
rmSync(dir, { recursive: true });To sync without the real network, start the bundled fake regtest peer and sync from it:
node examples/fake-peer.mjs 28444 300 &
node dist/cli.mjs sync --network regtest --peer 127.0.0.1:28444 --exit-when-syncedThe node asks peers for headers, checks each one in the order Dogecoin Core checks them, keeps the chain with the most work, and verifies proofs only against headers it checked itself. It follows the most-work header chain and cannot see invalid transactions inside a block, which is the usual light-client assumption. By default at least two peers must agree before it says it is synced.
The full reference is in docs/REFERENCE.md.
- Built on core.
- Used by the wallet, which checks confirmations with the pure verification entry, and checked against a real node by integration-tests.
Version 0.2.1. It is not published to npm yet, so you install it from git. It is experimental and has had no external security review. It has never connected to the real Dogecoin network: it was built without access to peers and is tested against Dogecoin Core's unit-test vectors, 20 real mainnet headers, genesis blocks rebuilt from Core's parameters, synthetic chains and fake peers.
Bug reports, ideas and pull requests are welcome. Read the contributing guide first: small, tested, explained.
npm install
npm run build
npm run typecheck
npm testReport a security problem privately to hello@dogejs.com, never in a public issue. See SECURITY.md.
The maintainers keep one combined development workspace for all DogeJS projects and publish each project from it as a repository of its own. An accepted pull request is applied there and appears here with the next release.
MIT, see LICENSE. Bundled third-party code, where there is any, is listed in THIRD_PARTY_LICENSES.



