DigiByte is multi-algorithm, so this brings in six hash functions: SHA256d and Scrypt in JS, and Qubit, Skein, Groestl and Odocrypt from DigiByte Core's own C sources compiled to WebAssembly (packages/p2p/native, emscripten via docker). Each header is checked against its nBits target and the network powLimit before it can enter the chain; a peer serving an invalid or future-dated header is benched. Competing branches are accepted only when they carry more accumulated work than what they replace. npm run pow:test -w @dgb-wallet/p2p verifies real mainnet headers of all six algorithms and that a tampered header fails.
41 lines
1.2 KiB
JSON
41 lines
1.2 KiB
JSON
{
|
|
"name": "@dgb-wallet/p2p",
|
|
"version": "0.0.1",
|
|
"description": "DigiByte P2P client \u00e2\u20ac\u201d direct peer connections, BIP157/158 compact block filters, client-side address matching. The Maximum Privacy backend for @dgb-wallet.",
|
|
"type": "module",
|
|
"main": "./dist/index.js",
|
|
"types": "./dist/index.d.ts",
|
|
"exports": {
|
|
".": {
|
|
"types": "./dist/index.d.ts",
|
|
"import": "./dist/index.js"
|
|
}
|
|
},
|
|
"files": [
|
|
"dist",
|
|
"src"
|
|
],
|
|
"scripts": {
|
|
"build": "tsc",
|
|
"handshake": "tsx scripts/handshake-demo.ts",
|
|
"pool": "tsx scripts/pool-demo.ts",
|
|
"headers": "tsx scripts/header-sync-demo.ts",
|
|
"filters": "tsx scripts/filter-sync-demo.ts",
|
|
"blocks": "tsx scripts/block-fetch-demo.ts",
|
|
"cache": "tsx scripts/cache-demo.ts",
|
|
"daemon": "tsx bin/dgb-daemon.ts",
|
|
"pow:test": "tsx scripts/pow-vectors.ts"
|
|
},
|
|
"dependencies": {
|
|
"@bitcoinerlab/secp256k1": "^1.1.1",
|
|
"@dgb-wallet/core": "*",
|
|
"@noble/hashes": "^1.8.0",
|
|
"bip32": "^4.0.0",
|
|
"bitcoinjs-lib": "^6.1.7"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^20.11.0",
|
|
"tsx": "^4.7.0",
|
|
"typescript": "^5.3.0"
|
|
}
|
|
}
|