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
  • getParticipatingNodes
  • getTx
  • registerTx
  1. SDK
  2. WebSDK
  3. L2PS SDK

Interacting with the L2PS

The l2psmodule exposes various methods to easily interact with on-chain Subnets.

As Subnets are always registered on the Demos Network, their data is publicly available. Due to the strong encryption, anyway, only their members are able to decrypt and view the content of that data.

This mechanism is crucial to ensure data integrity while not compromising privacy and security.

For this reason, once a Subnet instance is created, it will be able to interact with the on-chain data pertaining to that specific Subnet.

All the following methods are to be called from the L2PSclass instance you created in the previous step (for example: await instance.getParticipatingNodes()).

This section mainly explains the primitives to interact with a L2PS Subnet. In the following chapters, we will see more high level modules using this class to expose features in a user-friendly way.

getParticipatingNodes

This method retrieves the members, also called nodes, of the Subnet instance updated to the last block.

Arguments: None

Returns: Promise<Map<string, string>>

getTx

This method retrieves an encrypted transaction from the on-chain Subnet, decrypts it and returns the plain Transaction.

Arguments:eHash: string // the hash of the encrypted transaction

Returns: Promise<Transaction>

registerTx

This method accepts a standard Demos Transaction, encrypts it using the L2PS Public Key and send it to the on-chain Subnet instance.

Arguments: tx: Transaction // A standard Demos Transaction

Returns: Promise<string> // The eHash of the encrypted Transaction

PreviousThe l2ps moduleNextL2PS Messaging System

Last updated 5 months ago