fix: use correct Lightning.Pub pubkey and pointer in ndebit generation
The ndebit must encode Lightning.Pub's pubkey (not the ATM's pubkey) so that Kind 21002 debit requests are received by Lightning.Pub. Also added the 'atm' pointer to identify which Lightning.Pub user account should pay the invoice. Fixes: - Changed pubkey from ATM identity to Lightning.Pub pubkey - Added pointer: 'atm' to ndebit encoding - Updated hardcoded pubkey to match current Lightning.Pub instance Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
cf053730c6
commit
a28c113087
1 changed files with 7 additions and 3 deletions
|
|
@ -40,7 +40,7 @@ const LOCAL_IP = '192.168.1.122' // Change this to your machine's local IP
|
||||||
|
|
||||||
const DEV_CONFIG = {
|
const DEV_CONFIG = {
|
||||||
// Lightning.Pub Nostr pubkey (from docker logs - check with: docker logs lamassu-lightning-pub | grep pubkey)
|
// 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
|
// Local strfry relay - use local IP for cross-device testing
|
||||||
relayUrl: `ws://${LOCAL_IP}:7777`,
|
relayUrl: `ws://${LOCAL_IP}:7777`,
|
||||||
// Admin token for HTTP API (development only)
|
// Admin token for HTTP API (development only)
|
||||||
|
|
@ -202,10 +202,14 @@ function createATMServices(
|
||||||
generateNdebit: async (context: ATMContext): Promise<string> => {
|
generateNdebit: async (context: ATMContext): Promise<string> => {
|
||||||
console.log('[ATM Service] Generating ndebit for', context.satsAmount, 'sats')
|
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({
|
const ndebit = encodeNdebit({
|
||||||
pubkey: _identity.publicKey,
|
pubkey: DEV_CONFIG.lightningPubPubkey,
|
||||||
relay: DEV_CONFIG.relayUrl,
|
relay: DEV_CONFIG.relayUrl,
|
||||||
|
pointer: 'atm', // Lightning.Pub user identifier for the ATM account
|
||||||
})
|
})
|
||||||
|
|
||||||
// Format as full URI with amount
|
// Format as full URI with amount
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue