Profile: 50bdea8d...
hmm.. FPPS doesn’t really make sense for a DATUM pool. The pool operator doesn’t control the block template (miners do), so fee attribution is fuzzy and the variance/treasury risk sits on the pool. FPPS works today mostly because legacy pools own the template (and often a private mempool). With DATUM, per-block PPLNS fits better: pay on confirmed coinbase using a last-B-blocks (or N-difficulty) window.
Building such a pool is more grunt work, totally doable. Turning this PoC into a realistic PPLNS/(or similar) DATUM pool is mostly plumbing and ops — not research. This was the whole point about my post. If pool owners are motivated for decentralized mining where miners control template then DATUM is just ready to go.
DB-wise: keep it boring. Postgres for users/rounds/credits/payouts. If you want raw share lineage, add Timescale for a shares hypertable; otherwise store per-height aggregates only.
Got a minimal DATUM “pool” talking to datum_gateway (interop demo)
TL;DR: datum_gateway being open source is enough to build your own pool. EGPOOL is a minimal proof — not production.
Datum_gateway is open source and the protocol is right there in the code. My take: if you can read the protocol, you can build your own pool.
Before arguing, I wanted to try it. So I hacked together a tiny Python prototype called EGPOOL. It speaks the DATUM protocol and can handshake, push CONFIG, and round-trip shares with the gateway — no Ocean pool code involved.
What I proved (all from the public datum gateway code):
• Framing: 4-byte XOR’d header + payload
• Handshake:
- proto=1 HELLO: sealed to pool LT X25519, signed by client LT Ed25519
- proto=2 RESP: sealed to client SESSION X25519, signed by pool LT Ed25519
• Channel (cmd=5):
- Box(serverSessSK, clientSessPK) w/ 24-byte nonce from nk + client session pk
- Nonces increment per message (LE 6×u32)
• CONFIG 0x99: signed by pool SESSION key, applied by gateway
• Share submit 0x27 ↔ response 0x8F: round-trip works
My test setup
EGPOOL pool server <-> DATUM GATEWAY -> Bitcoin node
I connected a bitaxe miner to DATUM Gateway.
I saw gateway handshake with pool server and accepting shares from miner.
Datum Gateway logs from my run:
Handshake response received.
DATUM Server MOTD: Welcome to Python DATUM Prime (prototype)
client configuration cmd received from DATUM server
DATUM Pool Coinbase Tag: "EGPOOL"
DATUM Pool Prime ID: a1b2c3d4
DATUM Pool Min Diff: 65536
Starting Stratum v1 server
---
quick disclaimer — this is a test rig, not a real pool
This is just an interop demo to show the protocol surface is enough.
A production pool still needs all the boring-but-critical stuff: reliable networking & reconnects, user/worker auth, proper vardiff and duplicate detection, real accept/reject plumbing, accounting backed by a DB, coinbaser v2 with real splits, the 0x50 validation path (stxids → by-id → full set), signature discipline (LT vs session), rate limiting/DoS guards, key management/rotation, metrics/alerts, etc
Want to understand more about the protocol?
check my GitHub
https://github.com/electricalgrade/sv2/blob/main/doc/Datum_Protocol_Spec.md
#Bitcoin #Mining #DATUM
🧱 Selfish Mining Revisited — Deep Dive into Two Key Papers
Reclaiming Miner Sovereignty: Why Decentralized Block Construction is Crucial for Bitcoin's Future
#bitcoin #mining
👇
Mechanic you should do a video on this.
Many people think prunable means they can remove from their node. The pruning is only for utxo validation but once in block it stays there forever. This means if you run full node you will have it.
Already everyday so much junk is put in the OP_RETURN (even with <80bytes).
I run a spam check (I have a simple ML classification model )
It detects
| 🧬 Malware indicators : `MZ`, binary blobs, shellcode, etc.
| 🧱 Overly large payloads : Likely trying to store malware
| 🧾 Structured address spam: Recognizable crypto address formats
| 🧟 Botnet / C2 : Random hex data, possible signal packets
| 🧨 Garbage entropy :Nonsense strings, high entropy content

