Back to Documentation

LayerLedger Whitepaper (v1.1)

LL2: The Provenance Layer for Everything Real


0. Abstract

LayerLedger (LL2) is a hybrid Layer-2 protocol built on XRPL that provides programmable, tamper-evident provenance for real-world assets, digital collectibles, NFC-linked objects, and multi-app ecosystems such as CardLayer, Mintlings, and LegacyLayer.

LL2 acts as:

  • A sequencer for off-chain actions
  • A state machine for asset ownership
  • A ledger for physical/digital events
  • A gas abstraction layer for managed custody
  • A unified provenance root for assets
  • A multi-world engine powering the LayerVerse

The XRPL provides trust anchoring, settlement, and finality, while LL2 handles scalable state transitions, social actions, bundles, repacks, fractions, and multi-app activity.

Phase 2 introduces the ability to anchor LL2 states to multiple L1 chains, enabling LL2 to become the universal provenance layer for any chain.


1. Introduction

Modern digital asset ecosystems suffer from fragmentation, chain silos, and missing provenance. Real-world assets are especially constrained by inconsistent custody rules, incomplete history, and differing chain standards.

LayerLedger addresses these issues by creating a unified provenance engine for all LayerVerse applications. LL2 becomes a programmable middle layer between applications and XRPL, providing scalable state transitions and full asset lineage.


2. Architecture Overview

2.1 Three-Layer Stack

┌───────────────────────────────┐
│ Application Worlds            │
│ (CardLayer, Mintlings, Legacy)│
└────────────┬──────────────────┘
             │
┌────────────▼──────────────────┐
│ LayerLedger (LL2)             │
│ Off-chain sequencer           │
│ Managed custody execution     │
│ Provenance + event logs       │
│ Physical/digital state engine │
└────────────┬──────────────────┘
             │
┌────────────▼──────────────────┐
│ XRPL L1                       │
│ Settlement, minting, burns    │
│ Hash commitments              │
│ Trust / validator layer       │
└───────────────────────────────┘

LL2 is the programmable state and provenance layer connecting application worlds to XRPL.


3. LayerLedger Core Concepts

3.1 State Machine

Each asset is a stateful object tracked both on XRPL and LL2.

Asset State = {
  issuance,
  custody_type,
  owner,
  wallet_origin,
  app_context,
  fraction_history,
  bundle_lineage,
  nfc_scans,
  metadata_updates
}

LL2 enforces valid transitions between asset states.

3.2 Sequencer

The LL2 Sequencer performs:

  • Ordering of off-chain events
  • Anti-double-spend guarantees
  • Bundle/repack state management
  • Provenance hashing
  • Multi-app orchestration
  • Gas accounting and abstraction

XRPL finalizes confirmed intervals.

3.3 Managed Custody

LL2 supports both self-custody (XRPL wallets) and managed custody (LL2 custody wallets).

Managed custody enables:

  • Instant transfers
  • Gas-free UX
  • Kid-safe flows for Mintlings
  • Internal market operations
  • Repack and bundle mechanics
  • Fractional ownership management

All off-chain transfers and state transitions are logged for complete provenance.

3.4 Gas Abstraction

Users do not hold XRPL-based LAYER tokens.
LL2 charges virtual gas and treasury wallets sponsor real burns on XRPL.

This ensures:

  • Smooth onboarding
  • No token purchasing required
  • Consistent accounting for actions

Virtual gas is tracked internally in LL2.


4. Cross-App Provenance & LayerVerse Structure

Each app world (Mintlings, CardLayer, LegacyLayer):

  • Has its own schema
  • Own UX flows
  • Own metadata structures

All connect to:

layer_engine.* → the central LL2 engine

Shared capabilities:

  • Identity
  • Wallets
  • Managed custody
  • Event logs
  • Provenance state
  • NFC registry
  • Gas abstraction
  • Dev wallets
  • App routing

The LayerVerse = multiple worlds sharing a unified provenance engine.


5. Asset Flow Examples

5.1 Mint a Mintling

  1. XRPL issuer mints an MPT
  2. LL2 registers asset state
  3. NFC tag (NTAG424) is bound
  4. LL2 logs physical-to-digital binding
  5. Social/story events occur in LL2
  6. Periodically XRPL anchors state

5.2 CardLayer Repack

  1. User bundles multiple assets
  2. LL2 creates a virtual asset representing the bundle
  3. Underlying assets become frozen
  4. Bundle inherits component provenance
  5. Managed custody transfers occur internally
  6. Bundle dissolves and original states restore
  7. Anchored snapshot to XRPL

6. Data Structures

6.1 LL2 Event Log

id,
event_type,
asset_id,
actor,
origin_app,
previous_state_hash,
new_state_hash,
metadata,
timestamp

Event types include:

  • mint
  • scan
  • write
  • custody_change
  • fraction_create
  • bundle_create
  • bundle_dissolve
  • transfer
  • virtual_burn
  • gas_usage
  • metadata_update

This event log forms the foundation of LL2 provenance.


7. Phase 2: Multi-Chain Anchors & Cross-Chain Provenance

Phase 2 extends LL2 to anchor provenance and asset states to additional chains.

7.1 Motivation

