Its not generated from the users pubkey, but that is actually a really cool idea.

Right now its just set based on the status of the users NIP-05. purple for valid, orange or unknown, and red for invalid

If I made it pick the color from the pubkey I would have to find a way for it not to produce too bright or dark of colors

Reply to this note

Please Login to reply.

Discussion

Okay I think I need to do this now. The simplest way I found was to create a color using the first 6 hexadecimal numbers from a users pubkey.

This gives me the color #266815

and nostr:npub1mutnyacc9uc4t5mmxvpprwsauj5p2qxq95v4a9j0jxl8wnkfvuyque23vg the color #df1732

Since green is my favorite color and the red matches mutiny perfectly I think this is the way to go 😀

Lol, checking my Hex now 😹

That sucks 😐

a9434e is yours

this is mine

This is fun. 🤭

He's just using digits no?

Ah no, I'm fooling myself.

just go to coracle.social and check your profile details button on the top right and uncheck the thing that shows the npub so it shows hex

you can also on many clients click on a button that shows the raw JSON of your note and your pubkey appears in it in hex also

hex = 0123456789abcdef base 16 it's the most widely used encoding for binary data since forever

... button on the bottom right on nostrudel has an option to View Raw down the bottom of the menu, then click json and your pubkey hex is in the field "pubkey":"abcdef12134p23456235..."

Ow thanks! Never checked that 🙏

You're right! ✅

well, that is still pretty good... but it only takes about 2 days to mine a matching key

i recommend you make it take the first 12 characters and divide the number by two

and bias it to get your green

Even if i increased it to 12 digits it wouldn't make it much more secure since there are tons of colors that are similar enough where you cant visually tell them apart

also I like keeping it simple, since I think it would be cool if other apps started using this for something 😀

i use this in alphaama, the only change I make to to hex is remove up to 5 leading zeroes if present (because of pow keys). it works pretty well overall..

How many POW keys have you run into? I really like the idea of keeping this simple "pubkey.slice(0,6)" but id also like to have some compatibility with other clients

much less now since npubs... but there are some og accounts nostr:npub1qqqqqqyz0la2jjl752yv8h7wgs3v098mh9nztd4nr6gynaef6uqqt0n47m for example

pow keys with the first 3 bytes being a 24 bit RGB color is a cool thing to mine for... it would only probably take typically 3-4 days to get the exact colour you want

i made my miner search for beginning/contains/end based on the bech32 but this is another option

could you still use slice but start somewhere other than beginning?

btw, no idea why mine is orange when https://n.mleku.dev/.well-known/nostr.json is working

Looks like its missing the CORS headers https://cors-test.codehappy.dev/?url=https%3A%2F%2Fn.mleku.dev%2F.well-known%2Fnostr.json&origin=https%3A%2F%2Fcors-test.codehappy.dev%2F&method=get

Since noStrudel run in the browser its limited by cross origin and browser security stuff

ah, thanks, this is a fix i can make in my reverse proxy

https://cors-test.codehappy.dev/?url=https%3A%2F%2Fn.mleku.dev%2F.well-known%2Fnostr.json&origin=https%3A%2F%2Fcors-test.codehappy.dev%2F&method=get

the headers it reports say they are coming from cloudflare

i don't use cloudflare, is there something i'm missing here?

it looks like the headers are being mangled because this is what should be coming through:

modifyCORSResponse := func(res *http.Response) error {

res.Header.Set("Access-Control-Allow-Methods", "GET,HEAD,PUT,PATCH,POST,DELETE")

res.Header.Set("Access-Control-Allow-Credentials", "true")

res.Header.Set("Access-Control-Allow-Origin", "*")

return nil

}

rp.ModifyResponse = modifyCORSResponse

but this page shows

accept-ranges: bytes

cf-cache-status: DYNAMIC

cf-ray: 874eeb29c400531c-LHR

connection: keep-alive

content-length: 274

content-type: application/json

date: Mon, 15 Apr 2024 21:09:47 GMT

last-modified: Tue, 27 Feb 2024 08:16:21 GMT

server: cloudflare

wat cloudflare???

@hzrd149 is a fuckin legend

picking user profile image colour accent this way is awesome... i thought it already was because mine changed but no idea - something to do with broken nip-5 processing, but anyhow, i like my green

nostr:nevent1qvzqqqqqqypzqfngzhsvjggdlgeycm96x4emzjlwf8dyyzdfg4hefp89zpkdgz99qqsyd09035m5wl9hrmnx3q9g8f4e2eh3alw8k074j2rgs5q2fr7ehggs3s43r