-
Notifications
You must be signed in to change notification settings - Fork 79
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
[nostr]: New command to publish events to nostr relays #497
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Nitesh Balusu <[email protected]>
Signed-off-by: Nitesh Balusu <[email protected]>
Signed-off-by: Nitesh Balusu <[email protected]>
This is an initial PR, we have to figure out how the message would look like. |
parsing of which message? |
Signed-off-by: Nitesh Balusu <[email protected]>
Signed-off-by: Nitesh Balusu <[email protected]>
Most people will have their private key stored in bech32 format with a prefix of nsec because that's how clients usually generate and give you, maybe we should should accept both bech32 and hex as input but while saving we convert to hex and save because we sign with the hex key. |
Sounds good to me Is it possible the key could be optional and it could just generate a key itself, or does that not make sense within the Nostr world because the key then isn't tied to your identity? |
We could generate a key and log it. People can use it to login into any other client. bos is also a client anyway. How are we tying a key to an identity by generating one? |
generating a key sounds cool to make it optional to add one, also could there be some default gateways? for identity i mean maybe the generated key wouldn't be optimal for people because it wouldn't be their normal identity so no one would be following them? |
I think it's only useful if someone will be using Nostr for the first time. Maybe |
return args.fs.getFile(nostrKeyFilePath(), (err, res) => { | ||
// Ignore errors, the file may not exist | ||
if (!!err || !res) { | ||
defaultRelaysFile.nostr.push({key: encryptKey.encrypted, node, relays: []}); |
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 think this should be a copy of the default relays file, or define it in full here
|
||
const eventId = unit8AsHex(hash); | ||
|
||
const signature = unit8AsHex(tinysecp256k1.signSchnorr(hash, hexAsBuffer(decrypt.message))); |
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.
Does this work? Wouldn't it be the key signing?
Signed-off-by: Nitesh Balusu <[email protected]>
Signed-off-by: Nitesh Balusu <[email protected]>
Signed-off-by: Nitesh Balusu <[email protected]>
Signed-off-by: Nitesh Balusu <[email protected]>
I started to look at this Some things I'm thinking should be changed though:
And maybe
Stretch
Big Stretch
So I started on it but I want to get it to MVP state in terms of feature and design |
Sounds good. You can use this for a default relay. I run it. wss://nostr.foundrydigital.com Paid relays as of today, there is a NIP where you can advertise to clients you're a paid relay. And then you build your own UI for people to come and add their pubkeys to the whitelist by paying an invoice. |
Is there a link for the paid relay stuff? |
https://github.com/nostr-protocol/nips/blob/master/11.md It's missing in this, but basically from what I understand it's just adding
Here's a paid relay website: |
ok cool i'll play with that |
I'm still working through the basics of this one, making progress |
Cool ok. |
Signed-off-by: Nitesh Balusu [email protected]
Created a new command called nostr which broadcasts messages to relays.
Protocol flow: https://github.com/nostr-protocol/nips/blob/master/01.md
Clients to use for testing: https://iris.to/
Note: Private key needs to be added in hex format.
Example relay to use: wss://nostr.foundrydigital.com
(I run this one)
Need to add this relay to your client for testing, most clients come with default relays which should also probably be added to bos.