Documentation
¶
Index ¶
- Constants
- Variables
- type OnionSkin
- func (x *OnionSkin) Decode(b slice.Bytes, c *slice.Cursor) (e error)
- func (x *OnionSkin) Encode(b slice.Bytes, c *slice.Cursor)
- func (x *OnionSkin) Inner() types.Onion
- func (x *OnionSkin) Insert(o types.Onion)
- func (x *OnionSkin) Len() int
- func (x *OnionSkin) PreimageHash() sha256.Hash
- func (x *OnionSkin) ToPayment(amount ...) (p *payment.Payment)
Constants ¶
const ( MagicString = "ss" Len = magicbytes.Len + prv.KeyLen*2 )
Variables ¶
var (
Magic = slice.Bytes(MagicString)
)
Functions ¶
This section is empty.
Types ¶
type OnionSkin ¶
OnionSkin session delivers a pair of private keys to a relay that represent the preimage referred to in a Lightning payment for a session.
The preimage is hashed by the buyer to use in the payment, and when the relay receives it, it can then hash the two private keys to match it with the payment preimage hash, which proves the buyer paid, and simultaneously provides the session keys that both forward and reverse messages will use, each in different ways.
Exit nodes are provided the ciphers to encrypt for the three hops back to the client, but they do not have either public or private part of the Header or Payload keys of the return hops, which are used to conceal their respective message sections.
Thus, they cannot decrypt the header, but they can encrypt the payload with the three layers of encryption that the reverse path hops have the private keys to decrypt. By this, the path in the header is concealed and the payload is concealed to the hops except for the encryption layer they decrypt using their Payload key, delivered in this message.