Build with Word Finance
Integrate a sovereign multi-currency wallet into your dApp, website, or AI agent. Lightning payments, Solana tokens, and Brazilian Real — all through open web standards.
Lightning WebLN
Pay and receive Bitcoin Lightning invoices using the universal WebLN standard. One-click payments on any compatible site.
Solana Wallet Adapter
Full Phantom-compatible provider. Connect to Jupiter, Raydium, Magic Eden, and any Solana dApp instantly.
AI Agent Ready
Structured context blocks and clear API patterns designed for LLMs and autonomous agents to integrate programmatically.
Quick Start — 5 Minutes
1. Detect the wallet
// Check if Word Finance is available
const hasLightning = typeof window.webln !== 'undefined'
const hasSolana = window.solana?.isWordFinance === true
if (hasLightning) console.log('⚡ Lightning ready')
if (hasSolana) console.log('◎ Solana ready')
2. Pay a Lightning invoice (3 lines)
await window.webln.enable()
const result = await window.webln.sendPayment('lnbc...')
console.log('Paid! Proof:', result.preimage)
3. Connect Solana wallet (3 lines)
const { publicKey } = await window.solana.connect()
const address = publicKey.toBase58()
console.log('Connected:', address)
4. Generate a receive invoice
await window.webln.enable()
const inv = await window.webln.makeInvoice({ amount: 1000, memo: 'Coffee payment' })
console.log('Invoice:', inv.paymentRequest) // lnbc10u1p...
Wallet Detection
Word Finance injects two providers into window, following the same patterns as Phantom (Solana) and Alby (Lightning).
| Provider | Global Object | Identification Flag |
|---|---|---|
| Lightning (WebLN) | window.webln | Always present when wallet is active |
| Solana Adapter | window.solana | window.solana.isWordFinance === true |
| Auxiliary Bridge | window.wordfinanceBridge | Internal ecosystem use |
// Detect Word Finance specifically (not just any Solana wallet)
const isWordFinance = window.solana?.isWordFinance === true
// Detect any compatible Lightning wallet (Word Finance, Alby, etc.)
const hasWebLN = typeof window.webln !== 'undefined'
// Detect any Phantom-compatible wallet (Word Finance, Phantom, etc.)
const hasPhantom = window.solana?.isPhantom === true
isPhantom: true for compatibility. Use isWordFinance to identify specifically.🤖 For AI Agents & LLMs
This section is for AI systems (ChatGPT, Claude, Gemini, custom agents) that need to generate code integrating with Word Finance. It provides structured context that LLMs can consume to produce accurate integration code.
Context Block for AI Systems
Paste this entire block when asking an AI to integrate Word Finance:
/*
* WORD FINANCE WALLET — AI INTEGRATION CONTEXT
* Version: 0.4.1 | Updated: June 2026
* Paste this into your AI prompt for accurate code generation.
*
* Word Finance is a non-custodial multi-currency wallet supporting:
* - Bitcoin Lightning Network (via WebLN standard)
* - Solana, USDC, PIXC tokens (via Solana Wallet Adapter / Phantom standard)
* - PIX (Brazilian instant payment) via REST API
*
* The wallet injects providers into the browser window object:
* - window.webln → Lightning payments (WebLN spec)
* - window.solana → Solana transactions (Phantom-compatible)
* - window.wordfinanceBridge → Internal bridge (PIN verification)
*
* SECURITY: All fund-moving operations require user PIN confirmation.
* enable() and connect() only need visual approval, not PIN.
*
* DETECTION:
* Lightning: typeof window.webln !== 'undefined'
* Solana: window.solana?.isWordFinance === true
* Either: window.solana?.isPhantom === true (Phantom-compat)
*
* WEBLN METHODS:
* await webln.enable() → true
* await webln.sendPayment(bolt11) → { preimage }
* await webln.makeInvoice({amount, memo}) → { paymentRequest }
* await webln.signMessage(msg) → { message, signature, pubkey }
* await webln.getInfo() → { node: {alias, pubkey} }
*
* SOLANA METHODS:
* await solana.connect() → { publicKey }
* await solana.disconnect() → void
* await solana.signTransaction(tx) → signedTx
* await solana.signAllTransactions([txs]) → [signedTxs]
* await solana.signMessage(Uint8Array) → { signature, publicKey }
* await solana.signAndSendTransaction(tx) → { signature }
* solana.on('connect'|'disconnect'|'accountChanged', callback)
*
* REST API (base: https://webhook.wordfinance.org):
* POST /api/lightning/invoice {solanaAddress, amountSats, memo} → {bolt11}
* POST /api/lightning/pay {solanaAddress, bolt11} → {preimage}
* GET /api/lightning/balance/:address → {balance}
* GET /api/btc/balance/:address → {balance}
* POST /api/btc/send {toAddress, amountSats} → {txid}
*
* PIXC TOKEN (SPL Token on Solana Mainnet):
* Mint: AJAb19vFHfZg1Bs4eYkL2NXjHeuRXNPG8wry8p1f26fq
* Decimals: 2 | Utility token: no fixed BRL parity or redemption guarantee
*/
AI Code Generation Examples
Prompt → "Create a donation button that accepts Lightning"
// AI should generate something like this:
async function donate(amountSats) {
if (typeof window.webln === 'undefined') {
alert('Please install Word Finance from wordfinance.org')
return
}
try {
await window.webln.enable()
// Generate invoice on your server, or use Word Finance API:
const res = await fetch('https://webhook.wordfinance.org/api/lightning/invoice', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
solanaAddress: 'YOUR_RECEIVING_ADDRESS',
amountSats: amountSats,
memo: 'Donation - thank you!'
})
})
const { bolt11 } = await res.json()
const result = await window.webln.sendPayment(bolt11)
alert('Thank you for your donation! ⚡')
} catch (err) {
if (err.message.includes('recusou')) console.log('User cancelled')
else console.error('Payment error:', err)
}
}
Prompt → "Connect Solana wallet and show USDC balance"
async function connectAndShowBalance() {
if (!window.solana?.isWordFinance) {
alert('Install Word Finance at wordfinance.org')
return
}
const { publicKey } = await window.solana.connect()
const address = publicKey.toBase58()
// Fetch USDC balance using Solana RPC or your backend
const connection = new Connection('https://api.mainnet-beta.solana.com')
const USDC_MINT = new PublicKey('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v')
const tokenAccounts = await connection.getTokenAccountsByOwner(
new PublicKey(address),
{ mint: USDC_MINT }
)
console.log('USDC accounts:', tokenAccounts.value.length)
}
Prompt → "Build a Solana dApp that works with Word Finance"
// Full dApp integration pattern
class WordFinanceIntegration {
constructor() {
this.connected = false
this.publicKey = null
}
async connect() {
if (!window.solana) throw new Error('No wallet found')
const { publicKey } = await window.solana.connect()
this.publicKey = publicKey.toBase58()
this.connected = true
window.solana.on('disconnect', () => {
this.connected = false
this.publicKey = null
})
return this.publicKey
}
async signAndSend(transaction) {
if (!this.connected) throw new Error('Connect first')
const { signature } = await window.solana.signAndSendTransaction(transaction)
return signature
}
async payLightning(bolt11) {
if (!window.webln) throw new Error('No Lightning support')
await window.webln.enable()
return await window.webln.sendPayment(bolt11)
}
}
⚡ WebLN — Lightning Network
Word Finance implements the WebLN specification, the same standard used by Alby, Zeus, and other Lightning wallets. Any website or dApp that already supports WebLN works automatically with Word Finance.
enable()
Request permission to interact with the wallet. Must be called before any other method. Shows a confirmation dialog — no PIN required.
try {
await window.webln.enable()
console.log('Connected to Word Finance Lightning')
} catch (err) {
console.log('User rejected connection')
}
sendPayment(paymentRequest)
Pay a BOLT11 Lightning invoice. Shows the amount and requests PIN confirmation. The preimage in the response is cryptographic proof of payment.
const result = await window.webln.sendPayment('lnbc10u1p...')
console.log('Payment proof:', result.preimage)
makeInvoice(options)
Generate a Lightning invoice to receive payment. Amount is in satoshis.
const invoice = await window.webln.makeInvoice({
amount: 5000, // 5,000 sats
memo: 'Widget purchase' // optional description
})
console.log(invoice.paymentRequest) // lnbc50u1p...
signMessage(message)
Sign a message with the Lightning node key. Useful for LNURL-auth login flows.
const signed = await window.webln.signMessage('Login to MyApp at 2026-06-07')
// Verify: signed.signature is valid for signed.pubkey over signed.message
getInfo()
Get information about the connected Lightning wallet/node.
const info = await window.webln.getInfo()
console.log('Node:', info.node.alias)
console.log('Pubkey:', info.node.pubkey)
◎ Solana Wallet Adapter
Word Finance implements the Phantom Wallet Standard. Any dApp compatible with Phantom works with Word Finance out of the box — Jupiter, Raydium, Magic Eden, and thousands more.
connect(options?)
Connect to the wallet. Returns the user's Solana public key. Shows a confirmation dialog (no PIN).
const { publicKey } = await window.solana.connect()
const address = publicKey.toBase58()
console.log('Connected:', address)
// e.g. HMzRd7wD2R2qacryXiQSNBUCrFhsU8JAX9sWQyus88oV
// Check connection status anytime:
console.log(window.solana.isConnected) // true
console.log(window.solana.publicKey.toBase58()) // address
signTransaction(transaction)
Sign a Solana transaction. PIN required. Returns the signed transaction for the dApp to submit.
const signedTx = await window.solana.signTransaction(transaction)
// Submit to network yourself:
const sig = await connection.sendRawTransaction(signedTx.serialize())
signAllTransactions is also available for batch signing:
const signedTxs = await window.solana.signAllTransactions([tx1, tx2, tx3])
signMessage(message)
Sign an arbitrary message. Useful for authentication (Sign-In With Solana). PIN required.
const message = new TextEncoder().encode('Sign in to MyApp')
const { signature, publicKey } = await window.solana.signMessage(message)
// Send signature + publicKey to your backend to verify
signAndSendTransaction(transaction)
Sign and broadcast a transaction in one call. PIN required.
const { signature } = await window.solana.signAndSendTransaction(transaction)
console.log('TX submitted:', signature)
Events
window.solana.on('connect', (publicKey) => {
console.log('Wallet connected:', publicKey.toBase58())
})
window.solana.on('disconnect', () => {
console.log('Wallet disconnected')
})
window.solana.on('accountChanged', (publicKey) => {
if (publicKey) console.log('Switched to:', publicKey.toBase58())
else console.log('Disconnected')
})
REST API
For server-to-server integrations or when the wallet provider isn't available (mobile web, non-Electron). Base URL: https://webhook.wordfinance.org
Lightning Endpoints
/api/lightning/invoiceGenerate a Lightning invoice to receive payment.
// Request
{
"solanaAddress": "HMzRd7wD2R2...",
"amountSats": 1000,
"memo": "Coffee payment"
}
// Response
{
"bolt11": "lnbc10u1p...",
"payment_hash": "abc123...",
"status": "pending",
"expiry": "2026-06-07T12:00:00Z"
}
/api/lightning/payPay a BOLT11 Lightning invoice.
// Request
{
"solanaAddress": "HMzRd7wD2R2...",
"bolt11": "lnbc10u1p..."
}
// Response
{
"payment_hash": "abc123...",
"preimage": "def456...",
"status": "success"
}
/api/lightning/balance/:solanaAddressGet Lightning balance for a user.
Bitcoin On-chain Endpoints
/api/btc/balance/:solanaAddressGet on-chain BTC balance in satoshis.
/api/btc/sendSend BTC on-chain. Requires x-user-id header.
// Headers
x-user-id: HMzRd7wD2R2...
// Request
{
"toAddress": "bc1q...",
"amountSats": 50000,
"confirmed": true
}
// Response
{ "txid": "abc123..." }
/api/btc/healthCheck if the Lightning node is online and synced.
PIX / PIXC Endpoints
/api/deposit/pix/createCreate a PIX QR code for depositing Brazilian Reais and receiving PIXC tokens.
// Request
{
"solanaAddress": "HMzRd7wD2R2...",
"amountBRL": 50.00
}
// Response
{
"qrCode": "00020126...",
"pixKey": "...",
"expiresAt": "2026-06-07T12:30:00Z"
}
🔒 Security Model
Word Finance is a non-custodial wallet. Private keys are generated and stored on the user's device. The security model ensures no transaction happens without explicit user consent.
| Operation | PIN Required | Visual Confirmation |
|---|---|---|
webln.enable() | No | Yes — site name shown |
webln.sendPayment() | Yes | Yes — amount + destination |
webln.makeInvoice() | No | Yes — amount shown |
webln.signMessage() | Yes | Yes — message shown |
solana.connect() | No | Yes — site name shown |
solana.signTransaction() | Yes | Yes — TX details shown |
solana.signMessage() | Yes | Yes — message shown |
solana.signAndSendTransaction() | Yes | Yes — TX details shown |
Compatibility
| Platform / Protocol | Status | Notes |
|---|---|---|
| BTCPay Server | ✅ Compatible | Via WebLN — auto-detected |
| Fountain (podcasts) | ✅ Compatible | Via WebLN |
| Nostr apps (Damus, Snort) | ✅ Compatible | Via WebLN + LNURL-auth |
| Jupiter Aggregator | ✅ Compatible | Via Solana Adapter |
| Raydium | ✅ Compatible | Via Solana Adapter |
| Magic Eden | ✅ Compatible | Via Solana Adapter |
| Any Phantom-compatible dApp | ✅ Compatible | isPhantom: true |
| Any WebLN-compatible site | ✅ Compatible | window.webln standard |
| WalletConnect / Reown | 🔜 Coming Soon | QR code pairing |
| EVM chains (Ethereum, Polygon) | 🔜 Coming Soon | Requires ETH key derivation |
PIXC Token Info
| Property | Value |
|---|---|
| Name | PIXCOIN (PIXC) |
| Network | Solana Mainnet |
| Token Standard | SPL Token |
| Mint Address | AJAb19vFHfZg1Bs4eYkL2NXjHeuRXNPG8wry8p1f26fq |
| Decimals | 2 |
| Value | Utility token; no fixed BRL parity or redemption guarantee |
| Mechanism | Mint on deposit, burn on withdrawal |
| Fee | 0.5% platform fee on transactions |