Sphinx
object Sphinx
Content copied to clipboard
see https://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md
Functions
compute Blinding Factor
Link copied to clipboard
fun computeBlindingFactor(pub: PublicKey, secret: ByteVector): ByteVector32
Content copied to clipboard
compute Ephemeral Public Keys And Shared Secrets
Link copied to clipboard
fun computeEphemeralPublicKeysAndSharedSecrets(sessionKey: PrivateKey, publicKeys: List<PublicKey>): Pair<List<PublicKey>, List<ByteVector32>>
Content copied to clipboard
Compute the ephemeral public keys and shared secrets for all nodes on the route.
compute Shared Secret
Link copied to clipboard
fun computeSharedSecret(pub: PublicKey, secret: PrivateKey): ByteVector32
Content copied to clipboard
generate Filler
Link copied to clipboard
Generate a deterministic filler to prevent intermediate nodes from knowing their position in the route. See https://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md#filler-generation
generate Key
Link copied to clipboard
generate Stream
Link copied to clipboard
hash
Link copied to clipboard
When an invalid onion is received, its hash should be included in the failure message.
peek Payload Length
Link copied to clipboard
Peek at the first bytes of the per-hop payload to extract its length.
peel
Link copied to clipboard
fun peel(privateKey: PrivateKey, associatedData: ByteVector, packet: OnionRoutingPacket, packetLength: Int): Either<FailureMessage, DecryptedPacket>
Content copied to clipboard
Decrypt the incoming packet, extract the per-hop payload and build the packet for the next node.