Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Use Bitcoin Core regtest with two local Lightning nodes for the safest, most repeatable payment-flow test. Regtest gives you a private blockchain and control over block creation, so you can create invoices, route payments, inspect settlement, and repeat failures without risking real bitcoin. Move to public Lightning testnet only when your test specifically needs public peers, shared-network behavior, or testnet infrastructure.

What “safe Lightning testing” means

A Lightning payment test is safe when every asset, node, invoice, callback, and failure path is isolated from mainnet funds and from data you did not intend to expose. The test should prove more than “a payment request was generated.” A useful end-to-end check covers:

  • Invoice creation on the receiving node.
  • Payment initiation on the sending node.
  • Route selection and channel liquidity.
  • Receiver-side settlement, including the invoice state.
  • Sender and receiver balance changes.
  • Application callbacks, including proof-of-payment handling.
  • Expected failures such as expired invoices, invalid invoices, missing routes, and insufficient available balance.

Keep development keys and wallets separate from any wallet that holds real bitcoin. Testnet coins are not mainnet bitcoin, but they still represent credentials, channel state, and application data that should be treated as disposable development material.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the right network before you build the test

The environment determines what your test can prove. Core Lightning recommends experimenting on testnet4 or regtest. Bitcoin Core describes regtest as a new private chain with the same basic rules as testnet, except that you decide when blocks are created. That control makes it the default choice for local integration work.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Environment Best for Trade-off
Bitcoin Core regtest Local, repeatable tests with controlled block creation It is an isolated private chain, so it does not test public peers, public routing, or shared-network conditions.
Implementation-specific local simulation, such as an LND simnet workflow Local development flows and implementation-specific integration checks Behavior is specific to that simulator and implementation.
Public testnet Interaction with public peers, shared testnet channels, and testnet-specific infrastructure Peers, blocks, funding availability, and public services are outside your control.

Use regtest when determinism matters

Start with regtest when you need a test that can run on a laptop or in continuous integration and produce the same result repeatedly. You can mine blocks on demand, recreate wallets and channels, and avoid waiting for unrelated peers or public services. Bitcoin Core enables this mode with the -regtest network setting.

Use a local simulator for implementation-specific checks

A simulator can be appropriate when the behavior under test depends on one Lightning implementation’s APIs, database, or routing logic. LND documents simnet as a locally mined environment intended for development. Treat simulator results as evidence about that implementation, not as proof that every Lightning node or public testnet behaves identically.

Use public testnet only for public-network behavior

Choose public testnet when the requirement itself is public connectivity: discovering or connecting to public peers, using shared channels, exercising a testnet service, or checking behavior under conditions you do not control. Public testnet is inherently less deterministic. A test can fail because a peer is offline, a route has changed, blocks are delayed, or a faucet or service is unavailable.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prepare an isolated two-node setup

A minimal flow needs a Bitcoin backend and two Lightning nodes: one sender and one receiver. The nodes need to be configured for the same intended network. Do not infer the network from a wallet label or an application screen; verify the implementation’s explicit network configuration. Bitcoin Core documents separate regtest and testnet settings, and LND documents testnet and regtest backends.

Keep identities and credentials separate

  • Run development nodes with development data directories and credentials.
  • Never import a mainnet seed, signing key, or channel backup into a test environment.
  • Record which node is the sender and which is the receiver so balance assertions cannot be reversed accidentally.
  • Keep logs and invoice data local when the test does not require public access.
  • Use disposable test identities for automated runs and destroy them after the run.

Fund the chain and channels in the right order

On regtest, create and confirm the on-chain funding transactions by producing blocks under your control. Then connect the two Lightning nodes and open a channel with enough capacity for the invoice amount and routing fees used by the test. A channel that exists but is not usable is not a successful setup: its state and available balance must be checked before payment.

Rank #2
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter | USB C Dongle with 90W Max Power Delivery, 3×5Gbps USB A Data Ports, for MacBook, Dell, and More (Charger Not Included)
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Core Lightning documents a local two-node regtest helper. LND documents local simulation workflows. Follow the exact commands and startup options for the implementation and release you have installed; network names, startup flags, and API details are implementation-specific.

