-
Notifications
You must be signed in to change notification settings - Fork 13
RIP Esplora, configure bitcoin-d as chain source. #21
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Let's not take a plaintext password from command line here, please. Let's parse username password from the default
.cookie
file and let the user supply an override path.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.
That does sound like a good idea, but this needs more thought.
iiuc, the .cookie is ephemeral and is meant for local-only access; it is read-only if we use the same user for bitcoin-d as the LDK daemon.
For remote access, I think the RPC user and pass in bitcoin.conf need to be set.
Similarly, it is equivalent to have an rpc-user and rpc-pass in ldk-server.conf.
Generally, just relying on RPC (pass) isn't a sufficient security measure; most people need to configure bitcoind with secure network access in addition to RPC authentication.
I checked this for both LND and c-lightning; they do it the same way i.e., credentials in a file: https://docs.corelightning.org/reference/lightningd-config.
We should probably switch to rpc-auth instead of rpc-user-password for the bitcoind connection.
Currently, given that the cookie method restricts bitcoin-d usage to local-only, I don't think we should restrict ourselves to that method.
Uh oh!
There was an error while loading. Please reload this page.
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.
Mhh, I tend to disagree. Supplying these parameters via shell input means that they might get inadvertently distributed across different hosts/history files. IMO, there is a notable difference between reading RPC credentials from (likely hopefully protected by
700
permissions) config file and reading them as arguments, which might leak to other users on the same host throughps
or similar.Not sure how
rpc-auth
is different here? It's just the username and the hashed password in a single string, which is exactly the.cookie
format?Uh oh!
There was an error while loading. Please reload this page.
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.
As noted in main PR description, CLI reading is a stop-gap solution until the next PR which introduces read all args from file.
All the CLI options are moving to a config file. Hence it is is equivalent.
RPCAuth refers https://github.com/bitcoin/bitcoin/blob/master/share/rpcauth/rpcauth.py , where we configure
`rpcauth=$username:$SALT$hash
It is different from
.cookie
since .cookie is ephemeral and is meant for local access only.Afaik, rpc-auth is the preffered method for accessing bitcoind remotely: https://bitcoin.stackexchange.com/a/90420
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.
Is there a pressing need for this PR? Why not just do the next one instead?
Uh oh!
There was an error while loading. Please reload this page.
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.
I don't see a reason to block this on next one, given they are independent from functionality perspective.
Reading from config is in
milestone-3
(#11), and i will have to prioritize it. It also helps me if all the possible config options are checked-in more or less, before i think about config-file schema. Also hoping that it is easier to test with bitcoind than setup local esplora.Given I have already said that we will move all args to config file, and only take config-file path as input, i assume we can move forward with that?
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.
It's literally the same scheme. The
.cookie
just housesrpcauth
token with user__cookie__
and a random password. If we implement reading.cookie
files first, we'd get a way to supplyrpcauth
params from file for free.In any case, I don't want to hold up this PR over it if we agree that this is a stop-gap solution that will be dropped in the future anyways.
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.
Will defer to y'all, but note we already have code supporting cookie-based auth in LDK sample.
Uh oh!
There was an error while loading. Please reload this page.
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.
The reason the cookie doesn't work for us is that it is ephemeral.
Not really an option for us as default unless we support other methods.