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

Reply to this note

Please Login to reply.

Discussion

No replies yet.