RegX

How RegX works

Whitechain enforces who may hold the note and moves the USDT. Arkiv makes the market for it public and queryable, and stale orders expire on their own.

Parties

  • Acme Textiles (issuer): tokenizes a receivable as an ERC-3643 note, receives USDT from investors, and owes coupons and face value.
  • Compliance agent: signs KYC claims onto investors' ONCHAINIDs. It is the trusted claim issuer in the T-REX registry.
  • Alice & Bob (verified investors): fund the invoice at a discount, trade it before maturity, and get repaid in USDT.
  • Carol (not verified): can browse and even sign transactions, but the token rejects every mint or transfer to her.

Architecture

RegX web appwallet signs · reads both chainsWhitechain Sepolia: rules + USDTT-REX Token (ERC-3643) for the invoice noteIdentity Registry + ONCHAINID KYC claimsCompliance: RegXNote + InvestorCapModuleRegXNote: subscribe · coupon · maturityRegXDvP: atomic EIP-712 settlement in USDTevery payment in Whitechain test USDTArkiv Rabdi: the public marketregx.order: signed orders, maker-owned expire exactly when the order doesregx.fill: trades + Whitechain tx hashregx.action: subscriptions, coupons, KYCregx.asset: note terms (re-runnable sync)typed, indexed, queryable by anyonesubscribe · fill · settlecreateEntity · querykeeper

The lifecycle, end to end

  1. Issuance. Alice calls RegXNote.subscribe(30). 29.1 USDT goes to Acme and 30 units are minted, but only after the token checks her ONCHAINID claim and the holding cap.
  2. Trading. Alice signs an EIP-712 sell order and publishes it as a regx.order entity on Arkiv. Bob fills it through RegXDvP: USDT and the note move in one transaction.
  3. Compliance. Carol has no KYC claim, so the T-REX token reverts her fill and her USDT never leaves her wallet. Frozen wallets, pauses, the holding cap and maturity are all enforced in the same transfer path.
  4. Coupon. After the coupon date anyone can call payCoupon. USDT goes pro-rata from Acme's allowance to every holder.
  5. Maturity. Trading stops on-chain. settleMaturity pays face value in USDT to every holder and burns their units. If Acme hasn't funded it, the call reverts in public, which is an on-chain default.

Read the market yourself

import { createPublicClient } from "@arkiv-network/sdk"
import { rabdi } from "@arkiv-network/sdk/chains"
import { and, asc, eq, gt } from "@arkiv-network/sdk/query"
import { addr, u64 } from "@arkiv-network/sdk/schema"
import { OrderEntity } from "@regx/shared"

const arkiv = createPublicClient({ chain: rabdi({ accessKey: "" }), transport: http() })

// Best asks for the note, read by anyone with no API key
const { entities } = await arkiv.select().from(OrderEntity)
  .where(and(eq("security", addr(NOTE)), eq("side", "sell"), gt("expiry", u64(now))))
  .orderBy(asc("price")).limit(20).fetch()