Skip to content

Payment Destination

A PaymentDestination represents a seller's Bitcoin wallet configuration used to receive payments. Ludilol never holds funds — payments go directly to the seller's wallet using deterministic address derivation.

Properties

PropertyTypeDescription
IdintPrimary key
SellerIdintFK → AppUser
LabelstringHuman-readable name (e.g. "My Ledger")
TypePaymentDestinationTypeType of wallet data
NetworkBitcoinNetworkTarget network
PublicWalletDatastringThe xpub, descriptor, or Lightning address
IsActiveboolWhether this destination can receive payments
ValidationStatusValidationStatusWhether the wallet data has been validated
LastIssuedIndexintLast derivation index used for address generation
WebhookSecretstring?Secret for Lightning webhook authentication

Types

ValueNameDescription
1XpubExtended public key (BIP-44/49/84)
2DescriptorOutput descriptor (e.g. wpkh(xpub.../0/*))
3LightningAddressLightning address (e.g. user@wallet.com)

Networks

ValueName
1Mainnet
2Testnet

Validation

StatusDescription
PendingNot yet validated
ValidSuccessfully parsed and validated
InvalidFailed validation (format error)

Address Derivation

For xpub/descriptor types, each new Order gets a unique address:

  1. LastIssuedIndex is atomically incremented.
  2. The address is derived using NBitcoin: xpub/0/{index}.
  3. This ensures every order has a unique, trackable address.

Relationships

PaymentDestination (N) ──── (1) AppUser
PaymentDestination (1) ──── (N) StorePage  (on-chain)
PaymentDestination (1) ──── (N) StorePage  (lightning)
PaymentDestination (1) ──── (N) Order

Sell indie games for Bitcoin.