Skip to main content

Overview

Every financial primitive in Lapis maps to a native XRPL transaction type — no smart contract language, no gas fees, 3-5 second finality on testnet.

XRPL Primitives Used

Lapis ConceptXRPL TransactionPurpose
Report paywallPayment + verifyPaymentXRPL micropayment (0.05 XRP) for report access
Equity tokenMPTokenIssuanceCreateIssue shares representing startup equity
Investor authorizationMPTokenAuthorizeKYC/accreditation gate per investor
Vesting lockEscrowCreateLock shares with time or condition-based release
Vest releaseEscrowFinishRelease shares when conditions are met
Platform feePayment (RLUSD)2.5% fee via stablecoin
Legal anchorMetaLex SAFE (Base Sepolia)Legally binding agreement linked to MPT

Equity Tokens (MPT)

When a market settles, the founder issues an MPT (Multi-Purpose Token) representing equity in the company.

Token Flags

These flags are set at issuance and are irreversible after the first holder opts in:
FlagEffect
tfMPTRequireAuthFounder must authorize each investor (compliance gate)
tfMPTCanEscrowShares can be locked in vesting escrows
tfMPTCanLockFounder can freeze individual holdings if needed
tfMPTCanTransferWhether shares can trade on secondary market
tfMPTCanTradeWhether shares can list on XRPL DEX
TransferFeeRoyalty on every secondary transfer (0-50000 bps)

Holder Onboarding Flow

The holder must opt-in before the founder authorizes them. Reversing this order results in tecOBJECT_NOT_FOUND.

Vesting Escrows

Shares are locked in escrow immediately after issuance. Two release mechanisms are supported:

Time-Based (Vesting Cliff)

FinishAfter = rippleTime(cliff date)    // e.g., 90 days from settlement
CancelAfter = rippleTime(safety expiry) // e.g., 365 days
Anyone can call EscrowFinish after FinishAfter — no human unlock required.

Condition-Based (Conversion Trigger)

Condition = PREIMAGE-SHA-256 crypto-condition
Fulfillment = preimage held by AI agent
The agent holds the fulfillment preimage. When a conversion event is confirmed (e.g., MetaLex SAFE settlement on Base Sepolia), the agent calls EscrowFinish with the fulfillment. This makes the agent a trustless trustee. When BASE_PRIVATE_KEY is configured, settlement deploys a SAFE (Simple Agreement for Future Equity) contract on Base Sepolia via MetaLex before issuing the MPT. The SAFE contract address and document hash are embedded in the MPT’s extraMetadata field, creating a bidirectional link between the on-chain equity token (XRPL) and the legal agreement (Base):
  • MPT metadata contains safeContractAddress and safeDocumentHash
  • Base contract stores the XRPL mptIssuanceId via linkXRPL()
  • The /safe/:marketId endpoint verifies both sides match (crossChainVerified)
This means the legal agreement and the equity token are cryptographically linked across two chains — neither can exist without referencing the other.

Default Settlement Config

ParameterDefaultDescription
totalEquityShares10,000,000Total shares issued per company
vestingCliffDays90Days before shares can be released
cancelAfterDays365Safety expiry for unclaimed escrows
platformFeeBps250Platform fee (2.5%)
royaltyBps100Secondary transfer royalty (1%)
xrpUsdRate0.5XRP/USD conversion rate

Why MPT Over Trust Lines?

  • No trust line required from holder — Lower reserve cost
  • tfMPTRequireAuth — Built-in compliance gate
  • tfMPTCanEscrow — Native vesting support, the key feature for equity

Security

  • delivered_amount is always checked over Amount (partial payment attack prevention)
  • Wallet seeds stored in .env, never committed or sent over the network
  • All transactions use autofill() for automatic LastLedgerSequence
  • submitAndWait() used everywhere — never trust submission result alone
  • Mainnet endpoints are config-driven via XRPL_NETWORK, never hardcoded