Alby Integration
Verify Your Agent in 10 Seconds.
The fastest, simplest way to verify your AI agent on the Lightning Network. No node setup. No terminal commands. Just your browser and Alby.
๐ฆ Alby
โก Lightning
๐ Observer Protocol
~10 seconds ยท Browser only
Prerequisites
Before you begin, make sure you have:
- โ
Alby browser extension installed โ getalby.com
- โ
Funded Alby wallet โ any amount, even 1000 sats is enough
That's it. No LND node. No command line. No server.
The 3-Step Flow
1
Generate Your OP Keypair
Generate a keypair locally on your own machine and save both keys securely.
// Save these securely
{
"pubkey": "03a1b2c3d4e5f6...",
"secret": "[save this securely]"
}
๐ Save your secret key. You'll need it to sign verification challenges. This is the ONLY time you'll need to handle raw keys with Alby.
2
Connect Alby & Register
This is where Alby shines. No config files. Just a browser popup.
// Connect to Alby extension
const provider = window.alby;
// Request connection (triggers Alby popup)
await provider.enable();
// Get your Lightning address identity
const identity = await provider.getAddress();
console.log("Your LN identity:", identity); // "you@getalby.com"
// Get your pubkey for OP registration
const pubkey = await provider.getPublicKey();
3
Sign Challenge & Verify
With generic Lightning, you'd run lncli signmessage. With Alby? One function call.
// Sign the challenge using Alby
const signature = await provider.signMessage(challenge);
// Submit to OP for verification
const verification = await fetch(
`https://observerprotocol.org/observer/agents/${agent_id}/verify`,
{ method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ signature: signature.signature, message: signature.message }) }
);
Done. Your agent is now verified on Observer Protocol.
Complete Example
<!DOCTYPE html>
<html>
<head><title>Alby ร Observer Protocol</title></head>
<body>
<h1>Verify Your Agent with Alby</h1>
<button id="verify">Start Verification</button>
<div id="result"></div>
<script>
document.getElementById('verify').addEventListener('click', async () => {
try {
const alby = window.alby;
await alby.enable();
const lnAddress = await alby.getAddress();
const lnPubkey = await alby.getPublicKey();
const opPubkey = prompt("Enter your OP pubkey:");
// NOTE (9 Aug 2026): both routes below are 404 โ /observer/agents does not
// exist on either host, and /observer/agents/{id}/verify does not either. The
// live equivalents are POST /observer/register-agent, POST /observer/challenge
// and POST /observer/verify-agent on api.observerprotocol.org (all 405 on GET,
// so present). Their request bodies were NOT exercised here, because doing so
// writes to production, so this sample is not rewritten to use them โ see
// /docs.html#api-reference for the current shapes.
const reg = await fetch('https://observerprotocol.org/observer/agents', {
method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ op_pubkey: opPubkey, ln_pubkey: lnPubkey, ln_address: lnAddress, agent_type: 'custom' })
});
const { agent_id, challenge } = await reg.json();
const sig = await alby.signMessage(challenge);
const verify = await fetch(`https://observerprotocol.org/observer/agents/${agent_id}/verify`, {
method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ signature: sig.signature, message: sig.message })
});
const result = await verify.json();
document.getElementById('result').innerHTML = result.verified
? `<h2>โ
Verified!</h2><p>Badge: ${result.badge_url}</p>`
: `<h2>โ Failed</h2><p>${result.error}</p>`;
} catch (err) { document.getElementById('result').innerHTML = `<h2>Error</h2><p>${err.message}</p>`; }
});
</script>
</body>
</html>
What Makes Alby Different
| Feature |
Generic Lightning |
Alby |
| Node required | LND/c-lightning full node | โ None โ browser extension |
| CLI commands | lncli, ssh, config | โ None โ JavaScript API |
| Identity | Raw pubkey (hex string) | โ Human-readable LN address |
| Setup time | 30+ minutes | โ 10 seconds |
Your agent is now a verified participant in the agentic economy.
Every payment is cryptographically provable. Each one is a record your agent carries, held by the agent rather than by us.