Oddbean new post about | logout

Notes by hodlbod | export

 Can someone help me understand why clients won't show which relays users read / write to / from? 
 Never got around to it. But it's useful information. There is a relay list on coracle's profile pages, but it doesn't show which list it comes from 
 hello 
 Heck yeah, I put off messing with negentropy for a long time, but when I finally integrated it I was floored at how efficient it was.

https://tenor.com/bSJv9.gif 
 Now that more NIP-29 clients are starting to be available is probably worth specing a way to stor... 
 Russians have the best sense of humor

nostr:nevent1qvzqqqqqqypzq2vsfhqacvgptqdg0nxjkt34m7s8hu4m4l3wrlh28yy3dlcnx2gsqyg8wumn8ghj7m3wda4nqtn0wfnj7qfqwaehxw309a3xjarrda5kumtp0p5k6ctvd9ehguewdahxc6twv5hsz8thwden5te0vd58ymmwd93kcefwv3jhvtnww3jkx6pwd96z7qg4waehxw309ajxjar5duh8qatz9aex2mrp0yq35amnwvaz7tmdv4khyetvv9ujuemfwf5kumewdaexwtcqypnp3d7azqy6gm0nn79dsrlpxf9j7fe0ps3kf6mnxl5c822n8m8rxpjv9j5 
 Building an onboarding process without touching user keys with the current state of remote signing is like fighting with both hands glued to your face 
 Why did humans evolve to be mostly right handed? 🤔 
 Cooperation requires conventions. Sometimes conventions are in conflict with an individual's strengths. My favorite example of the left/right handed thing is that castle staircases were built so that defenders could swing wide with their right hands, while attackers were up against a wall and couldn't swing as hard. 
 Probably just chose the wrong icon, and the functionality isn't very useful for kind 1 notes, since coracle shows them fine. The idea is that for other kinds you can open the note in a client that supports the kind better. It's a first draft (like most things in coracle) and needs refinement. 
 nostr:npub1jlrs53pkdfjnts29kveljul2sm0actt6n8dxrrzqcersttvcuv3qdjynqn #asknostr I’ve implemente... 
 I personally use NIP 78 to store user preferences, which are signed events on relays. If you're storing them on your server, I wouldn't bother signing them, since they're verified by your server. Unnecessary signatures/encryption creates more requests for user signers, which is UX friction. 
 I agree, but I also think that nostr has adopted mutable state, for better or worse. I'm more concerned now about the complexity that this introduces to nostr's most important event kind. It's one thing for blog posts to support edit, which forces complexity onto only long-form clients, it's another thing to force everyone to support it. 
 I think this is a possibility. Just get rid of ranges entirely and make everything replaceable. 
 I've heard the same argument from Christians. As if God didn't invent math 
 Luddism is great. Call it "reverse technological determinism" 
 It seems the domain registrar I used got banned in my home country. I didn't realize this as I wa... 
 This is indescribably awful, but also not very surprising. Definitely need to route around DNS 
 Just found out my Coracle vulnerability made RHR as "breaking news" 🫠 
 Hey mom, I finally made it 
 No such thing as negative press? 
 nostr:nprofile1qqsf03c2gsmx5ef4c9zmxvlew04gdh7u94afnknp33qvv3c94kvwxgspz3mhxue69uhhyetvv9ujuerpd4... 
 Looks like it didn't go through before, just published again and it's updated now. 
 As users who keep our entire digital lives on a single nsec, this is sobering.

Hopefully most of... 
 I think we should bite the bullet and figure out how to make it work 
 Signers need to connect to relays in most cases 
 BugSnag is the best Nostr client. 
 🌎🔫 
 I will spare the gory details that come with parenthood, but so far the kid’s symptoms so far s... 
 Glad to hear they're ok. Scary stuff. 
 Here's a quick postmortem on the Coracle vulnerability from this morning. If you haven't heard about it, please see below.

nostr:nevent1qvzqqqqqqypzp978pfzrv6n9xhq5tvenl9e74pklmskh4xw6vxxyp3j8qkke3cezqyw8wumn8ghj76r0v3kxymmy9e3k7unpvdkx2tn5dahkcue0qy2hwumn8ghj7un9d3shjtnyv9kh2uewd9hj7qgmwaehxw309aex2mrp0yh8wetnw3jhymnzw33jucm0d5hsz9nhwden5te0v4jx2m3wdehhxarj9ekxzmny9uq3gamnwvaz7tmpd3nk7tn4w3ux7tn0dejj7qpqx953gmpz6nwhtm5ys6hadgtre90xx9t8984hdj5nkzud93rq36nsvj9r8a

First off, the offending line of code was incredibly stupid. It only took a glance to realize that something was incredibly wrong. I went back and git-blame'd the line, and discovered that it was the result of a refactor, where a local variable named `session` was replaced by an imported variable with the same name. The former was a random string (in keeping with my attempts to anonymize users). The second was a user session object, complete with private key.

This leads me to my first observation, which is that no one is auditing nostr apps (just as no one is auditing most software out there). In many cases, there isn't even a code review step, because many of us are solo devs. Just because something is open source doesn't mean you can trust it. Just because you wrote something doesn't mean you can trust it! My key was leaked right along with those of my users.

