Oddbean new post about | logout
 Ah ok. That would be a fairly straightforward improvement. 
 I think the major issue is that the service has access to both, the encrypted nsec and the key to decrypt it. Plus and service that is between the service and the client will have access to both, e.g., Cloudflare, TLS termination thingy. It’s just not a good approach to the storage of keys unless the organization hosts it in their own trusted infrastructure 🐶🐾🫡 
 Wut? End-to-end encryption; why would Cloudflare or any MITM have it?

The nsec is encrypted at disk, user needs to talk to the bunker to provide pssphrase to decrypt it every time it reboots/forgets the nsec.

Ofc there’s a trust element which is why open sourcing it is fundamental and reproducible builds and even better running in a secure enclave are ideal. 
 Because Cloudflare sees your traffic in clear, because they terminate your TLS connection. So are the other services or equipment that does that 

I think the point was that service that runs nsecbunker has access to the nsec as is, it doesn’t matter if it’s stored encrypted or not, it’s an easy fix to intercept the key if service wanted to.

Enclave or HSM with the proper and standard encryption key exchange and zero exposure of unencrypted nsec or the key is the only way I see it being trustworthy. 🐶🐾🫡 
 the communications with the bunker are over relays, it's no direct HTTPS connection 🤔
 
 I do not have full visibility into the code at this time, but how does the key gets into the bunker, and how does the passphrase get to nsec bunker to decode the key. I am strictly talking about the initial setup. 🐶🐾🫡 
 over nostr, nip04 encrypted payloads

it doesn't expose any direct APIs because the whole point was to be able to run it behind a firewall without doing any holepunching tricks (other than left-side-of-the-curve "just use nostr" holepunching) 
 Ok, that makes sense. Thanks for clarifying this 🐶🐾🫂🫡 
 i forget where i saw it implemented... maybe i even wrote an RPC recently that lets you do that unlock remotely so it never touches the disk...

oh, no, it was my former sponsor... let me see...

https://github.com/indra-labs/indra/tree/089a0df491fd76ac393875053625f9fd4fdbe140/pkg/storage

uses protobuf - you will see the proto and the generated pb.go code in there, that is an unlocker that stays off-disk

a second best option is using an environment variable, you can protect that behind root privileges 
 This sounds super interesting. I’m not too familiar with go or gRPC but would love to understand the mechanics of this off disk unlock or remote signing. 

AFK right now but I’ll have a look later and might send a few questions. 
 it's pretty simple... just a different interface than keyboard input or a file or an environment variable

it was written as it was intended to be possible to avoid storing any sensitive data at rest on indra relays for the lightning network setup, probably should be paired with a lock signal as well that is easy to trigger 
 This sounds super interesting. I’m not too familiar with go or gRPC but would love to understand the mechanics of this off disk unlock or remote signing. 

AFK right now but I’ll have a look later and might send a few questions. 
 it's pretty simple... just a different interface than keyboard input or a file or an environment variable

it was written as it was intended to be possible to avoid storing any sensitive data at rest on indra relays for the lightning network setup, probably should be paired with a lock signal as well that is easy to trigger