Cross-chain anchoring enables:

  • Broader trust guarantees
  • Multi-chain visibility
  • Marketplace interoperability
  • RWA composability
  • Liquidity expansion

LL2 always remains the canonical provenance root.


7.2 Three Modes of Cross-Chain

Mode 1: Anchor Mirroring (Phase 2)

LL2 State → Hash Commit → XRPL, Base, Polygon, Solana

Low risk, low complexity, high trust.

Mode 2: Digital Twin Mirroring (Optional)

LL2 assets can appear as tokens on other chains for visibility and marketplace access.

Mode 3: Native Multi-Chain Execution (Future)

Cross-chain orchestration:

  • Mint on XRPL
  • Fraction on LL2
  • Sell fractions on Base
  • Repack on Polygon
  • Final settlement on XRPL

LL2 becomes the universal RWA execution layer.


8. Security Model

  • XRPL finality
  • NTAG424 DNA cryptography
  • Sequencer ordering guarantees
  • RLS and schema isolation
  • Event hashing and chain commits
  • Replay protection
  • Deterministic state machine

9. Roadmap

Phase 1 (Current)

  • LL2 engine
  • Managed custody
  • Mintlings, CardLayer, LegacyLayer
  • Provenance engine
  • Asset lineage
  • Repack engine
  • NFC registry
  • State hashing

Phase 2

  • Multi-chain anchoring
  • Hash commits to Base, Solana, Polygon
  • Proof explorer
  • Optional digital twin minting

Phase 3

  • Cross-chain fractions
  • Multi-chain repacks
  • Liquidity routing
  • Chain abstraction layer

10. Conclusion

LayerLedger defines a unified, programmable provenance layer for digital and real-world assets across the LayerVerse.

By combining:

  • XRPL for settlement
  • LayerLedger for orchestration
  • NFC for physical linking
  • Multi-chain anchoring for trust amplification

LL2 becomes a universal provenance engine across chains, apps, and asset classes.

The future of RWA ownership is chain-agnostic, app-agnostic, and provenance-driven.
LayerLedger is the foundation of that future.


Appendix A: Architecture Diagrams

Worlds Architecture

Mintlings  CardLayer  LegacyLayer
    \         |         /
     \        |        /
      \       |       /
   ┌────────────────┐
   │  LayerLedger   │
   │  (Sequencer)   │
   │ (State Engine) │
   └──────┬─────────┘
          │
   ┌──────▼─────────┐
   │      XRPL      │
   │  (Settlement)  │
   └────────────────┘

Phase 2 Multi-Chain Anchors

           ┌────────── XRPL (Primary)
           │
LL2 State ─┤
           ├────────── Base (Anchor)
           ├────────── Polygon (Anchor)
           └────────── Solana (Anchor)

Appendix B: Technical Implementation

Database Schema

LayerLedger is implemented using a multi-schema PostgreSQL database:

  • layer_engine.asset_registry - Global asset list
  • layer_engine.asset_states - Current state snapshots
  • layer_engine.asset_transactions - Core ledger (all provable changes)
  • layer_engine.asset_events - Social/view events
  • layer_engine.gas_ledger - Managed custody gas accounting
  • layer_engine.xrpl_sync_log - XRPL transaction sync

Transaction Types

The system supports 15 transaction types:

  • MINTED - Asset creation
  • TRANSFERRED - Ownership change
  • FRACTIONED - Asset fractionation
  • MERGED - Fraction recombination
  • PACK_CREATED - Bundle creation
  • PACK_OPENED - Bundle dissolution
  • BURNED - Asset destruction
  • LISTED - Marketplace listing
  • SOLD - Marketplace sale
  • INTERNAL_GAS_CHARGE - Gas accounting
  • INTERNAL_GAS_COVERAGE - Treasury coverage
  • ONCHAIN_SEND - XRPL send transaction
  • ONCHAIN_RECEIVE - XRPL receive transaction
  • ONCHAIN_BURN - XRPL burn transaction
  • METADATA_UPDATED - Metadata changes

Event Types

The system tracks 10 event types:

  • SCANNED - NFC tag scan
  • STORY_ADDED - Social story creation
  • VIEWED - Asset view
  • PACK_TAPPED - Pack interaction
  • METADATA_UPDATED - Metadata change event
  • SOCIAL_ACTION - Generic social interaction
  • REACTION_ADDED - Like/heart reaction
  • REACTION_REMOVED - Reaction removal
  • COMMENT_ADDED - Comment creation
  • SHARED - Asset sharing

API Access

LayerLedger provides a type-safe tRPC API for querying:

  • Asset provenance (full history)
  • User asset history
  • Gas reports
  • XRPL transaction sync
  • State reconstruction

See docs/LAYERLEDGER_EXAMPLE_QUERIES.md for detailed query examples.


Appendix C: References


Version: 1.1
Last Updated: 2024
Status: Phase 1 - Active Development


LayerLedger is the foundation of the LayerVerse - a unified provenance engine for digital and real-world assets across chains, apps, and asset classes.

SolidLayer Logo
LIQUIDITYLAYER

The modular core of CardLayer, LegacyLayer, and beyond — engineered with tRPC, monorepo architecture, and a stack that devs actually enjoy using.

Legal

© 2025 Layer.Company • Part of the LayerVerse

Built with ❤️ for the future