-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Relay onion messages to compact node id (#2821)
To save space, blinded routes may use a compact node id (scid + direction instead of public key) as an introduction node. When using such a compact route, the sender must use it's knowledge of the network to convert that to a public key, however trampoline users don't have that knowledge, they must transmit the compact route to the trempoline provider. We extend the spec to allow compact node ids in the `next_node_id` field. Co-authored-by: t-bast <[email protected]>
- Loading branch information
1 parent
62b739a
commit 86c4837
Showing
23 changed files
with
267 additions
and
116 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
eclair-core/src/main/scala/fr/acinq/eclair/EncodedNodeId.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package fr.acinq.eclair | ||
|
||
import fr.acinq.bitcoin.scalacompat.Crypto.PublicKey | ||
|
||
sealed trait EncodedNodeId | ||
|
||
object EncodedNodeId { | ||
/** Nodes are usually identified by their public key. */ | ||
case class Plain(publicKey: PublicKey) extends EncodedNodeId { | ||
override def toString: String = publicKey.toString | ||
} | ||
|
||
/** For compactness, nodes may be identified by the shortChannelId of one of their public channels. */ | ||
case class ShortChannelIdDir(isNode1: Boolean, scid: RealShortChannelId) extends EncodedNodeId { | ||
override def toString: String = if (isNode1) s"<-$scid" else s"$scid->" | ||
} | ||
|
||
def apply(publicKey: PublicKey): EncodedNodeId = Plain(publicKey) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.