Local2Coin Documentation

Rails, Wallet, Services, and Architecture

Gráfico en desarrollo

Local2Coin Documentation

Local2Coin is built on the P2Pagos open-source multi-rail payment infrastructure.

P2Pagos uses:

  • /mono as the Nuxt-based orchestrator repo.
  • /wallet as the mobile self-custodial settlement wallet, based on an Aqua Wallet fork.
  • /dashboard as the embedded Nuxt mini app for /wallet settings and flows, replicable on desktop.
  • /marketplace as the closed-source multi-user layer built on top of /mono.
  • BTCPay Server as the backend for settlement infrastructure.

The stack is designed around:

  • inbound rails
  • modular services
  • self-custodial settlement
  • multi-rail payment architecture
  • practical cross-border money movement
  • reduced dependency on a single processor, bank, country, or rail

Repository roles

RepositoryLicenseRoleStatus
/monoMITNuxt-based orchestrator for rails, flows, services, and shared utilitiesEarly orchestrator base
/walletMITAqua Wallet fork for mobile self-custodial settlement and /dashboard integrationPlanned P2Pagos wallet layer
/dashboardMITNuxt mini app embedded into /wallet for payment flows and settingsPlanned
/marketplaceClosed-sourceMulti-user marketplace layer built on top of /monoCommercial layer

Architecture


/mono

/mono is the orchestrator repo for P2Pagos.

It assembles payment rails, business flows, infrastructure services, and shared utilities into a single Nuxt-based workspace.

This repository is still being cleaned up and should be read as an early orchestrator base, not as a finished product.

Structure

/
├── nuxt.config.js      root Nuxt app — loads all workspace modules
├── app.vue
├── pages/
├── server/
├── rails/              payment rail modules
├── flows/              business flow modules
├── services/           infrastructure service modules
└── utils/              shared utilities

What /mono is not

  • Not a finished marketplace.
  • Not a polished public SDK.
  • Not stable enough yet to promise broad production use.

/mono modules

Rails

Payment rail modules inject pages, composables, and server handlers into the host app. They can also run standalone as Nitro servers.

