Repository navigation
Commit d855a77
committed
feat(sdk): add CXX bindings over dash-sdk for C++ embedders
A C++ application that wants Dash Platform with its own trust context and signing keys had no supported path: rs-sdk-ffi is a C ABI shaped for mobile wallets that fetch quorum keys from a trusted HTTP service and hold private keys in-process. Dash Core's platform GUI needs the opposite: quorum keys from its locally synced LLMQ store, endpoints from its deterministic masternode list, signatures from its wallet, and no key or trust ever leaving the node.
packages/rs-platform-cxx is a thin cxx bridge over dash-sdk. The embedder pushes endpoints, Platform quorum keys, its best ChainLock height and a digest-signing callback; the SDK owns query construction, transport (TLS to the evonodes), retries with address banning, proof verification and protocol-version tracking. Queries go through the SDK's Fetch/FetchMany so the rich query it built is what it verifies against; no wire request is ever reconstructed from bytes. On top of the SDK's signed-time window and monotonic Platform height, the client refuses a verified response whose Tenderdash chain id is not the network's or whose signed core-chain-locked height trails the embedder's ChainLock by more than 288 blocks. Every bridge entry point runs under catch_unwind, so a panic anywhere in the SDK surfaces as rust::Error rather than aborting the embedding process; the crate refuses to build under panic=abort.
Document assembly is dash-platform-queries' pure DPNS/DashPay builders; signing is dpp's Signer over the callback, with dash-sdk's structure validation before serialization. Broadcast rejections carry DAPI's consensus error decoded through the SDK's error conversion.
Tests replay drive-proof-verifier's proof-vector corpus through dash-sdk's mock transport (only the socket is mocked; the SDK runs the GroveDB replay and the BLS quorum check against the key pushed through the client) and cover unknown quorum key, wrong quorum type, tampered signature, foreign chain id, the ChainLock staleness floor, the height watermark surviving an SDK rebuild, cancellation and input bounds; builders are pinned byte for byte against rs-dpp-generated vectors; tests/cxx_smoke.cc links and runs from C++ in CI. Validated against live testnet from a release-built C++ driver: identity, nonce, DPNS resolve (registered and proven absent), names-of-identity, prefix search, profile, contact requests, contested vote state and a rejected broadcast all verify in 0.3 to 2 s; bit-flipped quorum keys fail at the BLS check.1 parent 0631c07 commit d855a77
27 files changed
Lines changed: 5021 additions & 12 deletions
File tree
- .github
- package-filters
- workflows
- packages
- dash-platform-queries
- rs-platform-cxx
- include/dash/platform
- scripts
- src
- test_data
- tests
- common
- rs-sdk
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
124 | 127 | | |
125 | 128 | | |
126 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
133 | 144 | | |
134 | 145 | | |
135 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
158 | 170 | | |
159 | 171 | | |
160 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
229 | 236 | | |
230 | 237 | | |
231 | 238 | | |
| |||
342 | 349 | | |
343 | 350 | | |
344 | 351 | | |
| 352 | + | |
345 | 353 | | |
346 | 354 | | |
347 | 355 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | 30 | | |
35 | 31 | | |
36 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
0 commit comments