Code review aside, there were some mistakes I made that resulted in the incident being worse than it could have been:

1. I used analytics and error reporting.
2. I did not self-host my analytics and error reporting.

Because I was using a hosted error reporting service, their servers were implicated in my mistake. Had I been self-hosting, I could be more confident that the data I have deleted is actually gone (even if my users don't have the same assurance).

Action item number one: analytics and error reporting are important enough to being able to develop Coracle that I'm not planning on getting rid of them, but I am moving immediately to self-hosted options. If you want to opt-out of that data collection, there is a setting for that within Coracle.

Another mistake I made is that I trusted myself to safely handle my users' private keys. This is more than just my mistake; despite the growth in use of remote signers, it's still very common for nostr applications to offer private key login or generation. But after this incident I'm of the opinion that no one should be handling unencrypted private keys, except for signers.

Applications should not generate private keys or allow users to sign in with them. Period. In fact, I propose we sunset the term "nsec" entirely. There's no need to make a friendly encoding for something that users should never see. Instead, users should be asked to export their private keys in the password-protected ncryptsec format only. This prevents clipboard attacks or poor key management from compromising users.

This is action item number two: I've already removed private key login from Coracle, and will shortly be re-working my onboarding process to redirect users to set up a remote signer instead of generating a key.

This will have implications for UX, and might make things more difficult for new users in the short term. But as nostr:nprofile1qyt8wumn8ghj7etyv4hzumn0wd68ytnvv9hxgtcpz9mhxue69uhkummnw3ezuamfdejj7qgkwaehxw309ahx7um5wfjkc6t5v4ejummjvuhszxrhwden5te0wfjkccte9e38yctev3hkutnrdakj7qf9waehxw309askycmyv4nxwv3sxg6rqvfsxserqdf5xqczu7re0ghhvvf0waesqgqml8ernh9pvds5n0p08lpngpm6a9v749s8et8eghhclzajylw9uyzh4qru  pointed out, the longer we allow users to treat keys like passwords, the longer they're forming poor habits for keeping their keys safe, because the two are categorically different. Removing support for private keys will cause pain in the short term, but will force us to improve our integrations with remote signers, improving security and UX in the long term.

That's all I've got for now. Thank you to everyone for your graciousness, I appreciate all the support. I'm honestly glad this happened, and I hope it will galvanize all of us into action to continue to improve nostr's security. 
 yup 
 **Security Update**

I've got some bad news for you guys. This morning, as I was adding error handling to flotilla, I discovered that Coracle has been sending user session objects to bugsnag when reporting errors.

Who is affected: Users who triggered an error in Coracle while signed in with their private key, since December 5th 2023.

What I've done:

- I immediately released a new version of Coracle, both to web and to zap.store
- I have deleted the affected apks from my releases
- I have deleted all my error data from bugsnag
- I have deleted my bugsnag project and rotated my api key, so lingering error reports will be dropped
- I have audited my code for use of the session object to ensure nothing else like this is happening

What you should do:

- If you're logged in with your private key, log out
- Hard refresh the page to ensure you have the latest version of Coracle

The bottom line is that if you signed in to Coracle with your private key, it has been shared with me and with bugsnag. In practical terms, your keys should still be secure, since they were sent over TLS, and have been deleted. But there is no guarantee I can offer that they are in fact gone.

I take my users' privacy seriously. My error reporting implementation doesn't record user IPs, it redacts identifying data, and it allows users to opt-out. I also warn the user when they attempt to enter an nsec into a text field. In this case, I simply screwed up, and I sincerely apologize. Reply to this note if you have any questions. 
 Nope, the worst that would happen would be your pubkey would be shared with me. Not ideal, but also not sensitive. 
 I've been dreading this day tbh 
 Yep 
 `686f8dbd` 
 Agreed, I've been very lax with this myself. Will have to be more careful going forward. 
 The stringified json of the session object was used as the user ID, so yes, stored in plaintext and visible via the admin UI. 😭 
 Yep 
 Yep, remote signers and browser extensions are a great solution for this, and have been around for years now. 
 Unfortunately I don't think you can get simpler than nsec login. It's also the easiest way to create an account. Anything more is very confusing for normal people. You either have server-side custody, a different browser app like nsec.app, or a new app on your phone, all of which can have the same problems. A key rotation scheme would be an improvement worth having, and educating users to reduce key exposure and not use their main key for storing ecash or secret communications or whatnot seems like the way forward in the short term at least. 
 Normalizing using many keys for different use cases might be an improvement as well. 
 Keys are simple, external 3rd party dependencies aren't (and, as you note, may not be any more secure). It's all about ease of use for non-technical users. But the days of nsec login are numbered, we just need really solid flows for secure custody. nsec.app comes close. 
 Very well put 
 Agreed, it's a profitable conversation 
 It's a good start, but ultimately a custodial honeypot. Self-hosted bunkers are much better, but hard for normies. Multisig could be a great way to solve this, I know it's been worked on some. 
 I agree, nsec.app is the smoothest experience I've seen so far. Thinking about seeing if I can integrate it into the onboarding experience in Coracle, friction notwithstanding. 
 There's no standard way to do it, but lots of people have success with social key rotation. Just make a new key and tell your follows you've moved. I'm sure we'll eventually come up with something more streamlined. 
 I've asked them to, we'll see what they say 
 Yeah, this is actually a good thing. It will push us to fix these security/UX issues. 
 😅 
 I started that way, but ran into performance issues with my home baked solution. I'll take a look at glitchtip, I would definitely prefer self-hosted. 
 Correct 
 The API key is public, because it's client side. So not privileged, however forks of coracle that are not up to date and havenct removed the bugsnag key may still be vulnerable. 
 If you used alby, you're safe. 
 Married men into Bitcoin:

What are three things your wife enjoys talking about with you?

#askno... 
 1. Improving our home
2. Gardening and permaculture
3. Revolutionary France 
 whats your myers-briggs type? for science. 
 Whatever not caring/never remembering is 
 test 
 Sveltekit is so buggy 
 4 🫠

Just weird state things, like one route getting called on a different page. It's been really bad this morning. 
 Svelte is great 
 Two of my favorite projects lately are nostr-editor by nostr:nprofile1qy28wumn8ghj7ctvvahjuat50phjummwv5hszythwden5te0dehhxarj9emkjmn99uqsuamnwvaz7tmwdaejumr0dshsz9thwden5te0wfjkccte9ejxzmt4wvhxjme0qyd8wumn8ghj7un9d3shjtn8v46xzmrz0yhxxmmd9amrzqpqcesrkrcuelkxyhvupzm48e8hwn4005w0ya5jyvf9kh75mfegqx0q7duqk9  and nostr-signer-capacitor-plugin by nostr:nprofile1qythwumn8ghj7ct5d3shxtnwdaehgu3wd3skuep0qy2hwumn8ghj7un9d3shjtnyv9kh2uewd9hj7qghwaehxw309aex2mrp0yhxummnw3ezucnpdejz7qg4waehxw309ahx7um5wghx77r5wghxgetk9uqsuamnwvaz7tmwdaejumr0dshsqgxda62rewcec5dts3axd4whwsmn420k8558y34mtxcgyla9ucm5qq6vgqeu . Both projects provide high-quality solutions to specific, difficult problems that application developers can use to significantly improve their UX without reinventing the wheel. Looking forward to more of this kind of thing. 
 👀 nostr:note13h49ug83057auaytdft07p385vt8uzczn6tafsp4j6u5e7pscyfsqhtn7y 
 What client did you use to send this? It uses `note1` instead of `nevent` and doesn't have a `q` tag, which makes the quote impossible to find. 
 Now that I can see it I want to comment for real. I love demonflyingfox. The best one is the Balenciaga Harry Potter: https://www.youtube.com/watch?v=iE39q-IKOzA 
 Also a classic 
 Counterintuitive wisdom from "Design for Community":

"Go to the front door of your site and start clicking. Take the most direct path to the post button—the button that a user would click to commit his post to your site. Count the clicks it takes to get from start to finish. The more clicks it takes, the better the posts will be."

We are so trained to "reduce friction" wherever possible. But the implicit tradeoff is toward quantity, rather than quality. The author also talks about leading users through existing content before they are prompted to contribute their own. This encourages people to internalize the community's culture before disrupting it with their own untempered perspective. 
 Here's an idea for relay operators, particularly for communities: you could create a public relay that prevents spam by allowing people to post only after they have a certain amount of activity. If they're not AUTHing, or REQing, they're likely spam. Ask them to engage more with existing content before posting. 
 I think there are a lot things in the works like that, from nostr:nprofile1qythwumn8ghj7un9d3shjtnwdaehgu3wvfskuep0qydhwumn8ghj7argv4nx7un9wd6zumn0wd68yvfwvdhk6tcpzemhxue69uhku6t9dshxummnw3erztnrdakj7qg3waehxw309ahx7um5wgh8w6twv5hsz9thwden5te0wfjkccte9ejxzmt4wvhxjme0qqs2js6wu9j76qdjs6lvlsnhrmchqhf4xlg9rvu89zyf3nqq6hygt0svghc32  at least 
 # stuff 
 🙇‍♂️ 
 As always, the Nostr dev community continues to produce and experiment. Lots happening. 

nostr:n... 
 Is this from nos? I'm getting old waiting for relay/pubkey hints on quotes to become standard 
 The note includes a `note1` entity, which is just an id, and no tags. Ideally, clients would encourage people to use `nevent` entities instead, since they include relay hints, but more important would be to add a `q` tag with relay hint + pubkey hint: https://github.com/nostr-protocol/nips/blob/e3afd7ac5b72c20fe209edf3ea84cd986d0bd4ef/18.md?plain=1#L21 
 I should probably say that the bottom line is that the quoted note didn't load for me until it got replicated to other relays. A hint pointing to nos' relay or wherever the quote was living would solve that. A pubkey hint pointing to the note's author would allow me to find that person's write relays myself and look there. 
Event not found
 😂