Hey everyone!
It would be amazing to see a Klever Connect community-driven open-source project take shape, built by and for the community.
The idea here is to create a “Wallet Connect” feature, enabling users to log into dApps using KleverChain’s stack and securely validate authorization. Essentially, this feature would involve building an authorization protocol based on KleverChain’s ed25519 cryptographic elliptic curve.
Proposal for Implementation
My initial thought is to leverage a challenge-response authorization process using the existing implementations of:
• sign_message (Code)
• verify_message_signature (Code)
Here’s how the process might look:
- Challenge Creation (Server-Side):
• The server generates a unique, random challenge string (e.g., a UUID) and sends it to the user.
- Message Signing (Client-Side):
• The user’s wallet signs the challenge using their private key via sign_message.
- Signature Verification (Server-Side):
• The server receives the signed message and the public address from the wallet.
• Using verify_message_signature, the server validates:
• The signature is valid.
• The signature corresponds to the provided KleverChain address.
- Authorization Confirmation:
• If verification succeeds, the server confirms the wallet’s ownership of the address and grants access.
Why this Approach?
• Off-Chain Validation: This process avoids unnecessary on-chain operations, reducing costs and increasing speed.
• Secure Ownership Proof: The challenge-response flow ensures the user truly owns the wallet private key without ever exposing it.
• Alignment with KleverChain: By utilizing kos-rs’s built-in tools, we ensure seamless integration and reliability.
I’d love to hear your thoughts on this!