Just-in-time channels
Get 0-conf channels, just in time, without having to wait for on-chain confirmation
How does it work?
The just-in-time channel service uses wrapped invoices and 0-conf channels to instantly connect users to the Lightning network. All you have to do is have the sender pay the invoice ZEUS shows you, but here's what happens under the hood:
- The receiver generates an invoices on their lightning node and then sends it to the LSP
- The LSP creates a wrapped invoice and returns it to the receiver
- The receiver gives the wrapped invoices to sender for them to pay
- The sender pays the invoice, which goes through the LSP
- The LSP detects the payment and opens up a 0-conf, just in time, channel to the receiver
- The LSP then forwards the payment to the receiver using that new channel and the payment is completed
Wrapped invoices
Wrapped invoices are invoices with extra layers around them. In this instance, the LSP will wrap an invoice generated from your node. The wrapped invoice will appear as if it is generated by the LSP.
This has two benefits:
1) The end user doesn't have to expose their node's public key to senders. The LSP knows the receiver but no one else does. 2) Senders can use routes to the LSP to make a payment instead of having to find a direct path to the end user.
Wrapped invoices uses the same preimage hash as the original invoice. This means that the LSP can't settle the payment without the final receiver completing the payment, so the LSP can't run away with the user's funds.
Be sure to keep ZEUS open when receiving payment as the LSP cannot settle payments on your behalf when you're offline.
Requirements
To use the service, your Lightning node must have SCID aliases and the 0-conf protocol enabled.
You can read about how to enable these settings on an LND node here. If building on LDK, the Mutiny Wallet node source code may be a good point of reference.
API
Interfaces
The just-in-time channels advance service only has one interface: a REST interface, specified below.
Base URLs
Mainnet: https://0conf.lnolymp.us
Testnet3: https://testnet-0conf.lnolymp.us
Mutinynet: https://mutinynet-flow.lnolymp.us
Calls
GET /api/v1/info
Response
{
"connection_methods": [
{
"address": "45.79.192.236",
"port": 9735,
"type": "ipv4"
},
{
"address": "r46dwvxcdri754hf6n3rwexmc53h5x4natg5g6hidnxfzejm5xrqn2id.onion",
"port": 9735,
"type": "torv3"
}
],
"pubkey": "031b301307574bbe9b9ac7b79cbe1700e31e544513eae0b5d7497483083f99e581"
}
Client SHOULD connect as a peer via any of the connection methods provided from the info
endpoint, otherwise the LSP will be unable to open a channel to them.
POST /api/v1/fee
Request
{
"amount_msat": 100000000,
"pubkey": "027e6e...274e"
}
Response
{
"amount_msat": 2500000, #Fee amount in msats, charged in the wrapped invoice
"id": "9b1deb4d-...-2b0d7b3dcb6d" #Fee rate id, to be passed into the /proposal endpoint
}
POST /api/v1/proposal
Request
{
"bolt11": "lntb1...", #Original Lightning invoice from the client.
"fee_id": "9b1deb4d-...-2b0d7b3dcb6d", #Fee ID returned from the /fee endpoint
"simpleTaproot": true #Optional flag to request a Simple Taproot Channel. If not specified, a standard anchor channel will be opened.
}
Response
{
"jit_bolt11": "lntb5..." #Wrapped Bolt11 invoice which can be sent to the sender for payment
}