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
  1. Backend
  2. Internal Mechanisms

Cross Context Identities

Cross-Context Identities are the specifications utilized by the Demos network to identify and capitalize on accounts situated across diverse chains and protocols, including the Web2 protocol.

Demos Network employs a variety of techniques for different chains and protocols, which is a core aspect of numerous Demos protocol mechanisms, including the Gas Tanks mechanism and the overall reputation score for a node or user.

The primary mechanism for achieving this is known as Cross Context Identities (CCI).

Within the blockchain, specifically in the StatusNative table of the database, each address is associated with a JSON object called "identities." This serves as a registry for the user's various identities in different contexts.

The json structure is as follows:

```typescript

    @Column("json", { name: "identities", nullable: true })
    identities: StoredIdentities | null = new Map() // NOTE This is a map of the public identifiers and the context
```

The StoredIdentities type is defined as follows:

```typescript
type Identity = { // NOTE This supports both chains and web2 contexts
    public_identifier: string
    context: "xm" | "web2"
}

type StoredIdentities = Map<string, Identity> // NOTE The key is the network name or the web2 context name

```

Upon each user transaction on a different chain or context (e.g., a Cross Chain transaction or a Web2 transaction involving an API key), the public portion of that identity is saved inside the aforementioned table.

It should be noted that the private key or API key is not stored on the blockchain. Instead, it is stored locally, if specified, through the use of wallets or dApps that utilize the Demos SDK.

Leveraging identities

This approach offers a significant advantage in managing multiple identities. To illustrate, consider a scenario where User A wishes to execute a Demos transaction, paying gas with their Solana native tokens.

As the user has already interacted with Demos using Solana (e.g., a Cross Chain transaction), the blockchain is aware of its Solana public key. The RPC will then request a Solana payment from A to one of our designated gas tanks and will verify that A's public key has successfully completed the transaction. Once this is confirmed, the RPC can proceed with the execution.

It's all SDK

It is important to note that the process described can and should ideally be automatic. Once A has its local Demos wallet with its Solana identity loaded (so without sharing the private key with the blockchain but keeping it locally), the wallet is perfectly able to execute the transaction autonomously after a quick confirmation by the user. This allows for a seamless and easy cross-context system to be applied and executed without hassle.

Example Schema

PreviousNetwork Time SynchronizationNextGlobal Change Registry

Last updated 7 months ago

Leveraging CCI for Gas Tanks