Skip to content

Add user_registry contract for DID-to-account linking#23

Closed
arkavo-com wants to merge 1 commit intomainfrom
feature/user-registry-contract
Closed

Add user_registry contract for DID-to-account linking#23
arkavo-com wants to merge 1 commit intomainfrom
feature/user-registry-contract

Conversation

@arkavo-com
Copy link
Copy Markdown
Contributor

Summary

  • Adds new user_registry smart contract for permanently linking DIDs to EVM addresses
  • Implements one-time, permanent DID-to-account binding (no unlinking/relinking)
  • Provides bidirectional lookups: get_account_by_did() and get_did_by_account()
  • Validates DID format (must start with did:key:)
  • Updates deployment documentation with user_registry instructions

Test plan

  • All 9 unit tests pass (cargo test in contracts/user_registry)
  • Deploy to local dev node and verify contract instantiation
  • Test link_account with valid DID
  • Test duplicate linking rejection (same DID or same account)
  • Test bidirectional lookups

🤖 Generated with Claude Code

Implements a minimal smart contract for permanently linking
decentralized identifiers (DIDs) to EVM-compatible addresses (H160).

Features:
- One-time, permanent DID-to-account binding
- Bidirectional lookups (DID→Address, Address→DID)
- DID format validation (must start with "did:key:")
- Event emission on account linking
- 9 unit tests covering all functionality

This contract supports authnz-rs integration by providing on-chain
verification of DID ownership for Substrate accounts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@arkavo-com
Copy link
Copy Markdown
Contributor Author

Superseded by PR #24 which includes both the user_registry contract and RPC integration

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