Run the invoice-to-payment test

  1. Confirm the network. Verify that the Bitcoin backend and both Lightning nodes are on regtest, the intended simulator, or public testnet. Stop if any component is on mainnet.
  2. Start the backend and nodes. Wait for each node to report that it is ready before creating wallets, channels, or invoices.
  3. Connect the nodes. Establish the peer connection and inspect the peer state. In Core Lightning, listpeers is the documented way to inspect peer and channel state.
  4. Establish a usable channel. Confirm the channel according to the rules of your network and implementation. Confirmation requirements are not universal: Core Lightning’s documented counts differ between testnet and mainnet, so never copy a mainnet number into a testnet or regtest assertion.
  5. Create an invoice on the receiver. Use the receiver’s invoice API or command. In LND, the AddInvoice API returns a payment request and exposes invoice state, including whether it is settled. Store the payment request only in the test data needed for this run.
  6. Pay from the sender. Submit the payment request through the sender. A routed payment may involve an intermediate hop in a simulated workflow; a direct two-node channel is sufficient for a basic invoice-to-payment check.
  7. Wait for the terminal result. Distinguish a pending payment from a succeeded, failed, or canceled payment. Do not mark a test passed merely because the sender accepted the request.
  8. Verify both sides. Inspect the sender’s channel balance, the receiver’s credited balance, and the receiver’s invoice settlement state. The Lightning Labs tutorial checks balance changes after payment; use the same idea as an assertion in your own test harness.
  9. Record evidence. Save the invoice identifier, payment result, settlement state, relevant channel balances, and timestamps. Avoid logging private keys or unnecessary personal data.

How to prove that a payment settled

Use multiple independent signals rather than one optimistic response. The strongest basic assertion is that the receiver reports the invoice as settled and that the expected balance changes appear on both sides. A sender-side “payment sent” message without receiver settlement can represent an in-flight or failed operation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Receiver invoice state: the invoice is marked settled, not merely created or accepted.
  • Receiver balance: the expected amount is credited, subject to the implementation’s fee and accounting behavior.
  • Sender balance: the channel balance decreases by the payment and applicable routing fee.
  • Payment result: the sender reports a terminal success state rather than pending, failed, or canceled.
  • Application record: your merchant or service marks the order paid only after the verified settlement condition.

Assert exact amounts using the unit and rounding rules of your application. If your application supports partial payments, multi-part payments, or fees paid by a route, define those rules before writing the assertion.

Test failure paths deliberately

Once the happy path passes, repeat the flow with controlled failures. Keep these cases in regtest or a local simulator so a bad invoice cannot consume funds you did not intend to spend.

Expired invoice

Create an invoice with a short expiry, allow it to expire, and attempt payment after the expiry condition. The expected result is a rejected or failed payment and no receiver settlement. Your application should leave the order unpaid and make the failure visible to the caller.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Invalid or malformed invoice

Submit a deliberately invalid payment request to the sender. Confirm that validation fails before funds move and that the application reports a useful error instead of retrying indefinitely.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Missing route or insufficient balance

Use a channel topology with no route, or reduce available balance below the invoice amount. Confirm that the sender reports failure, the receiver invoice remains unsettled, and balances are unchanged apart from any implementation-defined temporary reservations that are released.

Duplicate invoice behavior

Submit the same invoice twice. LND’s API documentation states that duplicate invoices are rejected. Test your application against that behavior: a retry after a network timeout must not create a second order fulfillment or credit the customer twice.

Channel closure and recovery

Exercise channel closure where it matters to your product. The Lightning Labs tutorial includes channel closure in its simulated workflow. Verify how your application handles a channel that is closing, unavailable, or reopened, and ensure that an old route is not treated as permanently usable.

Safely handle BIP 321 proof-of-payment callbacks

If your payment flow uses a BIP 321 URI and proof of payment, callback handling is part of the security boundary. Lightning does not have a global transaction ledger equivalent to an on-chain transaction history, so a Lightning proof of payment needs a separate mechanism. For a BOLT 11 invoice in the URI, BIP 321 identifies the payment information as the payment preimage encoded in hexadecimal.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray | Data transfer & Fast charging for MacBook, iPhone 17/16/15, iPad, Samsung Galaxy, Apple Watch
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Validate the callback before opening it. BIP 321 requires a wallet to validate the requested callback URI scheme and not open a scheme that launches a browser or another disallowed handler. Your test should therefore include:

  1. A callback using the locally supported application scheme.
  2. A callback with an unsupported required behavior, which should prevent payment as specified.
  3. A callback that points to an arbitrary remote URI, which must not be opened merely because it appears in a payment request.
  4. A callback containing unexpected or excessive user information, to verify that the application does not leak data.
  5. A successful callback that remains inside the intended installed application and records the preimage only where the application needs it.

