Skip to content

rpc-json: keep the payout destination type (P2PKH or P2SH) in masternode state and diffs #1385

Open

Description

@shumkov

DMNState and DMNStateDiff decode payoutAddress and operatorPayoutAddress to their 20 hash bytes through payload_to_vec(), so the decoded state no longer says whether the address is P2PKH or P2SH. (Seen at the commit Platform pins, c9aeac0, and on current dev.)

Dash Core accepts both P2PKH and P2SH owner and operator payouts. Platform turns these payouts into identity withdrawal (TRANSFER) keys of type ECDSA_HASH160. For a P2SH payout the 20 bytes hash a redeem script, not a public key, so the resulting key can never sign. Without the type, Platform cannot tell the two apart and cannot refuse or handle script payouts.

Request:

  • keep the payout destination type (for example an Address, a ScriptBuf, or an enum of P2PKH/P2SH hashes) in DMNState, DMNStateDiff and ProTxInfo;
  • regression tests with a P2SH owner and operator payout in a full list, a list diff and protx info.

Context: dashpay/platform#5775 (dashpay/platform#5775 (comment)).

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