-
Notifications
You must be signed in to change notification settings - Fork 272
Add trampoline onion support #1209
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
Conversation
This commit adds support for creating and decrypting trampoline onions. It doesn't add support for forwarding trampoline payments yet.
The code here can be tricky because we have two-levels of onion nesting (and thus two levels of decrypting then decoding) and it's easy to get confused between amounts/expiries from the outer and inner onion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass
eclair-core/src/main/scala/fr/acinq/eclair/payment/PaymentPacket.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/payment/Relayer.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/payment/Relayer.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/payment/receive/MultiPartHandler.scala
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/payment/send/PaymentInitiator.scala
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/payment/PaymentPacketSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/payment/PaymentPacketSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/payment/PaymentPacket.scala
Outdated
Show resolved
Hide resolved
* ChannelRelayPayload \ / \ | ||
* ________/\______________ \ / \ | ||
* / \ \ / \ | ||
* RelayLegacyPayload ChannelRelayTlvPayload NodeRelayPayload FinalLegacyPayload FinalTlvPayload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we rename RelayLegacyPayload
-> ChannelRelayLegacyPayload
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, but legacy already implies only channel relay. And since we're adding more dimensions to those type at some point we won't be able to mention all the dimensions inside each concrete type's name so we shouldn't strive for that 😅
We tie the type of onion packet to the payloads it may contain.
This commit adds support for creating and decrypting trampoline onions.
It doesn't add support for forwarding trampoline payments yet.