Skip to content

Connect to known nodes via Noise_XK - #307

Closed
Varunram wants to merge 9 commits into
mit-dci:masterfrom
Varunram:noisexk
Closed

Connect to known nodes via Noise_XK#307
Varunram wants to merge 9 commits into
mit-dci:masterfrom
Varunram:noisexk

Conversation

@Varunram

@Varunram Varunram commented Aug 3, 2018

Copy link
Copy Markdown
Contributor

Since we know the pubkey of nodes we connected to previously, use Noise_XK to connect to them and connect to new nodes using Noise_XX

Since we know the pubkey of nodes we connected to previously, use
Noise_XK to connect to them. Connecting to new nodes still uses Noise_XX
@delbonis

delbonis commented Aug 6, 2018

Copy link
Copy Markdown
Collaborator

Should we have some way for forcibly connect to a known node using XX?

@Varunram

Varunram commented Aug 6, 2018

Copy link
Copy Markdown
Contributor Author

Hm, to break the trust web that the PK provides, nice idea, maybe I'll put that into its own PR so that it doesn't delay this PR getting in :) Might want to have that option in lit itself to ensure that we don't trust anyone by their PKs permanently.

@adiabat

adiabat commented Aug 20, 2018

Copy link
Copy Markdown
Collaborator

This is cool -- not sure why you'd want to force XX though if you already have the key? It seems like the only advantage of XX is that you learn the remote key at the end.

@Varunram

Copy link
Copy Markdown
Contributor Author

Thinking back, I don't know either. If he has a new pubkey, he'd have a new listening address as well. But might be that you want to forcibly connect because you want to reverify his PK or something..

@adiabat

adiabat commented Aug 20, 2018

Copy link
Copy Markdown
Collaborator

XK mode does (re?)verify their pubkey. It just doesn't tell you it if you don't know it already.

Comment thread lndc/conn.go
logging.Info("Received pubkey", s)
if lnutil.LitAdrFromPubkey(s) != remotePKH {
logging.Infoln("Received pubkey", remotePK)
if lnutil.LitAdrFromPubkey(remotePK) != remotePKH && !Noise_XK {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to make sense to switch these clauses around, so that if Noise_XK is true it will not do the comparison.

Comment thread lndc/conn.go
return nil, fmt.Errorf("Remote PKH doesn't match. Quitting!")
}
logging.Infof("Received PKH %s matches", lnutil.LitAdrFromPubkey(s))
logging.Infof("Received PKH %s matches", lnutil.LitAdrFromPubkey(remotePK))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logging statement should be different when Noise_XK is true - you didn't check that it matches. Something like "Assuming PKH still matches" or just don't log it at all.

@Varunram

Varunram commented Sep 20, 2018

Copy link
Copy Markdown
Contributor Author

Don't merge / review yet, needs rework on top of master.

@Varunram

Copy link
Copy Markdown
Contributor Author

Closing this in favour of #435

@Varunram Varunram closed this Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants