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
- XRPL issuer mints an MPT
- LL2 registers asset state
- NFC tag (NTAG424) is bound
- LL2 logs physical-to-digital binding
- Social/story events occur in LL2
- Periodically XRPL anchors state
5.2 CardLayer Repack
- User bundles multiple assets
- LL2 creates a virtual asset representing the bundle
- Underlying assets become frozen
- Bundle inherits component provenance
- Managed custody transfers occur internally
- Bundle dissolves and original states restore
- 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 listlayer_engine.asset_states- Current state snapshotslayer_engine.asset_transactions- Core ledger (all provable changes)layer_engine.asset_events- Social/view eventslayer_engine.gas_ledger- Managed custody gas accountinglayer_engine.xrpl_sync_log- XRPL transaction sync
Transaction Types
The system supports 15 transaction types:
MINTED- Asset creationTRANSFERRED- Ownership changeFRACTIONED- Asset fractionationMERGED- Fraction recombinationPACK_CREATED- Bundle creationPACK_OPENED- Bundle dissolutionBURNED- Asset destructionLISTED- Marketplace listingSOLD- Marketplace saleINTERNAL_GAS_CHARGE- Gas accountingINTERNAL_GAS_COVERAGE- Treasury coverageONCHAIN_SEND- XRPL send transactionONCHAIN_RECEIVE- XRPL receive transactionONCHAIN_BURN- XRPL burn transactionMETADATA_UPDATED- Metadata changes
Event Types
The system tracks 10 event types:
SCANNED- NFC tag scanSTORY_ADDED- Social story creationVIEWED- Asset viewPACK_TAPPED- Pack interactionMETADATA_UPDATED- Metadata change eventSOCIAL_ACTION- Generic social interactionREACTION_ADDED- Like/heart reactionREACTION_REMOVED- Reaction removalCOMMENT_ADDED- Comment creationSHARED- 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
- LayerLedger Architecture - Detailed architecture documentation
- LayerLedger Example Queries - Query examples and use cases
- Database Schema Migration Plan - Schema organization
- XRPL Documentation - XRPL protocol reference
- NTAG424 DNA Specification - NFC tag cryptography
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.
