Skip to content

feat(#25): add update_admin_pubkey for Ed25519 key rotation#204

Open
soterika wants to merge 2 commits into
zintarh:mainfrom
soterika:feature/issue-25-admin-pubkey-rotation
Open

feat(#25): add update_admin_pubkey for Ed25519 key rotation#204
soterika wants to merge 2 commits into
zintarh:mainfrom
soterika:feature/issue-25-admin-pubkey-rotation

Conversation

@soterika

@soterika soterika commented Jul 1, 2026

Copy link
Copy Markdown

If the admin signing key is compromised there was no recovery path without redeploying. This adds a dedicated rotation function so the backend can switch to a new key without touching the contract binary.

  • Add update_admin_pubkey(new_pubkey: BytesN<32>) — admin-only
  • Overwrites AdminPubKey in instance storage with the new key
  • Emits (admin, pubkey) event on successful rotation
  • Old signatures are immediately invalidated after rotation
  • Adds 4 tests: successful rotation + new key works, old key rejected after rotation (Error(Crypto, InvalidInput)), non-admin blocked (Error(Auth, InvalidAction)), not-initialized path, event assertion

Closes #25

If the admin signing key is compromised there was no recovery path
without redeploying. This adds a dedicated rotation function so the
backend can switch to a new key without touching the contract binary.

- Add update_admin_pubkey(new_pubkey: BytesN<32>) — admin-only
- Overwrites AdminPubKey in instance storage with the new key
- Emits (admin, pubkey) event on successful rotation
- Old signatures are immediately invalidated after rotation
- Adds 4 tests: successful rotation + new key works, old key rejected
  after rotation (Error(Crypto, InvalidInput)), non-admin blocked
  (Error(Auth, InvalidAction)), not-initialized path, event assertion

Closes zintarh#25
@drips-wave

drips-wave Bot commented Jul 1, 2026

Copy link
Copy Markdown

@soterika Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Add admin pubkey rotation function

1 participant