🚨 Bitcoin blocks are silently accumulating embedded data — not all of it benign.
I built a model that scans OP_RETURNs for suspicious payloads like malware, phishing links, and binary blobs. It works — and that’s the scary part.
📌 Here's why it matters:
- Today, AV/EDR systems don’t scan `.bitcoin/blocks`
- Tomorrow, they will — and when they do, infected chains could get flagged
- Nodes on cloud infrastructure (AWS, GCP) may face bans or throttling
- Centralized miners can bypass mempool policy, embedding malicious data
🧠 This is about more than spam. It's about Bitcoin's long-term health and legitimacy.
We need:
- Sensible datacarrier/mempool policies
- Transparency in block contents
- Decentralized, policy-respecting mining
Bitcoin is permissionless. Let’s not let it become indefensible.
#Bitcoin #OP_RETURN #Malware #AVDetection #Mempool #Mining #ChainSecurity #Nostr
🧪 Homomorphic Encryption over Nostr — Proof of Concept
Simulated a lightweight Nostr relay using WebSockets + a custom event kind 555 to send/aggregate homomorphically encrypted integers.
Paillier scheme, local clients, fully async, dumb relay.
Built it to explore encrypted coordination on top of Nostr.
+------------------+
| Initiator |
|------------------|
| Gen Paillier Key |
| Encrypt Value X |
| Send via Kind 555|
+--------+---------+
|
v
[ Local Relay ]
|
+-------------------+-------------------+
| | |
v v v
+--------------+ +--------------+ +--------------+
| Responder 1 | | Responder 2 | | Responder 3 |
|--------------| |--------------| |--------------|
| Receive X | | Receive X | | Receive X |
| Add secret a | | Add secret b | | Add secret c |
| Send X+a | | Send X+b | | Send X+c |
+------+--------+ +------+--------+ +------+--------+
| | |
+--------+---------+------------------+
|
v
+------------------+
| Initiator |
|------------------|
| Decrypt X+a |
| Decrypt X+b |
| Decrypt X+c |
+------------------+
🛠️ Spin up Bitcoin Knots + DATUM Gateway in Docker Compose.
No more juggling configs — just docker-compose up and you're live with a proper Bitcoin node + Datum Gateway.
🔗 https://github.com/electricalgrade/btc_datum
Built this for myself, but figured someone else might want it.
Run infra, not drama.
#Bitcoin #Nostr #Docker
🧪 Part 2: Minimal Stratum V2 Handshake (Noise XX/NX + SetupConnection)
Following up on the Noise Protocol intro — here's a small, self-contained C implementation that performs a Noise handshake (XX or NX) and exchanges Stratum V2 SetupConnection messages immediately after.
It’s built to test client/server handshake logic without needing full SV2 support or encryption on the transport layer (yet).
Just Noise + SetupConnection, using raw TCP with framed messages.
🔧 What’s included:
Minimal “pool server” (sv2_pool_server.c) that:
Accepts TCP connections
Completes a Noise handshake (XX by default, NX optional via --nx)
Decodes a SetupConnection message and responds with SetupConnection.Success
Matching client (noise_client.c) that:
Connects to the pool
Runs Noise handshake
Sends a valid SetupConnection payload
Handshake and transport logic is handled using noise-c — clean, constant-time, and easy to audit.
🔐 Handshake Patterns:
XX: Both parties are anonymous; ephemeral key exchange on both sides.
NX: Server has a static key; client is ephemeral (more realistic for mining pools).
These map directly to Noise patterns (Noise_XX_25519_ChaChaPoly_BLAKE2s) and can be swapped via --xx / --nx.
🧰 Framing and Messages:
Transport uses simple framing: uint16_be length prefix + payload.
After handshake, we send:
SetupConnection (client → server)
SetupConnection.Success (server → client)
These are built using SV2 helpers (sv2_common.[ch], sv2_wire.[ch]) to encode/decode the frames.
🔄 Example Usage:
Start the pool server:
./sv2_pool_server -l 0.0.0.0:3334 --prologue STRATUM/2 --sk
Start the client:
./noise_client -l 127.0.0.1:3334 --prologue STRATUM/2
Both ends should print confirmation of the handshake and the SetupConnection exchange.
🚫 What's intentionally missing (for now):
No full SV2 session yet (no channel open, no job distribution)
No post-handshake encryption of transport messages
No persistent session keys or reconnection logic
This is by design — the goal is to test handshakes + basic SV2 flows before introducing more complexity. Once the handshake layer is stable, you can drop in encrypted transport using sv2_noise_send_transport() and sv2_noise_recv_transport() provided in the demo.
💡 I’m using this for testing SV2 client implementations and validating message formats over raw TCP before wiring into a full miner or pool stack.
This is all part of adding SV2 mining protocol support to Datum gateway.
I already have a SV1 to SV2 translator. Now adding SV2 server features.
#noiseprotocol #stratumv2 #miningprotocol #bitcoinmining #handshake #cryptography #protocoltesting #cprogramming #securecommunications #nostrdev #decentralization #packetengineering #DLT
Here is the git hub to quickly get knots+datum running.
Tested this on Mac, arm64 and x86
#bitcoin
Built Bitcoin Knots (v28.1.knots20250305) from source in a clean Docker container 🚀
- Ubuntu 22.04 base
- Wallet disabled (--disable-wallet)
- Auto builds from official Knots repo
- Clean & reproducible setup
- bitcoind ready out-of-the-box
💡 Useful for devs, testers, node runners
#Bitcoin #BitcoinKnots #Docker #Nostr
Source & Dockerfile:
https://github.com/electricalgrade/bitcoin/tree/28.x-knots/docker
Noise Protocol: A Minimal and Modular Cryptographic Tool
Been working with the Noise protocol recently — here’s a quick breakdown of what it does and how it works under the hood.
Noise is a small framework for building secure handshakes. It’s not a full protocol like TLS, more like a toolkit to define your own. It handles the initial key exchange, identity/auth, and gives you encrypted transport keys after the handshake. That’s it. No certificates, no extensions, no middleboxes.
Each handshake in Noise is built using a "pattern" — I’ve been using XX and NX. These define how the keys are exchanged:
* XX: both sides are anonymous, and exchange keys during handshake.
* NX: responder has a static pubkey, initiator is ephemeral (closer to client-server flows like SV2).
Behind the scenes, these patterns are just sequences of Diffie-Hellman operations between the parties' keys (ephemeral and static), and the handshake hash is updated after each message. Once complete, both sides split the final hash into two symmetric cipherstates, and that’s what’s used to encrypt transport messages.
All operations are constant-time. I’m using the `noise-c` library, which supports `Noise_XX_25519_ChaChaPoly_BLAKE2s` (or SHA256 if you tweak the suite string). Noise defines the handshake state machine, but the crypto primitives are pluggable.
The nice part is that everything’s deterministic and testable. Given the same inputs, the handshake always produces the same shared keys. It’s all pure key material — no ASN.1, no PEMs, no handshake extensions to worry about.
In the next post, I’ll show a tiny C implementation that wraps a Noise handshake (XX or NX), and exchanges Stratum V2 `SetupConnection` messages post-handshake. Useful for testing your own SV2 client/server implementations.
#noiseprotocol #cryptography #infosec #keyexchange #stratumv2 #miningprotocol #cprogramming #protocolengineering #decentralization #bitcoin #nostrdev #datumgateway #DLT #securecommunication #networkprotocols
Just a quick reminder — I created Nostr Bot to share a few useful and curated updates on the Nostr network, and I’m excited for you to follow it!
It’s built using Python and uses Nostr to post updates directly to my self-hosted relay. This means it won’t spam anyone, and once you follow the bot, you’ll get periodic updates without the clutter.
I also use n8n for all automation.
Here’s what the bot will share:
1) Machine Learning News: Regular updates from the MachineLearning subreddit, keeping you up to date with the latest trends and discussions in the field.
2) Daily AI-Powered Research Summaries: Every morning, I post a summary of the latest arXiv Deep Learning papers. I use my local AI model to condense the key points, making it easier for you to stay informed.
3) USD to SAT Exchange Rate: Every 12 hours, I share the latest conversion of 1 USD to SATs. This helps you keep track of the market movements, especially if you're into crypto.
4) Ocean Pool Block Updates: Every time the Ocean pool finds a new block 🧱, I’ll notify you with the update. This is useful for miners and crypto enthusiasts alike.
The bot is efficient and non-intrusive—it posts only to my relay, so once you follow it, you won’t be bombarded with constant messages.
If you're interested, follow my Nostr Bot and get these updates directly from my relay! It’s a simple, clean way to stay updated on these topics without any noise.
#nostr #bot #machinelearning #arxiv #bitcoin #mining #oceanpool #DL #NostrRelay
EGBot: npub13ktz9vxqyvmvnsmr7url6zy2sxaxl7ugkw3xdswp8w5ztsuapayqp9xv6t
Continuing on my journey of adding Stratum V2 (SV2) support to Datum Gateway (focused on the mining protocol), the first step is getting the connection setup between the SV2 server and the miner (client) working.
It uses noise protocol.
This weekend, I got this connection setup working (see below).
I’ll be writing two posts on the current progress.
In the first post, I’ll explain how the Noise handshake works, the cryptographic primitives behind it, and why it's a great fit for securing communication. I'll also dive into key concepts like Diffie-Hellman and ephemeral keys.
In the second post, I’ll walk through a simple C implementation where we use the Noise handshake to exchange SV2 SetupConnection messages. This will show how Noise can be integrated into a real-world Stratum V2 mining pool setup.
This will be useful for anyone working with mining infrastructure or interested in the cryptographic side of things. Stay tuned for the full details!
Here is current progress!
[pool] listening on 0.0.0.0:3334 (pattern=NX, prologue="STRATUM/2")
[pool] static pubkey: 39c0a192403e698f375524d21594068c5ac693137898582d054b052cddb7da47
[pool] handshake complete
[pool] SetupConnection: protocol=2 min=2 max=2 vendor="c-noise-client"
[pool] sent SetupConnection.Success (version=2 flags=0x00000000)
[client] handshake complete
[client] SetupConnection.Success used_version=2 flags=0x00000000
#cryptography #mining #stratumv2 #NoiseProtocol #DatumGateway #SV2 #Nostr #miningprotocol #blockchain
working on adding support of sv2 to Datum (only mining protocol)
a small, self-contained C library for SV2 wire handling, with a minimal evented adapter integrated into DATUM. This brings upstream/downstream SV2 compatibility while preserving the SV1 path.
✅ Core library in C (wire framing, message helpers)
✅ Thin evented server: accept SV2 clients, handle Setup/Open/Submit
✅ Python SV1↔SV2 bridge for testing (no miner firmware changes) for my standalone testing.
and some initial results here
SV2 server (dummy)
[sv2-dummy] client ('127.0.0.1', 52379) connected
[sv2-dummy] <- ext=0x0000 msg=0x00 pay=17 bytes hex=0000001100000c646174756d2d62726964676500000000...
[sv2-dummy] -> SetupConnection.Success used_version=2 flags=0
[sv2-dummy] <- ext=0x0001 msg=0x20 pay=8 bytes hex=010020080000010000000000c842...
[sv2-dummy] (noop) ext=0x0001 msg=0x20
SV2-SV1 bridge for my testing
[bridge] SV1 client connected: ('0.0.0.0', 54730)
[sv1] <- ('', 54730) {"id": 1, "method": "mining.subscribe", "params": ["cpuminer/2.5.1", "b10cf00c1"]}
[sv1] -> ('', 54730) {"id":1,"result":[[["mining.notify","b10cf00c1"],["mining.set_difficulty","b10cf00c2"]],"b10cf00c",8],"error":null}
[sv1] -> ('1', 54730) {"id":null,"method":"mining.set_difficulty","params":[1024]}
[sv1] (seed) dummy job_id=e1ad9163 ntime=68a549f7
[sv1] -> ('1', 54730) {"id":null,"method":"mining.notify","params":["e1ad9163","0000000000000000000000000000000000000000000000000000000000000000","01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1042524447","ffffffff010000000000000000015100000000",[],"20000000","1d00ffff","68a549f7",true]}
and the miner (SV1)..
* Trying .0.0.167:13333...
* Connected to 0.0.167 (0.0.167) port 13333 (#0)
* Connection #0 to host 0.0.167 left intact
[2025-08-20 05:07:19] > {"id": 1, "method": "mining.subscribe", "params": ["cpuminer/2.5.1", "b10cf00c1"]}
[2025-08-20 05:07:19] < {"id":1,"result":[[["mining.notify","b10cf00c1"],["mining.set_difficulty","b10cf00c2"]],"b10cf00c",8],"error":null}
[2025-08-20 05:07:19] Stratum session id: b10cf00c1
[2025-08-20 05:07:19] > {"id": 2, "method": "mining.authorize", "params": ["", ""]}
[2025-08-20 05:07:19] < {"id":null,"method":"mining.set_difficulty","params":[1024]}
[2025-08-20 05:07:19] Stratum difficulty set to 1024
[2025-08-20 05:07:19] < {"id":null,"method":"mining.notify","params":["e1ad9163","0000000000000000000000000000000000000000000000000000000000000000","01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1042524447","ffffffff010000000000000000015100000000",[],"20000000","1d00ffff","68a549f7",true]}
[2025-08-20 05:07:19] < {"id":2,"result":true,"error":null}
[2025-08-20 05:07:19] DEBUG: job_id='e1ad9163' extranonce2=0000000000000000 ntime=68a549f7
#bitcoin #Datum
until now all contributions were first sent to core and Luke would merge them to knots. But recent core attitude of rejecting patches that would make forking easier means in future, things may change and devs will be encouraged to directly push patches to knots.
I am personally working on creating a consensus only lib which will be same code base as core but this will allow easier integration of polyglot clients. This way we only "agree" on consensus code and can have our own mempool/wallet etc implementation. people can then choose any non-consensus related implementations and all use the same consensus implementation. I have started looking at the libbitcoinkernel project
This will make maintaining much easier..
🧠 Just built a lightweight Heartbeat Dashboard for monitoring Stratum miners!
⛏️ Designed to auto-check active clients from journal logs and optionally restart the gateway.
🖥️ Web dashboard + auto backoff + warning when no miners connected.
🛠️ Written in Python. .
https://github.com/electricalgrade/datum_dash
📝 Check it out: #opensource #bitcoin #stratum #mining #nostr #datum
Bitcoin is rules without rulers — but only if miners don’t outsource the rules.
I summarize two key papers that reveal how attackers exploit fee volatility and network latency to profitably destabilize mining — often without detection.
Decentralization is our immune system. More details in the article below.
#Bitcoin #Mining #SelfishMining #Decentralization #DATUM #Security #ProofOfWork #arXiv #Nostr #CensorshipResistance #Crypto
🧠 My Nostr Bot Posting Reddit Content!
Hey ! I’ve extended my bot that automatically posts content from the r/nostr subreddit to my own self-hosted Nostr relay.
🛰️ What it does:
Pulls fresh content from the nostr subreddit (using n8n workflow)
Publishes it as Nostr notes using my own relay
Posts only to my own relay to keep the network clean and spam-free
you can find my bot here
npub13ktz9vxqyvmvnsmr7url6zy2sxaxl7ugkw3xdswp8w5ztsuapayqp9xv6t
Zap or boost if you think this is cool ⚡
Today only me, as I am doing some testing. But I can open it to anyone on NOSTR maybe once I finish my testing.
I currently support the following Nostr event kinds on my self-hosted relay:
Kind 0: Metadata
Kind 1: Text Notes
Kind 2: Relay Recommendation
Kind 3: Contact List
Kind 7: Reactions
Kind 40: Channel Creation
Kind 10002: Relay List Metadata
I am a home btw miner. Started with bitaxe then nerdqaxe and nano3s. I write my journey and technical articles at https://substack.com/@electricalgrade
This is first time I am using Nostr
#introductions

