Skip to content

feat: confidential asset wallet integration#1

Open
ganymedio wants to merge 6 commits into
mainfrom
confidential-asset-wallet-integration
Open

feat: confidential asset wallet integration#1
ganymedio wants to merge 6 commits into
mainfrom
confidential-asset-wallet-integration

Conversation

@ganymedio
Copy link
Copy Markdown

No description provided.


- A `ca_*` dApp ↔ wallet method namespace (read and write) advertised through the wallet-standard `features` map.
- Canonical `dk` derivation policies for software, hardware, and keyless backings, each binding the token's FA metadata address into the derivation input.
- Per-`(account, token)` `dk` isolation, in-wallet proof construction, and an explicit-authorization model for rollover/normalization (no silent acceptance of incoming funds).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (and L76, L86, L210–212, L501) hard-codes "rollover is always a separate user action." My understanding from prior discussion was the opposite direction: combined balance display + atomic rollover_and_{withdraw,transfer} entries.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to be discussed further with @musitdev

- update TEMPLATE.md placeholders and mip-001 created field from mm/dd/yyyy to yyyy-mm-dd
"mv-dk-enc-v1" // 12-byte ASCII version tag, also included in AAD
‖ ephemeralX25519Pub // 32 bytes — proposer's per-share ephemeral X25519 public key
‖ nonce // 12 bytes — AES-GCM nonce, all-zero (safe: ephemeral key unique per envelope)
‖ ciphertextWithTag // 48 bytes = 32-byte dk + 16-byte GCM tag
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L376 hard-codes the AES-GCM nonce to all-zero. AES-GCM stays safe only if (aesKey, nonce) never repeats — with the nonce fixed, that means aesKey must be unique across every envelope ever produced. The spec doesn't actually guarantee this.

aesKey = HKDF-SHA256(sharedSecret, info) at L385:

  • sharedSecret varies per envelope only if the ephemeral keypair is fresh per envelope — L374's "per-share" doesn't pin that down.
  • info = "mv-dk-share-v1" ‖ multisig ‖ token ‖ sender ‖ recipient repeats whenever the same proposer re-shares to the same recipient for the same (multisig, token) — exactly the case for redelivery after a failed event index, or a re-share after rotate_encryption_key.

If both happen, the second envelope encrypts a different dk under the same (aesKey, nonce=0). AES-GCM doesn't tolerate nonce reuse — both plaintexts become recoverable and the GCM tag can be forged.

Two options to consider:

  • Random 12-byte nonce per envelope: eliminates the failure class outright; matches standard AES-GCM usage.
  • Drop the nonce field and close the info repetition gap: explicitly forbid identical (multisig, token, sender, recipient) across envelopes, e.g. by mixing a rotation epoch or share counter into info.

The middle path the spec is on today could be a vulnerability.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, updated with fresh random 12-byte nonce per envelope.

@ganymedio ganymedio requested a review from apenzk May 22, 2026 13:46
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.

2 participants