diff --git a/lamassu-next/apps/machine/src/services/lightning.ts b/lamassu-next/apps/machine/src/services/lightning.ts index 0eee1a3..f4b68ef 100644 --- a/lamassu-next/apps/machine/src/services/lightning.ts +++ b/lamassu-next/apps/machine/src/services/lightning.ts @@ -40,7 +40,7 @@ const LOCAL_IP = '192.168.1.122' // Change this to your machine's local IP const DEV_CONFIG = { // Lightning.Pub Nostr pubkey (from docker logs - check with: docker logs lamassu-lightning-pub | grep pubkey) - lightningPubPubkey: 'f454c5eec4ec4474128e19b57b45e49c3d0851d01eea960b39ce391cdba76fc6', + lightningPubPubkey: '4be8e203a3341bb2b74a4dcbf8774e061437f63ec21af7ec3144c8d0a68e2f39', // Local strfry relay - use local IP for cross-device testing relayUrl: `ws://${LOCAL_IP}:7777`, // Admin token for HTTP API (development only) @@ -202,10 +202,14 @@ function createATMServices( generateNdebit: async (context: ATMContext): Promise => { console.log('[ATM Service] Generating ndebit for', context.satsAmount, 'sats') - // Create ndebit with ATM's pubkey and relay + // Create ndebit with Lightning.Pub's pubkey (not ATM's pubkey!) + // The wallet sends Kind 21002 to the pubkey in the ndebit, + // so it must be Lightning.Pub's pubkey for it to receive and pay. + // The pointer identifies which Lightning.Pub user account pays (e.g., "atm") const ndebit = encodeNdebit({ - pubkey: _identity.publicKey, + pubkey: DEV_CONFIG.lightningPubPubkey, relay: DEV_CONFIG.relayUrl, + pointer: 'atm', // Lightning.Pub user identifier for the ATM account }) // Format as full URI with amount