Skip to content

[bug]: Alice forgets about her own private channels when routing a circular payment back to herself through Bob #9618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ZZiigguurraatt opened this issue Mar 20, 2025 · 1 comment
Labels
bug Unintended code behaviour needs triage

Comments

@ZZiigguurraatt
Copy link

Consider the following scenario:

           TAP
 Alice <---------> Bob
           SAT
        (private)

where Alice and Bob both have allow-circular-route set.

If Alice tries to pay an invoice to herself with AllowSelfPayment: true, it doesn't route the payment unless she also has Private: true when running AddInvoice.

Alice should be smart enough to know about her own private channels with Bob without needing the Private flag set to true. Especially since taproot asset channels are currently always private channels. We really need Alice to be able to not have to think or even know that those taproot asset channels are private channels and still be able to use them as if they are normal channels, because to her they should be no different than a public channel since they are her channels.

Why would Alice ever want to make such a circular self payment?

  1. As a workaround to [feature]: allow settlement of an invoice to yourself without routing the payment #7419
  2. If the channel between Alice and Bob is also a taproot assets channel and Alice wants to trade a taproot asset for sats with Bob, without routing through any other nodes.
@ZZiigguurraatt ZZiigguurraatt added bug Unintended code behaviour needs triage labels Mar 20, 2025
@ZZiigguurraatt
Copy link
Author

ZZiigguurraatt commented Mar 20, 2025

Also, in the following configuration, when Bob creates an invoice with Private: true, hop hints to Alice and Dave are not included because of

// To ensure we don't leak unadvertised nodes, we'll make sure our
// counterparty is publicly advertised within the network. Otherwise,
// we'll end up leaking information about nodes that intend to stay
// unadvertised, like in the case of a node only having private
// channels.
var remotePub [33]byte
copy(remotePub[:], channel.RemotePubkey.SerializeCompressed())
isRemoteNodePublic, err := cfg.IsPublicNode(remotePub)
if err != nil {
log.Errorf("Unable to determine if node %x "+
"is advertised: %v", remotePub, err)
return nil, false
}
if !isRemoteNodePublic {
log.Debugf("Skipping channel %v due to "+
"counterparty %x being unadvertised",
channel.ShortChannelID, remotePub)
return nil, false
}
, so there is no way for Bob to do a circular payment back to himself through either of them. Bob can only do a circular payment back to himself through Charlie. However, Bob's channel with Charlie is not a taproot assets channel, so Bob can't do a direct trade of a taproot asset for sats.

           TAP
 Alice <---------> Bob <---------> Charlie <---------> Frank
           SAT      ^      SAT                 SAT
        (private)   |    (public)            (public)
                    |
                    |   ⏜
                    |   p
                    |   r
                   T|S  i
                   A|A  v
                   P|T  a
                    |   t
                    |   e
                    |   ⏝
                    |
                    v
                  Dave

@ZZiigguurraatt ZZiigguurraatt changed the title [bug]: Alice forgets about her own private channels when routing a cirular payment back to herself through Bob [bug]: Alice forgets about her own private channels when routing a circular payment back to herself through Bob Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unintended code behaviour needs triage
Projects
None yet
Development

No branches or pull requests

1 participant