-
Notifications
You must be signed in to change notification settings - Fork 134
Onion messaging support #68
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
base: master
Are you sure you want to change the base?
Changes from all commits
7aa5f32
d17321d
90ace25
255c9b4
5d467fd
987a4c3
b4f3edb
dd68d45
63dd4c5
97ee6ea
bfdbdec
c3f8db7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
vendor/ | ||
.idea | ||
.aider* | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,12 @@ func main() { | |
"data.", | ||
Value: defaultHopDataPath, | ||
}, | ||
cli.BoolFlag{ | ||
Name: "onion-message", | ||
Usage: "Create an onion message " + | ||
"packet rather than a " + | ||
"payment onion.", | ||
}, | ||
}, | ||
}, | ||
{ | ||
|
@@ -203,8 +209,14 @@ func generate(ctx *cli.Context) error { | |
return fmt.Errorf("could not peel onion spec: %v", err) | ||
} | ||
|
||
var onionOpts []sphinx.OnionPacketOption | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like it doesn't compile🤔 |
||
if ctx.Bool("onion-message") { | ||
onionOpts = append(onionOpts, sphinx.WithOnionMessage()) | ||
} | ||
|
||
msg, err := sphinx.NewOnionPacket( | ||
path, sessionKey, assocData, sphinx.DeterministicPacketFiller, | ||
onionOpts..., | ||
) | ||
if err != nil { | ||
return fmt.Errorf("error creating message: %v", err) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,31 @@ | ||
module github.com/lightningnetwork/lightning-onion | ||
module github.com/gijswijs/lightning-onion | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm assuming this is changed so you can continue the development in lnd right? If that's the case, I would suggest using Basically if you have the following dir tree struct, > tree -L 1
.
├── btcsuite
├── lightning-infra
├── lightning-onion
├── lightning-terminal
├── lnd
... You can create a > tree -L 1
.
├── btcsuite
├── go.work
├── itest_logs
├── itest-db
├── lightning-infra
├── lightning-onion
├── lightning-terminal
├── lnd
... Here's my
You may need to run Finally say you've updated this
So in this case we put this line in the end,
And run |
||
|
||
require ( | ||
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da | ||
github.com/btcsuite/btcd v0.22.0-beta.0.20220207191057-4dc4ff7963b4 | ||
github.com/btcsuite/btcd/btcec/v2 v2.1.0 | ||
github.com/btcsuite/btcd v0.24.1-0.20240301210420-1a2b599bf1af | ||
github.com/btcsuite/btcd/btcec/v2 v2.3.2 | ||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f | ||
github.com/davecgh/go-spew v1.1.1 | ||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 | ||
github.com/stretchr/testify v1.8.2 | ||
github.com/stretchr/testify v1.8.4 | ||
github.com/urfave/cli v1.22.5 | ||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 | ||
golang.org/x/crypto v0.16.0 | ||
) | ||
|
||
require ( | ||
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect | ||
github.com/lightningnetwork/lnd/fn/v2 v2.0.2 // indirect | ||
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect | ||
golang.org/x/sync v0.7.0 // indirect | ||
) | ||
|
||
require ( | ||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect | ||
github.com/lightningnetwork/lnd/tlv v1.3.2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are we very sure that we want to bring in this package? Up until now, we've kept the contents of the onion packet and the actual packet encryption/construction separate. Ie, we've let this package be "unaware" of what it is encrypting (business logic). It also looks like this is only ever used in a test - so that makes me even more inclined to say that we should try not import it at all. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think you can get around it by just hard coding the resulting tlv byte streams that result from the test vectors. ie, we dont need to test our TLV library here. We can always add the full test in LND itself that then tests both the TLV lib & this onion construction logic together |
||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/russross/blackfriday/v2 v2.0.1 // indirect | ||
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect | ||
golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed // indirect | ||
golang.org/x/sys v0.15.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) | ||
|
||
|
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.
nit: can move
.gitognore
andgo.mod
changes into a new commit