Skip to content
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

Static Key #8

Open
lnbc1QWFyb24 opened this issue Jul 9, 2022 · 11 comments
Open

Static Key #8

lnbc1QWFyb24 opened this issue Jul 9, 2022 · 11 comments

Comments

@lnbc1QWFyb24
Copy link

Is it possible to have a static public key so that the remote node can limit the rune to that key? Or does a new key need to be created every time it is initialised with the gen_key method?

@jb55
Copy link
Owner

jb55 commented Jul 11, 2022

yes this will be easy to add and why there is a generate_key step. I planned on having a set_key function as well. I haven't had the need for it yet though which is why it doesn't exist.

@lnbc1QWFyb24
Copy link
Author

Yeah the use case I am thinking is for a server to communicate to a core ln node. The idea I am playing with would be a simple API that can be deployed to run in front of your node at home. So it would be great to have a rune with full permissions, but limit it to the public key of the lnsocket.

@jb55
Copy link
Owner

jb55 commented Jul 12, 2022 via email

@lnbc1QWFyb24
Copy link
Author

Legend thank you!

@jb55
Copy link
Owner

jb55 commented Jul 15, 2022

there is now an lnsocket_setkey in v0.3.2 for setting static keys. Let me know if you run into any issues!

@jb55 jb55 closed this as completed Jul 15, 2022
@jb55
Copy link
Owner

jb55 commented Jul 15, 2022

js example here:

const goodkey = "9a5419eacf204a917cf06d5f830e48bc1fcb3e33bb60932e837697c8b7718f6f"
if (!ln.setkey(goodkey))
t.ok(false, "expected goodkey to succeed")
const nodeid = "03f3c108ccd536b8526841f0a5c58212bb9e6584a1eb493080e7c1cc34f82dad71"
await ln.connect_and_init(nodeid, "24.84.152.187")

@jb55 jb55 reopened this Jul 15, 2022
@jb55
Copy link
Owner

jb55 commented Jul 15, 2022

hmm it might be good to have a method that gets the pubkey...

@lnbc1QWFyb24
Copy link
Author

Awesome will give this a go.

@lnbc1QWFyb24
Copy link
Author

Yeah a method that gets the pubkey would be super handy. Saves having to load tiny-secp256k1 in the browser to derive the pub key.

@lnbc1QWFyb24
Copy link
Author

Or even a method to get the keypair after generating the key. That way you can use set key in a later session with the private key

@jb55
Copy link
Owner

jb55 commented Jul 22, 2022

yup it's definitely needed... will add in a bit

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

No branches or pull requests

2 participants