https://www.youtube.com/watch?v=lJloI0ugJI8

Engineering Help Guides

Introduction

Sonr is a powerful blockchain technology that utilizes a unique approach to securely manage user identities and digital wallets. By leveraging cutting-edge cryptographic methods, Sonr provides a highly secure and user-friendly experience. In this article, we'll break down the core components of the Sonr blockchain and its account creation process in a non-technical manner, making it easier for non-technical founders to understand the technology behind Sonr.

DID Documents and the Cosmos SDK

graph TB
  DID(DID Document)
  ID(DID)
  Context(Context)
  AuthMethods(Authentication Methods)
  Services(Services)
  PublicKey(Public Key)

  DID --> ID
  DID --> Context
  DID --> AuthMethods
  DID --> Services
  AuthMethods --> PublicKey

  %% Styling
  classDef section fill:#f9d142,stroke:#333,stroke-width:1px;
  classDef key fill:#fff,stroke:#333,stroke-width:1px;
  class DID section
  class ID key
  class Context key
  class AuthMethods key
  class Services key
  class PublicKey key

At the heart of Sonr's identity management is the Decentralized Identifier (DID) Document. This document securely stores user information and their associated public keys on a blockchain powered by the Cosmos SDK. The Cosmos SDK is a modular framework that enables developers to build interoperable and scalable blockchain applications with ease.

WebAuthn and Validator Nodes

sequenceDiagram
  participant User
  participant App
  participant WebAuthn
  participant Validator_Node

  User->>App: Sign up / Log in
  App->>WebAuthn: Trigger WebAuthn request
  WebAuthn->>User: Request user's credentials
  User->>WebAuthn: Provide credentials (e.g., biometrics, security key)
  WebAuthn->>App: Return WebAuthn credential
  App->>Validator_Node: Send WebAuthn credential
  Validator_Node->>App: Run MPC protocol to generate wallet
  Validator_Node->>App: Attach public key to DID Document
  App->>User: Complete sign-up / log-in process

When a user signs up on a website or application integrated with Sonr, the developer triggers a WebAuthn request. WebAuthn is a web standard for secure and seamless user authentication. This request is then sent to a Validator Node, a trusted party within the Sonr network responsible for processing and verifying user information.

Multi-Party Computation (MPC)

sequenceDiagram
  participant User
  participant App
  participant WebAuthn
  participant Validator_Node

  User->>App: Request wallet creation
  App->>WebAuthn: Trigger WebAuthn request
  WebAuthn->>User: Request user's credentials and PIN
  User->>WebAuthn: Provide credentials and PIN
  WebAuthn->>App: Return WebAuthn credential and PIN
  App->>Validator_Node: Initiate MPC protocol with WebAuthn credential and PIN

  Validator_Node->>Validator_Node: Execute MPC protocol
  Validator_Node->>Validator_Node: Assign DID Document to user
  Validator_Node->>Validator_Node: Derive private key using WebAuthn credential and PIN
  Validator_Node->>Validator_Node: Encrypt user's share with derived private key

  Validator_Node->>App: Send encrypted share and DID Document
  App->>User: Wallet created with encrypted share and DID Document

After receiving the WebAuthn request, the Validator Node initiates a cryptographic process called Multi-Party Computation (MPC). This process enables the creation of a digital wallet on behalf of the user without revealing their sensitive information. The wallet's public key is then attached to the DID Document and serves as the user's unique Sonr address.

Private Key Derivation and Encryption

To ensure maximum security, the user's private key is derived from their WebAuthn credentials and a personal identification number (PIN). This private key is used to encrypt one share of the MPC output, while the Validator Node encrypts the other share using a shared key known only to the nodes within the Sonr network. These encrypted shares are securely stored and can only be decrypted by their respective parties.

User Authentication

With their Sonr address (public key) established, users can now authenticate themselves across various websites and applications integrated with Sonr. By providing their WebAuthn credentials and PIN, users can prove their identity without the need for usernames and passwords, streamlining the authentication process while maintaining high levels of security.

Conclusion

sequenceDiagram
participant Dev as Developer
participant SDK as Client SDK
participant User as End User
participant Val as Validator Node
participant BC as Sonr Blockchain

Dev->>SDK: Trigger WebAuthn request
SDK->>User: WebAuthn request
User->>SDK: WebAuthn credential
SDK->>Val: Send WebAuthn credential
Val->>Val: Run MPC protocol
Val->>BC: Record DID Document & public key
Note right of Val: Public key becomes user's Sonr address
Val->>Val: Encrypt MPC share with shared key among nodes
SDK->>User: Request PIN
User->>SDK: Provide PIN
SDK->>SDK: Derive private key from WebAuthn credential & PIN
SDK->>SDK: Encrypt MPC share with derived private key
SDK->>Val: Store encrypted MPC shares
Note right of Val: Validator stores both encrypted shares
User->>SDK: Request login
SDK->>Val: Request user authentication
Val->>BC: Verify user's Sonr address
BC->>Val: Authentication result
Val->>SDK: Forward authentication result
SDK->>User: Provide authentication status