Skip to content

Register recovery agent from the signup service#349

Merged
gryaele merged 14 commits intomainfrom
elenagryaznova/pop-3692-register-recovery-agent-on-chain-from-signup-service
Apr 8, 2026
Merged

Register recovery agent from the signup service#349
gryaele merged 14 commits intomainfrom
elenagryaznova/pop-3692-register-recovery-agent-on-chain-from-signup-service

Conversation

@gryaele
Copy link
Copy Markdown
Contributor

@gryaele gryaele commented Apr 7, 2026

This pull request extends the ManageRecoveryBindingRequest struct and updates related logic and tests to support recovery agent updates in the recovery bindings flow. The main changes add new fields for signature, nonce, and the new recovery agent address, and ensure these are handled throughout the codebase and tests.

Recovery agent update support

  • Added signature, nonce, and new_recovery_agent fields to the ManageRecoveryBindingRequest struct in pop_backend_client.rs to support recovery agent update operations. ([walletkit-core/src/issuers/pop_backend_client.rsR16-R22](https://github.com/worldcoin/walletkit/pull/349/files#diff-3824125edaf8fa9a81da332d83ba961405575a0321b8f820a336f9ec4c62eb00R16-R22))
  • Updated the bind_recovery_agent and unbind_recovery_agent methods in recovery_bindings_manager.rs to generate and include the new fields when constructing ManageRecoveryBindingRequest, using the authenticator to sign the update and pass the new recovery agent address. ([[1]](https://github.com/worldcoin/walletkit/pull/349/files#diff-592fea17b31859cf09d8c8fe2190249b35dd84316d9d99180a0d6ff2b3fbd23fR81-R93), [[2]](https://github.com/worldcoin/walletkit/pull/349/files#diff-592fea17b31859cf09d8c8fe2190249b35dd84316d9d99180a0d6ff2b3fbd23fL112-R134))

Test updates

  • Modified all related tests in both pop_backend_client.rs and recovery_bindings_manager.rs to include and validate the new fields (signature, nonce, new_recovery_agent) in requests and mock expectations. ([[1]](https://github.com/worldcoin/walletkit/pull/349/files#diff-3824125edaf8fa9a81da332d83ba961405575a0321b8f820a336f9ec4c62eb00R226-R242), [[2]](https://github.com/worldcoin/walletkit/pull/349/files#diff-3824125edaf8fa9a81da332d83ba961405575a0321b8f820a336f9ec4c62eb00R271-R287), [[3]](https://github.com/worldcoin/walletkit/pull/349/files#diff-3824125edaf8fa9a81da332d83ba961405575a0321b8f820a336f9ec4c62eb00R324-R337), [[4]](https://github.com/worldcoin/walletkit/pull/349/files#diff-3824125edaf8fa9a81da332d83ba961405575a0321b8f820a336f9ec4c62eb00R366-R383), [[5]](https://github.com/worldcoin/walletkit/pull/349/files#diff-592fea17b31859cf09d8c8fe2190249b35dd84316d9d99180a0d6ff2b3fbd23fR249-R250), [[6]](https://github.com/worldcoin/walletkit/pull/349/files#diff-592fea17b31859cf09d8c8fe2190249b35dd84316d9d99180a0d6ff2b3fbd23fL235-R263), [[7]](https://github.com/worldcoin/walletkit/pull/349/files#diff-592fea17b31859cf09d8c8fe2190249b35dd84316d9d99180a0d6ff2b3fbd23fL257-R288), [[8]](https://github.com/worldcoin/walletkit/pull/349/files#diff-592fea17b31859cf09d8c8fe2190249b35dd84316d9d99180a0d6ff2b3fbd23fL288-R328), [[9]](https://github.com/worldcoin/walletkit/pull/349/files#diff-592fea17b31859cf09d8c8fe2190249b35dd84316d9d99180a0d6ff2b3fbd23fR394-R395))

Code quality and consistency

  • Defined a ZERO_ADDRESS constant for use as the null recovery agent address, improving readability and consistency. ([walletkit-core/src/issuers/recovery_bindings_manager.rsL21-R22](https://github.com/worldcoin/walletkit/pull/349/files#diff-592fea17b31859cf09d8c8fe2190249b35dd84316d9d99180a0d6ff2b3fbd23fL21-R22))
  • Updated documentation for bind_recovery_agent to include the new parameter. ([walletkit-core/src/issuers/recovery_bindings_manager.rsR70](https://github.com/worldcoin/walletkit/pull/349/files#diff-592fea17b31859cf09d8c8fe2190249b35dd84316d9d99180a0d6ff2b3fbd23fR70))

@@ -78,7 +88,18 @@ impl RecoveryBindingManager {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Leaf index can be take from the authenticator, but I also noticed that it's sometimes passed as a param. What is the recommendation here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

imo we should take it from the authenticator. Can we also take sub?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we'd need blinding factor I think, I couldn't find a method to get the sub in the Authenticator

Co-authored-by: Jakub Trąd <jakubtrad@gmail.com>
gryaele and others added 2 commits April 8, 2026 14:33
Co-authored-by: Jakub Trąd <jakubtrad@gmail.com>
Co-authored-by: Jakub Trąd <jakubtrad@gmail.com>
@gryaele gryaele merged commit 0bee410 into main Apr 8, 2026
15 checks passed
@gryaele gryaele deleted the elenagryaznova/pop-3692-register-recovery-agent-on-chain-from-signup-service branch April 8, 2026 13:13
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