PackagePathPageAPI
@p2pagos/templaterails/template/rails/template/api/rails/template
@p2pagos/peachrails/peach/rails/peach/api/rails/peach/*
@p2pagos/robosatsrails/robosats/rails/robosats/api/rails/robosats/*

Flows

Higher-level feature modules with pages and UI components.

PackagePathPages
@p2pagos/bookingflows/booking/flows/booking, /flows/booking/embed

Services

Infrastructure modules that run both as standalone Nitro apps and embeddable Nuxt modules.

PackagePathRoutesNotes
@p2pagos/ipservices/ipRate limiting and IP geolocation, disabled by default
@p2pagos/torservices/tor/api/tor, /api/tor/**Tor reverse proxy, disabled by default
@p2pagos/marketservices/market/api/market/**KYC-free offer aggregator for Bisq, RoboSats, and Peach, disabled by default

Inbound multi-rails

RailStatusCurrencyPayment MethodsSettlementFeeVerificationPrivacy
BTCImplementedSATSOn-chain & LightningBitcoin on-chainNoneNoneTotal
USDTImplementedUSDLiquid & PolygonUSDT Liquid & PolygonNoneNoneTotal
Peach (p2p-api-integration)TestingGlobalAnyBitcoin on-chainHighNoneTotal
RoboSats (p2p-api-integration)TestingGlobalAnyBitcoin on-chainHighNoneTotal
MoonPay ACH USD (cex-api-integration)DesigningUSDACHUSDT(?)NoneStandardNone
Mostro (p2p-api-integration)EvaluatingGlobalAnyBitcoin on-chainHighNoneTotal
Guardarian (cex-api-integration)PlannedUSD, EUR, GBP, CAD, AUD, JPY, TRY, PLN, SEKCredit/Debit Cards & Google/Apple PayBitcoin on-chainMediumNone or StandardPossible with RUC structure
Paygate (cex-api-integration)PlannedGlobalCredit/Debit CardsUSDT PolygonMediumNoneTotal
DePix (cex-api-integration)PlannedBRLPixBRL on LiquidLowNoneTotal
Kamipay (cex-api-integration)PlannedBRLPixUSDT PolygonLowStandardNone
MtPelerin (cex-api-integration)PlannedEUR & CHFSEPABitcoin on-chain or USDT PolygonLowEnhancedPossible with RUC structure
Bitzed (cex-api-integration)PlannedZMWMobile moneyBitcoin on-chainLowNoneTotal
Matbea (cex+p2p-api-integration)PlannedRUBYandex Pay, Sberbank, Tinkoff, YooMoney, SBP P2P, mobileBitcoin on-chainLowNoneTotal

Service modules

ServiceStatusScopePurposeDefault
ipTestingGlobalIP geolocation, country detection, currency detection, and rate limitingDisabled by default
torTestingGlobalTor reverse proxy for onion and Tor-based integrationsEnabled if consumed by an enabled rail
corsTestingGlobalCORS reverse proxy for target APIsEnabled if consumed by an enabled rail
marketTestingGlobalKYC-free offer aggregation and external offersEnabled if consumed by an enabled rail
invoicePlannedMultiple countries, many of them in LATAMProgrammatic electronic invoice generation upon payment settlement, based on Invopop, with planned Paraguayan SIFEN integration through TIPS SA modulesDisabled by default

/mono local development

pnpm install
pnpm dev
pnpm build
pnpm preview

/mono module loading

The root Nuxt app loads workspace modules through nuxt.config.js.

Adding a module requires:

  1. Add "@p2pagos/<name>": "workspace:*" to root package.json dependencies.
  2. Add '@p2pagos/<name>' to the modules array in nuxt.config.js.

flows/booking requires @nuxt/ui. It must be present in nuxt.config.js before or alongside the booking module.


/mono environment variables

services/tor

VariableRequiredDefaultDescription
NUXT_TOR_PROXY_SECRETYesShared secret sent in X-Tor-Proxy-Secret header
NUXT_TOR_SOCKS_URLNosocks5h://127.0.0.1:9050SOCKS5h URL of the local Tor daemon

rails/robosats

VariableRequiredDefaultDescription
NUXT_ROBOSATS_COORDINATOR_URLNoRoboSats default onionCoordinator onion base URL
NUXT_TOR_PROXY_SECRETYesShared secret for the embedded @p2pagos/tor proxy
NUXT_TOR_SOCKS_URLNosocks5h://127.0.0.1:9050SOCKS5h URL of the local Tor daemon

rails/peach

VariableRequiredDefaultDescription
NUXT_PEACH_BASE_URLNohttps://api.peachbitcoin.comPeach API base URL
NUXT_PEACH_BITCOIN_MNEMONICYesBIP39 mnemonic for wallet key derivation
NUXT_PEACH_PGP_PRIVATE_KEYYesArmored PGP private key
NUXT_PEACH_PGP_PUBLIC_KEYYesArmored PGP public key
NUXT_PEACH_PGP_PASSPHRASEYesPGP key passphrase
NUXT_PEACH_REFERRAL_CODENoPeach referral code
NUXT_PEACH_FEE_RATENohourFeeBitcoin fee rate strategy
NUXT_PEACH_MAX_PREMIUMNo0Maximum accepted offer premium

services/ip

VariableRequiredDefaultDescription
NUXT_IP_DETECTION_CURRENCYNofalseExpose currency derived from Cloudflare cf-ipcountry header in event.context.ipDetection
NUXT_IP_DETECTION_COUNTRYNofalseExpose country code in event.context.ipDetection
NUXT_IP_DETECTION_CLOUDFLARE_SECRETNoShared secret to verify requests come through Cloudflare
NUXT_IPINFO_API_KEYNoIPinfo API key
NUXT_IP_DETECTION_RATE_LIMITNo100Max requests per IP per minute
NUXT_IP_DETECTION_LIMIT_PATHSNoComma-separated list of API paths to rate-limit

services/market

VariableRequiredDefaultDescription
NUXT_TOR_PROXY_SECRETYesAuth secret for the inline Tor proxy handler
NUXT_ROBOSATS_COORDINATOR_ONION_URLNoRoboSats default onionRoboSats coordinator onion address
NUXT_TOR_SOCKS_URLNosocks5h://127.0.0.1:9050SOCKS5h URL of the local Tor daemon

/mono known issues

IssueDetail
@nuxt/kit version mismatchrails/peach, rails/robosats, and services/tor declare @nuxt/kit ^3.13.0, while the root app, rails/template, and flows/booking use ^4.0.0. The modules work in module mode via Nuxt's own kit instance, but full standalone migration to ^4.0.0 is pending.

/wallet

/wallet is the mobile self-custodial wallet for P2Pagos, based on an Aqua Wallet fork.

This repository exists because Aqua already provides a strong base for the settlement layer P2Pagos needs, while still allowing extension toward P2Pagos-specific payment flows, settings management, and marketplace integrations.


Why Aqua Wallet

Aqua Wallet was selected as the base for this fork because it already provides:

FeatureReason
Bitcoin and Liquid self-custodyNative self-custodial support with a single seed phrase backup
Lightning through BoltzSwap-to-Liquid flows reduce the need for users to manage channel liquidity directly
Liquid stablecoinsSupport for multiple Liquid-based stablecoins, currently including USDT and DePix
Built-in swapsSwap capabilities between supported currencies
External app marketplace modelCan be replaced by the P2Pagos embedded mini app for /settings or /dashboard
Multiple walletsSeparate seed phrases allow the same user to connect to /mono and one or more /marketplace accounts
Shamrock protocolEnables simple connection to BTCPay Server
Maintenance expectationsAqua has strong funding and reputation inside the ecosystem

/wallet planned changes

The current fork is intended to evolve into the P2Pagos mobile settlement and configuration wallet.

Planned changes include:

  • Add self-custodial Polygon wallet support derived from the existing seed phrase, in order to support USDT on Polygon.
  • If needed for future rails settling in USDT on other chains, extend support through USDT0-based interoperability, using Polygon as the main anchor network.
  • Replace Aqua's marketplace tab with a dedicated Payments tab powered by the /dashboard Nuxt mini app.
  • Integrate exchange rates from yadio.io, which are more representative of real pricing in emerging markets than exchange-only sources such as Kraken.
  • Continuously improve core functionality while regularly pulling upstream changes from Aqua.
  • Remove the distinction between Saving Account for BTC and Spending Accounts for other assets, in order to better fit the P2Pagos payment-oriented product model.
  • Add Russian and remove unnecessary languages, aligning the wallet with the default language set: EN, ES, PT, FR, IT, RU.
  • Rebrand the application as part of the P2Pagos product family.

USDT on Polygon

One of the main planned additions is self-custodial USDT support on Polygon.

The goal is to give users access to a settlement asset that is widely usable across integrable payment rails, while preserving the same wallet ownership model already used for Bitcoin and Liquid assets.

The implementation is designed around:

  • deriving Polygon wallet support from the same existing seed phrase;
  • supporting USDT on Polygon as a first-class settlement asset;
  • using a Flutter EVM stack for Polygon account derivation, signing, and contract interaction;
  • evaluating web3dart and onchainlabs_flutter;
  • minimizing user exposure to native-token operational complexity;
  • enabling network fee handling through an ERC-4337 paymaster flow;
  • abstracting fees from the normal user experience;
  • charging fees in USDT instead of requiring manual MATIC management.

This is intended to make USDT settlement operationally simpler for users who need stablecoin-based final settlement without unnecessary wallet fragmentation.


/dashboard mini app integration

The /dashboard mini app will be integrated into the wallet through a WebView-based approach.

Security model:

LayerResponsibility
FlutterCustody of seed phrase and private keys
Embedded Nuxt appPayment UI and settings interface
Capability bridgeLimited communication between Flutter and WebView
WebView layerReceives only required data and actions

The embedded Nuxt app does not receive direct access to secrets.

The bridge is limited to the data and actions required for the payment UI, such as:

  • receiving addresses
  • basic wallet context
  • signing requests

This keeps sensitive key material inside the native wallet layer while allowing P2Pagos-specific flows and settings to be built in Nuxt.


/wallet scope

The /wallet repository should be read as the mobile wallet layer of the broader P2Pagos architecture.

It is not just a generic wallet fork.

Its purpose is to provide:

  • self-custodial settlement for Bitcoin, Liquid assets, and future supported rails;
  • secure connection to BTCPay Server and related payment infrastructure;
  • an embedded interface for /dashboard and payment-related flows;
  • a mobile foundation for users interacting with /mono instances and connected marketplace environments.

Settlement flow summary


Operational model

LayerFunction
Inbound railsAccept or route payments through supported payment methods
/monoAssemble rails, flows, services, and API handlers
BTCPay ServerSettlement backend and payment infrastructure
/walletSelf-custodial mobile settlement and configuration layer
/dashboardEmbedded Nuxt interface for payment settings and flows
/marketplaceMulti-user commercial layer built on top of /mono

Current status

P2Pagos is still evolving.

Some components exist as working integrations. Others are partial, experimental, planned, or still being assembled into the main orchestrator.

The repositories should be read as active infrastructure work, not as a finished product suite.