Skip to content

key-wallet: typed builders for provider update transactions (ProUpRegTx, ProUpServTx) #1401

Open

Description

@llbartekll

Problem

key-wallet's TransactionBuilder can carry any special payload (set_special_payload) and finish it once the inputs are selected (set_payload_finalizer), but it has no typed builder for the provider update transactions. Every consumer has to write the Dash Core recipe for them itself.

Platform now does this twice in rs-platform-wallet:

  • ProUpServTx (masternode/update_service.rs, merged on v5.1-dev): the placeholder payload, inputs_hash, the operator BLS signature over the base payload hash, and the Core v24 rules for payload version 2 or 3 and the version-3 address map.
  • ProUpRegTx (masternode/update_registrar.rs, feat(platform-wallet): rotate a masternode's keys into the wallet platform#5889): the placeholder payload, inputs_hash, and the owner's 65-byte compact recoverable ECDSA signature in Core's CHashSigner form.

Both builders had to learn the same rule separately: the transaction moves no value, so when the change is below the dust limit it ends up with no outputs and Core refuses it (bad-txns-vout-empty). The fix, a zero-value data output, was written once for each builder.

Proposal

Typed builders in key-wallet for ProUpRegTx and ProUpServTx that own what is Dash Core protocol knowledge:

  • assembling the payload from typed inputs, at the payload version Core accepts for the entry and the V24 state the caller passes in;
  • the finalizer: inputs_hash over the selected inputs, then the payload signature (owner ECDSA for ProUpRegTx, operator BLS for ProUpServTx);
  • the output invariant: the transaction always carries an output;
  • the version-3 address map for an evonode built from one address and the platform ports, with its purposes in the order Core re-serializes them, checked with ExtNetInfo::validate_ports_and_duplicates.

Preflight helpers that need only the payload and the masternode list (for example, whether an endpoint is already advertised by another entry) could live next to them.

Out of scope

What stays with the consumer: choosing which wallet keys to rotate to, reading the masternode list and the V24 state from the network, fetching the registration transaction, reservation lifecycle and broadcast.

Context

Raised in review of dashpay/platform#5889. When this lands, both Platform builders move onto it together.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions