Skip to content

feat(qt): DashPay usernames, contacts and contact payments - #7671

Draft
PastaPastaPasta wants to merge 10 commits into
dashpay:developfrom
PastaPastaPasta:feat/platform-sdk-gui
Draft

feat(qt): DashPay usernames, contacts and contact payments#7671
PastaPastaPasta wants to merge 10 commits into
dashpay:developfrom
PastaPastaPasta:feat/platform-sdk-gui

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

Stacked on #7623#7669#7670 (their commits come first; review the last two commits). Replaces #7627, carried over unchanged apart from the seam to the SDK-backed client library. Tracking: #7512.

This adds the DashPay GUI itself: username registration (identity + DPNS), a DashPay dashboard with profile, contacts (contact requests over encrypted DIP-15 xpubs), seed-only recovery and send-to-username contact payments, all inside --enable-platform-gui, default off.

What was done?

  • Wallet seams (feat(wallet) commit, identical to feat(qt): DashPay usernames, contacts and contact payments #7627's): createAssetLockTransaction at the payload version consensus accepts (v1 until the v24 fork applies to the next block, v2 after; covered in evo_assetlocks_tests) and a commitTransaction overload surfacing the mempool/broadcast error to the caller. Wallet-type-agnostic and flag-independent.
  • src/qt/platform/: PlatformService, IdentityFlow, CreateUsernameWizard, contacts (model/page/picker, encrypted-xpub contact requests, DIP-15 receiving-chain import), PlatformRecovery, profile dialog; DashPay tab, send-to-username, options toggle, URI validator; descriptor-wallet-only gate. All as in feat(qt): DashPay usernames, contacts and contact payments #7627.
  • Seam changes: the page constructs the SDK-backed client with the network's Platform LLMQ type; the five state-transition builder call sites pass the client's SDK handle; the Qt link lines lose mbedtls. Nothing else in the GUI changed, because the PlatformClient interface it programs against did not.

How Has This Been Tested?

  • Locally on aarch64-apple-darwin: dash-qt builds and links the SDK archive (Security + CoreFoundation only), test_dash-qt builds and passes.
  • The feat(qt): DashPay usernames, contacts and contact payments #7627 history applies: a 9-agent review round, thepastaclaw rounds, and a live-testnet E2E (identity registration → DPNS username → contact request round-trip → contact payment through the actual dash-qt UI) against the previous client library. The GUI code paths are unchanged; the client library underneath them is new and was exercised method by method against live testnet from C++ (see feat: Dash Platform client library over the Platform SDK behind --enable-platform-gui #7670).
  • Not done yet: the GUI-driven testnet E2E on this exact branch (descriptor wallet). Planned before undraft, with screenshots.

Breaking Changes

None. Default builds are unaffected; the feature is behind --enable-platform-gui.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

native_rust installs the pinned prebuilt Rust toolchain as a native package and rust_stdlib provides the precompiled standard library for every supported cross target; contrib/devtools/update-rust-hashes.py maintains both pins together.

funcs.mk gains a cargo environment wired to the depends cross toolchain and a per-package crate-vendoring template: any package that declares a vendored archive name and a cargo manifest gets its vendored-crate archive modeled as a real make target, created by cargo vendor when absent and required by the package's preprocess stamp and by make download, so a clean build can never reach the offline cargo build without vendored sources. Preprocessing extracts the archive and generates a rustc linker wrapper that preserves the full configured compiler command (target and sysroot flags, and any env prefix), since -C linker= takes a single executable.
…I knob

PLATFORM_GUI=1 adds mbedtls, native_protobuf, tenderdash_sources and platform_cxx to the package set. platform_cxx builds libdash_platform_cxx.a and its installed headers from a pinned dashpay/platform commit (packages/rs-platform-cxx), offline via the per-package vendored crates. config.site.in exports enable_platform_gui and PLATFORM_CXX_{CFLAGS,LIBS} discovery for the configure flag that arrives with the first C++ consumer.
…lane

The new lane builds depends with PLATFORM_GUI=1 (producing and hash-verifying the Platform CXX archive offline from vendored crates), then builds dash-qt against that prefix and runs the unit tests. The cache-sources producer generates and caches the platform-cxx vendored-crates archive, handing it to same-run consumers as an artifact on cache miss.

The --enable-platform-gui configure flag is added to this lane's BITCOIN_CONFIG by the Platform client library PR; until then the lane proves the depends knob and prefix link-compatibility. build.yml runs PR validation from the base branch (pull_request_target), so the lane first runs on push CI for this branch and takes effect for PRs after merge.
The all-target rust-std downloader wrote directly to the final source-cache path and treated any existing file as complete, so a partial file left behind by an interrupted download made every subsequent 'make PLATFORM_GUI=1 download' fail on the same archive until it was removed by hand. Verify an existing archive against the pinned hash and re-fetch it when it does not match, downloading to a temp path and only moving a verified archive into place, matching fetch_file_inner.
…ry is missing

Inside a Guix environment there are no default loader search paths, so a toolchain staged without libgcc_s/libz next to it is nonfunctional and would be cached in that state. Treat a missing required runtime library as a staging failure there, consistent with the existing fatal patchelf check; outside Guix it remains a warning since the system loader can still resolve the libraries.
The linker wrapper carries a shebang, so the lint-files check requires the executable bit; cargo invokes it through the RUSTFLAGS -C linker= path either way.
…crate

dashpay/platform#4633 rebuilds the Platform CXX bindings as a thin bridge over dash-sdk: the SDK owns DAPI transport, retries and proof verification, and Core supplies endpoints, quorum keys, its ChainLock height and wallet signatures. The crate is an ordinary workspace member now, so the package vendors from the workspace root (the lockfile made vendorable by dashpay/platform#4631), builds with -p dash-platform-cxx, and installs the header tree the crate's build.rs stages plus the static archive; the nested standalone manifest and install.sh are gone with the old design.

mbedtls leaves depends: the SDK carries its own TLS stack (rustls with the system trust store), so Core no longer links a TLS library for Platform. The vendoring config gains the workspace's git sources.

Validated on aarch64-apple-darwin: make -C depends PLATFORM_GUI=1 platform_cxx vendors 840 crates (150 MB archive) and builds the crate offline in 3 minutes; the staged prefix carries include/dash/platform/{ffi.h,signer.h}, include/rust/cxx.h and lib/libdash_platform_cxx.a. The knob-off package set is unchanged.
…ble-platform-gui

The Qt-free client library dash-qt drives for DashPay: per-network parameters and system contract ids, the PlatformClient interface, DPP decoding and state-transition adapters, and the wallet record formats. Where the earlier revision (dashpay#7626) carried its own gRPC-Web/TLS transport, hand-written protobuf and CBOR encoders, per-endpoint retry and freshness tracking, and handed request/response byte pairs to a transport-free verifier, this one is a thin consumer of the Dash Platform SDK through dash-platform-cxx (dashpay/platform#4633). The SDK owns query construction, DAPI transport, retries with address banning, proof verification (GroveDB replay plus the Tenderdash quorum signature against the keys this node pushes from its LLMQ store), protocol-version tracking and the chain-id and ChainLock freshness checks; the node supplies evonode endpoints from its deterministic masternode list, the Platform quorum keys, its best ChainLock height and wallet signatures through a digest callback, so private keys never leave the wallet.

The PlatformClient interface the GUI programs against is unchanged apart from gaining an sdk() accessor; the production implementation keeps its single worker thread and callback marshalling and forwards each query to the SDK handle. Absence stays proven, never inferred: an empty result only reaches a callback after the SDK verified a proof of it. The DPP decoders and state-transition builders take the SDK handle so they build under the protocol version the SDK has seen the network run, ratcheted up from the per-network floor in params.cpp. The C++ transport, protobuf, CBOR, retry and freshness code and their unit tests are gone with the design; the DPP byte-exactness suite and the wallet key tests stay, and the fuzz harness keeps the decoder targets (proof verification is fuzzed upstream).

Validated on aarch64-apple-darwin against a depends prefix carrying the SDK-backed archive: configure detects the bindings, libdash_platform.a and test_dash build, platform_dpp_tests and platformkeys_tests pass.
createAssetLockTransaction builds and funds an asset lock paying credits to a Platform funding key, at the payload version consensus accepts: version 2 is invalid until the v24 hard fork applies to the next block, and version 1 stays valid after activation, so a transaction built at the boundary is safe either way. CommitTransaction gains an optional broadcast_error out-parameter and a matching interfaces::Wallet::commitTransaction overload: a mempool rejection is reported to the caller instead of only the log, while the transaction stays committed to the wallet so the caller may abandon it. Both seams are wallet-type-agnostic and compiled unconditionally.
The DashPay GUI: username registration (identity + DPNS), a dashboard with profile, contacts over encrypted DIP-15 xpubs, seed-only recovery and send-to-username contact payments, all inside --enable-platform-gui (default off). Carried over from dashpay#7627 unchanged apart from the seam to the client library: the service constructs the SDK-backed client with the network's Platform LLMQ type, and the state-transition builders take the client's SDK handle so transitions are built under the protocol version the SDK has seen the network run. The Qt link lines lose mbedtls, which left depends with the C++ transport.

Validated on aarch64-apple-darwin: dash-qt builds and links the SDK archive (Security + CoreFoundation frameworks only), the DashPay tab, wizard and flows compile against the unchanged PlatformClient interface.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant