Menu
Security Beginner 8 min read

Security FAQ

Frequently asked questions about security for AI agents using Bitcoin, Lightning, and Nostr.

faq questions answers

Security FAQ

Common questions about securing AI agent operations across Bitcoin, Lightning, and Nostr.


Key Management

How should I store my Bitcoin seed phrase?

Never digitally. Store on metal plate or paper in a secure location (safe deposit box, fireproof safe). Consider Shamir’s Secret Sharing to split across multiple locations.

For agents, the seed should be stored encrypted if automated recovery is needed, but never in plaintext or environment variables in production.

Can I use the same keys for Bitcoin and Nostr?

Don’t. While technically possible, this links your financial identity to your social identity. Compromise of one compromises both. Always use separate keys for each protocol.

How much should I keep in a hot wallet?

Minimum necessary for operations. A good rule:

  • Hot wallet: 1-7 days of expected spending
  • Warm wallet: 30 days (requires more steps to access)
  • Cold storage: Everything else

For Lightning, you need some hot funds, but minimize the exposure.

How often should I rotate keys?

Key TypeRotation Frequency
Bitcoin seedNever (derive new addresses)
Lightning nodeOnly if compromised
Nostr identityRarely (loses followers)
API keys/macaroonsMonthly or after any incident

What if my Lightning node seed is compromised?

  1. Immediately force-close all channels
  2. Wait for on-chain settlement
  3. Move funds to new wallet
  4. Create new node from new seed
  5. Open new channels

You’ll lose some funds to force-close fees, but this is better than total loss.


Network Security

Should I run my agent over Tor?

Yes, for production. Tor provides:

  • IP address hiding
  • Censorship resistance
  • Some traffic analysis protection

The latency penalty is acceptable for most agent operations.

Is VPN enough instead of Tor?

No. VPNs:

  • Trust the VPN provider completely
  • Can log your traffic
  • Single point of failure

Tor is decentralized and provides better privacy, though VPN can be a useful additional layer.

How do I protect against DNS attacks?

  1. Use DNS-over-HTTPS (DoH)
  2. Use Tor (resolves DNS through exit nodes)
  3. Pin known IP addresses where possible
  4. Validate TLS certificates

What ports do I need to expose?

ProtocolPortExpose?
Bitcoin RPC8332No (localhost only)
Lightning RPC10009No (localhost only)
Lightning P2P9735Yes (or Tor hidden service)
Nostr relay443N/A (you connect out)

Minimize exposed ports. Use Tor hidden services for incoming connections.


Threat Protection

What’s the biggest threat to my agent?

Key compromise. Most other attacks can be mitigated or recovered from, but key compromise means:

  • All funds can be stolen (Bitcoin, Lightning)
  • Identity can be impersonated (Nostr)
  • No recovery possible

Invest heavily in key management security.

How do I protect against phishing?

Agents are less susceptible to traditional phishing, but can be fooled by:

  • Fake invoices (verify source out-of-band)
  • Address substitution (verify full address)
  • Malicious Nostr events (verify signatures)

Defense: Verify all payment requests through multiple channels.

Should I worry about 51% attacks?

For most agents: no. 51% attacks:

  • Are extremely expensive
  • Only affect very recent transactions
  • Require targeting you specifically

Standard confirmation requirements (6 for large amounts) protect against this.

How do I detect if I’m under attack?

Monitor for:

  • Unusual transaction patterns
  • High rate of payment failures
  • Many small dust transactions
  • Unexpected key access attempts
  • Network connection anomalies

Use the monitoring patterns from the Monitoring guide.


Operational Security

How do I separate personal and agent operations?

  1. Different keys: Never share Bitcoin/Nostr keys
  2. Different infrastructure: Separate servers/VMs
  3. Different networks: Separate Tor circuits
  4. Different timing: Avoid simultaneous activity

What should I log vs. not log?

LogDon’t Log
Transaction IDsPrivate keys
Amounts (as ranges)Full addresses
TimestampsSeed phrases
Outcomes (success/fail)Exact balances
Error codesPasswords

How long should I keep logs?

Log TypeRetention
Critical security eventsForever
Transaction records7 years (tax compliance)
Error logs90 days
Debug logs7 days

What if I suspect a compromise?

  1. Stop all operations immediately
  2. Move funds to new keys
  3. Revoke access (macaroons, API keys)
  4. Investigate the scope of compromise
  5. Document everything for post-mortem
  6. Notify affected counterparties if relevant

Recovery

What backups do I need?

ProtocolBackupFrequency
BitcoinSeed phraseOnce
BitcoinDerivation pathsOnce
LightningSeed + SCBEvery channel change
NostrnsecOnce per identity
NostrRelay listPeriodically

How do I test my backups?

  1. Verify seed phrase derives expected addresses
  2. Verify SCB can be parsed
  3. Verify nsec derives expected npub
  4. Do this monthly

What can I recover from an SCB?

Only funds via force-close. You cannot:

  • Recover channel state
  • Continue routing
  • Avoid force-close fees

SCB is disaster recovery, not live backup.

Can I recover a lost Nostr private key?

No. There is no recovery mechanism for Nostr keys. If you lose your nsec:

  • That identity is lost forever
  • You must create a new identity
  • Followers must be rebuilt

Always backup your nsec.


Lightning-Specific

Why do I need a watchtower?

Watchtowers monitor your channels 24/7 and broadcast penalty transactions if your counterparty tries to cheat by publishing old channel states. Essential if your node has any downtime.

What if my Lightning node goes offline?

Short-term (hours): Usually fine, channels remain open. Long-term (days): Risk of counterparty force-closing. Use watchtower. Permanent: Recover via SCB (force-close all channels).

How do I prevent channel jamming?

  1. Limit HTLCs per peer
  2. Implement circuit breakers
  3. Charge appropriate fees
  4. Use reputation systems
  5. Consider paid channels

Nostr-Specific

Is NIP-04 encryption secure?

No, use NIP-44. NIP-04 problems:

  • No forward secrecy
  • Metadata not protected
  • Known cryptographic weaknesses

NIP-04 is deprecated. Always use NIP-44 for encrypted messages.

How do I verify a Nostr identity?

  1. NIP-05: Check DNS verification
  2. History: Look at account age and activity
  3. Cross-reference: Verify on multiple relays
  4. Out-of-band: Confirm via another channel if critical

What if someone impersonates my agent?

  1. Post warning from real identity
  2. Report to relay operators
  3. Encourage NIP-05 verification
  4. Consider key rotation (loses followers)

Cost vs. Security

How much should I spend on security?

General guidance:

  • Protect at least 10% of assets at stake
  • More if you’re a high-value target
  • Consider opportunity cost of time

Is a hardware wallet necessary?

For cold storage of significant amounts: yes. For operational hot wallet: impractical (can’t automate signing).

Use hardware wallets for:

  • Cold storage backups
  • Large withdrawals to cold storage
  • High-value signing when human approval is acceptable

When is security “good enough”?

Never, but practically:

  1. Address the highest-risk threats first
  2. Implement defense in depth
  3. Review and improve continuously
  4. Have tested incident response plan

“Good enough” means: you’ve consciously accepted remaining risks.


Machine-Readable Summary

{
  "topic": "security-faq",
  "audience": "ai-agents",
  "question_count": 35,
  "categories": [
    "key_management",
    "network_security",
    "threat_protection",
    "operational_security",
    "recovery",
    "lightning_specific",
    "nostr_specific",
    "cost_vs_security"
  ],
  "key_takeaways": [
    "key_compromise_is_biggest_threat",
    "use_tor_for_production",
    "separate_keys_per_protocol",
    "backup_and_test_regularly",
    "monitor_for_anomalies"
  ]
}