Skip to content

feat: verify CoinCover safe-root issuance proofs - #10317

Draft
davidkaplanbitgo wants to merge 1 commit into
masterfrom
davidkaplan/wcn-4832-coincover-root-proof-verifier
Draft

davidkaplanbitgo wants to merge 1 commit into
masterfrom
davidkaplan/wcn-4832-coincover-root-proof-verifier

Conversation

@davidkaplanbitgo

Copy link
Copy Markdown
Contributor

Ticket: WCN-4832

Adds the shared verifier for CoinCover's safe-root issuance proof (guide v1.1 §6), so the SDK can check an issued backup root itself instead of trusting wallet-platform.

What

  • verifyCoinCoverSafeRootProof in modules/sdk-core/src/bitgo/safe/coincoverRootProof.ts:
    • exact signed field set, key_id, enterprise and safe
    • base64 DER ECDSA P-256 / SHA-256 over the exact received signed_payload bytes — the payload is never re-serialised
    • the stored root pub encodes the signed public key: depth-0 xpub for secp256k1 (pubkey ‖ chainCode), 103-char base32 for ed25519
  • Pinned attestation keys per environment in environments.ts, next to hsmXpub, as an array so rotation can overlap.
  • Unit tests against locally generated P-256 keys, plus negatives for every check.

Review notes

  • CoinCover has not published the attestation key encoding. The parser accepts hex (compressed/uncompressed), base64 of the raw x||y point, base64 DER SPKI and PEM; anything else fails closed. Their illustrative crypto.verify(...) call implies a Node KeyObject/PEM, which is why SPKI and PEM are handled.
  • coinCoverAttestationPublicKeys is empty for prod and test until the real keys arrive (WCN-5246). Verification fails closed, so enabling the WP flag before the keys are pinned turns every CoinCover safe creation into an archived safe.
  • Nothing was built or run locally; first signal is CI.

Add the shared verifier for the CoinCover root proof (guide v1.1 section 6), so
the SDK can check an issued backup root itself instead of trusting
wallet-platform.

- verifyCoinCoverSafeRootProof: checks the signed field set, key id, enterprise
  and safe, the base64 DER P-256 signature over the exact received
  signed_payload bytes, and that the stored root pub encodes the signed public
  key (depth-0 xpub for secp256k1, 103-char base32 for ed25519). The payload is
  never re-serialised.
- Attestation keys are pinned per environment next to hsmXpub and accept hex,
  base64 raw, base64 SPKI or PEM, because CoinCover has not published the
  encoding. They are empty until WCN-5246, so verification fails closed.

Ticket: WCN-4832
@linear-code

linear-code Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

WCN-4832

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

⚠️ Compatibility checks are failing on Node.js 27-nightly (experimental, non-blocking). This does not block merge, but it signals an incompatibility to fix before this release becomes supported.

View run

This branch has not been deployed

No deployments
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