My user registration function allows users to register by retrieving their principal ID. While it blocks anonymous principals, it does not verify whether a principal is genuinely issued by ICP Identity, NFID, or a valid wallet. This makes it vulnerable to:
- Fake Principals – Attackers can generate scripted principals that are not tied to real users.
- Spam & Sybil Attacks – Mass registrations can bloat storage and exploit canister resources.
- Cycle Drainage – Automated calls could drain cycles via fake signups.
Key Question:
How can I strictly validate that only authenticated principals from Internet Identity, NFID, or trusted wallets can register?
- Does ICP provide a built-in verification method?
- Are there external ways (like cryptographic proof or a verification API) to check principal authenticity?
Looking for ICP-native solutions or external best practices to prevent fake registrations and ensure only verified users can be stored.