Do not treat a browser opening or an HTTP response as proof that a Lightning payment settled. Settlement must still be confirmed through the invoice and payment state described above.

Public testnet funding and wallet limitations

Bitcoin developer documentation names a community faucet for on-chain testnet satoshis, and a Lightning Labs tutorial mentions a testnet Lightning faucet as a possible later exercise. Those references do not establish that either service is currently operating. Faucet reliability, amount limits, queueing, and terms can change. Do not promise readers a working faucet or build a release test that depends on one without checking its current official status.

Third-party wallet compatibility is also not established by the available documentation. Keep wallet-specific instructions out of a generic test plan unless you have verified the wallet’s current network support, invoice format, callback behavior, and recovery process in its own official documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshoot by layer

The nodes cannot connect

  • Check that both nodes use the same network and compatible connection settings.
  • Confirm that the backend is running and reachable from each node.
  • On public testnet, distinguish a local configuration error from an offline or unreachable public peer.

The channel exists but payment fails

  • Inspect channel state and available balance, not just the channel record.
  • Check whether the invoice amount plus fees fits the sender’s usable balance.
  • Check route availability and whether the channel has reached the confirmation state required by that implementation.

The sender reports success but the order is unpaid

  • Query the receiver’s invoice settlement state.
  • Compare sender and receiver balance changes.
  • Keep the order pending until the receiver-side evidence is available.

The test passes locally but fails on public testnet

  • Separate deterministic application assertions from public-network assumptions.
  • Record peer, route, block, and service dependencies in the test result.
  • Retry only according to an explicit policy; do not hide a public-infrastructure failure by treating every retry as success.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

A practical test matrix

Case Expected receiver state Expected sender state Pass evidence
Valid invoice, usable route Invoice settled and amount credited Payment succeeded and channel balance reduced Settlement state plus both balance checks
Expired invoice Invoice remains unsettled Payment fails or is rejected No fulfillment and visible expiry error
Invalid invoice No settlement Validation or payment failure No funds moved
No route or insufficient balance No settlement Payment fails Balances remain consistent with the failed attempt
Duplicate invoice submission One settlement at most Second submission is rejected or identified as already paid No duplicate fulfillment
Unsafe proof callback Payment is blocked when required callback validation fails No payment is authorized Unsupported or arbitrary callback is not opened

Regtest, simulator, or public testnet: a decision rule

Ask what the test must prove. If the answer is “our invoice, payment, accounting, and callback code work repeatedly,” choose regtest. If the answer is “this implementation behaves correctly under its local development model,” choose its documented simulator. If the answer is “we can communicate with public peers or use shared testnet infrastructure,” choose public testnet and accept that peer availability, blocks, funding, and routes are variables.

Best Value
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Many teams use all three in sequence: deterministic regtest tests for every change, simulator-specific integration tests for API behavior, and a smaller public-testnet smoke test for connectivity. Keep the environments’ assertions separate so a public route failure does not look like a payment-accounting regression.

Frequently Asked Questions

Can I test Lightning payments without risking real bitcoin?

Yes. A two-node Bitcoin Core regtest setup uses a private chain and developer-controlled block production, so the payment flow is isolated from mainnet.

Is public testnet better than regtest?

Neither is universally better. Regtest is better for repeatable local tests; public testnet is appropriate when public peers or shared testnet infrastructure are part of the behavior you need to verify.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What proves that a Lightning payment actually settled?

Require a terminal successful payment result, a settled invoice on the receiver, and the expected sender and receiver balance changes. A request being accepted is not sufficient.

Should a wallet open a proof-of-payment callback automatically?

Only after validating the callback scheme and required behavior under BIP 321. Unsupported or arbitrary handlers should not be opened merely because they appear in a payment URI.

Can I rely on a testnet faucet or a particular wallet?

Do not assume current availability or compatibility. Faucet status and third-party wallet behavior change, so verify each service and wallet against its current official documentation before depending on it.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.