Commit 5debb12
fix(wasm-sdk): enable identity_update to add ECDSA_SECP256K1 and BLS12_381 keys
Previously, identity_update failed when adding ECDSA_SECP256K1 or BLS12_381
keys with signature verification errors. The root cause was that these key
types require self-signing (is_unique_key_type() == true), but identity_update
used SingleKeySigner which only held the master key.
Changes:
- Switch from SingleKeySigner to SimpleSigner in identity_update
- Add master key to signer for state transition signing
- Extract parse_keys_for_identity_update helper function for key parsing
- Accept privateKeyHex/privateKeyWif for signing key types (ECDSA_SECP256K1,
BLS12_381) and derive public keys from private keys
- Add new signing keys to SimpleSigner so they can sign for themselves
- Maintain backward compatibility: ECDSA_HASH160 still accepts data field
API changes for add_public_keys parameter:
- ECDSA_SECP256K1: requires privateKeyHex or privateKeyWif (was: data)
- BLS12_381: requires privateKeyHex (was: data)
- ECDSA_HASH160: accepts privateKeyHex or data (backward compatible)
- BIP13_SCRIPT_HASH, EDDSA_25519_HASH160: unchanged (data field)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 649b7d3 commit 5debb12
1 file changed
+566
-134
lines changed
0 commit comments