Demos Network Specifications
  • Introduction
    • What is Demos Network
    • Demos Network Architecture
  • FAQ
  • Cookbook
    • Project setup
      • Run the project (MacOS)
      • Run the project (Windows)
        • WSL 2 Setup on Windows (10 and 11 only)
        • Issue Troubleshooting
      • Run the project (Ubuntu)
  • SDK
    • Getting Started
    • WebSDK
      • Authentication
        • FIDO2 Passkeys
          • Under the Hood: FIDO2 Passkeys
      • NodeCalls
      • Transactions
        • Creating a transaction
        • Signing a transaction
        • Broadcasting a transaction
      • L2PS SDK
        • The l2ps module
        • Interacting with the L2PS
        • L2PS Messaging System
      • Instant Messaging
        • What is the Instant Messaging Protocol?
        • Architecture Overview
        • Encryption
        • Quickstart
        • Message Types
        • API Reference
        • FAQ
    • Cross Chain
      • General layout of the XM SDKs
      • EVM
      • BTC
      • Solana
      • MultiversX (EGLD)
      • NEAR
      • IBC
      • TON
      • XRPL
      • The XMScript
      • Identities
    • Demoswork
    • Cookbook
      • Demoswork
        • Creating work steps
        • Conditional Operation
        • Base Operation
        • Signing and broadcasting
      • Transactions
        • Crosschain Transaction
        • Native Transactions
      • SWAP
        • Crosschain SWAP
    • Web2
      • Quick Start
      • DAHR API Reference
        • Types
      • Making Requests
      • Identities
        • Twitter
        • GitHub
    • API Reference
    • Bridges
      • Rubic Bridge Test
    • Post Quantum Cryptography
  • Backend
    • Internal Mechanisms
      • Network Time Synchronization
      • Cross Context Identities
    • Global Change Registry
      • GCR Structure
      • How is GCR Synced?
    • Consensus Mechanism
      • Unparalleled Scalability
      • Decentralization in PoR-BFT
      • Enhanced Security
      • Comparative Advantage
      • Addressing Potential Criticisms
      • Conclusion
    • Communications Stack
    • L2PS (Subnet) Framework
      • How are L2PS transactions handled?
    • Miscellaneous
      • Browsing the Postgres DB via psql
    • Bridges
      • Rubic Bridge
    • Developers Testbed
      • Setting up the environment
      • Setting up the repository
      • Installing dependencies
      • Node Configuration
      • Running the node
  • Frontend
    • Demos Providers Discovery Mechanism
Powered by GitBook
On this page
  • The `hmywallet` module and it's wrapper
  • Usage and typical use cases
  1. SDK
  2. WebSDK
  3. Authentication

FIDO2 Passkeys

PreviousAuthenticationNextUnder the Hood: FIDO2 Passkeys

Last updated 5 months ago

The Demos SDK offers secure methods to generate or recover private keys using a FIDO2 hardware key, which are then usable across the entire Demos network, encompassing various contexts like different blockchains and traditional web2 environments. In this chapter, we'll delve into the specifics of how this mechanism operates and strategies to utilize it effectively for optimal security.

The `hmywallet` module and it's wrapper

The Demos SDK features a Python module called hmywallet, a customized version of designed specifically for integration with the Demos SDK.

The code resides in sdks/src/wallet/passkeys/hmywallet, and the module for integrating it into the SDK can be found in sdks/src/wallet/passkeys/passkeys.ts.

Usage and typical use cases

You can test the functionality of the wrapper by executing:

tsx src/wallet/passkeys/passkeys.ts

From the sdks repository root. The test part of the module "just" creates the credentials and print out the private key generated. However, the intended usage is:

import wallet from "@kynesyslabs/demosdk"

[...]

const privateKey = await wallet.generatePasskey()

This method returns a hexadecimal string containing the private key linked to the credentials derived from your FIDO2 device's hmac_secret.

You can now use this private key in any way Demos allows it to be used. For example, you could load your Demos credentials directly using this private key.

https://github.com/tcsenpai/hmywallet