Giter VIP home page Giter VIP logo

nostril's Introduction

nostril(1)

NAME

nostril - generate nostr events

SYNPOSIS

nostril [OPTIONS...]

DESCRIPTION

nostril is a tool that creates and signs nostr events.

OPTIONS

--content The text contents of the note

--dm Create a direct message. This will create a kind-4 note with the contents encrypted>

--envelope Wrap the event with ["EVENT", ... ] for easy relaying

--kind Set the kind of the note

--created-at Set the created at. Optional, this is set automatically.

--sec Set the secret key for signing, otherwise one will be randomly generated.

--mine-pubkey Mine a pubkey. This may or may not be cryptographically dubious.

--pow Number of leading 0 bits of the id the mine for proof-of-work.

--tag Add a tag with a single value

-t Shorthand for --tag t

-p Shorthand for --tag p

-e Shorthand for --tag e

Examples

Generate an event

$ ./nostril --sec <key> --content "this is a message"
{
	"id": "da9c36bb8206e748cf136af2a43613a5ee113cb5906a09a8d3df5386039d53ab",
	"pubkey": "4f6fa8547cf2888415522918175ea0bc0eb473287c5bd7cc459ca440bdf87d97",
	"created_at": 1660750302,
	"kind": 1,
	"tags": [],
	"content": "this is a message",
	"sig": "3e4d7d93522e54f201a22944d4d37eb4505ef1cf91c278a3f7d312b772a6c6509d1e11f146d5a003265ae10411a20057bade2365501872d2f2f24219730eed87"
}

Wrap event to send to a relay

$ ./nostril --envelope --sec <key> --content "hello"
[ "EVENT",
{
	"id": "ed378d3fdda785c091e9311c6e6eeb075db349a163c5e38de95946f6013a8001",
	"pubkey": "fd3fdb0d0d8d6f9a7667b53211de8ae3c5246b79bdaf64ebac849d5148b5615f",
	"created_at": 1649948103,
	"kind": 1,
	"tags": [],
	"content": "hello",
	"sig": "9d9a49bbc66d4782030b24c71416965e790214d02a54ab132d960c2b02def0371c3d93e5a60a285c55e99721599d1332450731e2c6bb1114b96b591c6967f872"
} ]

Send to a relay

nostril --envelope --sec <key> --content "this is a message" | websocat wss://relay.damus.io

Send a nip04 DM

nostril --envelope --dm <pubkey> --sec <key> --content "this is a secret" | websocat wss://relay.damus.io

Mine a pubkey

nostril --mine-pubkey --pow <difficulty>

Reply to an event. nip10 compliant, includes the thread_id

./nostril --envelope --sec <key> --content "this is reply message" --tag e <thread_id> --tag e <note_id> | websocat wss://relay.damus.io

nostril's People

Contributors

501st-alpha1 avatar araujo88 avatar dduong42 avatar jb55 avatar joelklabo avatar randymcmillan avatar sonnyad avatar sven-hash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nostril's Issues

How can I report posts?

When I am trying to report a post, I am not sure how to add the
,"spam" at the end of the person's pubkey.

Is this possible?

signature created using nostril is not working with branle.netlify.app when its used to sign an event created on branle

Using throwaway keys

private key
9d00d99c8dfad84534d3b395280ca3b3e81be5361d69dc0abf8e0fdf5a9d52f9

public key
e8caa2028a7090ffa85f1afee67451b309ba2f9dee655ec8f7e0a02c29388180

For text created on branle.netlify.app as mentioned in noscl video:

{
  "pubkey": "e8caa2028a7090ffa85f1afee67451b309ba2f9dee655ec8f7e0a02c29388180",
  "created_at": 1660243721,
  "kind": 1,
  "tags": [],
  "content": "test12",
  "id": "b9accb8f240b02dafffd3f8fdb70df4b6db0f0c3b71087a79bcb5b842a1a4441"
}

when this is run through nostril to gets its signature, we get

./nostril --sec  9d00d99c8dfad84534d3b395280ca3b3e81be5361d69dc0abf8e0fdf5a9d52f9 --content '{
>   "pubkey": "e8caa2028a7090ffa85f1afee67451b309ba2f9dee655ec8f7e0a02c29388180",
>   "created_at": 1660243721,
>   "kind": 1,
>   "tags": [],
>   "content": "test12",
>   "id": "b9accb8f240b02dafffd3f8fdb70df4b6db0f0c3b71087a79bcb5b842a1a4441"
> }'
{"id": "2013ac8971d1a2fa2986849badf211cc37c7e82883f8180897857aba1109d8f5","pubkey": "e8caa2028a7090ffa85f1afee67451b309ba2f9dee655ec8f7e0a02c29388180","created_at": 1660243783,"kind": 1,"tags": [],"content": "{\n  \"pubkey\": \"e8caa2028a7090ffa85f1afee67451b309ba2f9dee655ec8f7e0a02c29388180\",\n  \"created_at\": 1660243721,\n  \"kind\": 1,\n  \"tags\": [],\n  \"content\": \"test12\",\n  \"id\": \"b9accb8f240b02dafffd3f8fdb70df4b6db0f0c3b71087a79bcb5b842a1a4441\"\n}","sig": "ad8ea6c9f24f692b6d49494ee14a016ee364358c21eb6bdeb762f5215e8a6b4ab4f3a6df5b1fddacae6ec42ce381579ee5796f8756dd7becdfa8bc32320543e1"}

And when that given signature ( ad8ea...) is put for that string (test12), branle says that its not a valid signature.

More info on issue here

Error: couldn't add p tag if more than 32 -p tags

Description:

I'm trying to use nostril to follow pubkeys from a list that i crafted, it's working fine with small numbers but breaks at some point.
I'm using a command that look like that:

nostril --kind 3 --envelope --sec "$privkey" $contactlist | websocat "$relay"

$contactlist is a list of all pubkeys in hex format with a -p before like that. I'm aware that im supposed to add a relay and a name but i'm not here yet and this is not the issue. It's working fine with 32 contacts:

-p <hex-pubkey-1>
-p <hex-pubkey-2>
-p <hex-pubkey-3>
etc...

Everything is working fine with 1 to 32 contact or so. But at 32 or more it breaks.
And return this error: couldn't add p tag
I tried with multiple relays, it's not a relay issue or message size issue.
If i can provide more informations, tell me what. I'd be happy to do so.
Thanks

Trying to access deleted account trought nostril tool

Hi, I used this command to access my deleted account on Damus:
nostril --envelope --sec hexprivkey --kind 0 --content "profile.deleted = false" -p hexpubkey | websocat wss://relay.damus.io

https://damus.io/note1ugqqszvgf5mdlc59he6gt7a6yf8tqddz0zq2797up6csahkutx5s887wpn

I verified my hex keys on https://damus.io/key/
I pasted hex priv/pub keys to command, run command, created ["EVENT"....] (DebLinux10) and "websocat" it to wss://relay.damus.io

Reply was ["OK","093148abddb13d94e375347dec7af7cfc264075dc407f82b8d4d096c5850a267",true,""]
I don't know if i did everything right, but it doesn't work.

Can I get a hint or solution ?

Fix readme

I see the readme is a .txt file, i wonder if it should be a .md for readability on github.com

make install error in Ubuntu 18.04 LTS

I'm running Ubuntu 18.04 LTS under Windows Subsytem for Linux. I cloned the repo without issue, as root via sudo su.

Cloning into 'nostril'...
remote: Enumerating objects: 264, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 264 (delta 1), reused 6 (delta 1), pack-reused 257
Receiving objects: 100% (264/264), 72.30 KiB | 796.00 KiB/s, done.
Resolving deltas: 100% (137/137), done.
root@xxx:/home/xxx/git-repos# cd nostril
root@xxx:/home/xxx/git-repos/nostril# make install
cc configurator.c -o configurator
./configurator > config.h
Reinitializing submodules deps/secp256k1 ...
Submodule 'deps/secp256k1' (https://github.com/bitcoin-core/secp256k1) registered for path 'deps/secp256k1'
Cloning into '/home/xxx/git-repos/nostril/deps/secp256k1'...
Submodule path 'deps/secp256k1': checked out '694ce8fb2d1fd8a3d641d7c33705691d41a2a860'
cc sha256.c
cc nostril.c
cc aes.c
cc base64.c
cd deps/secp256k1; \
./autogen.sh
./autogen.sh: 3: ./autogen.sh: autoreconf: not found
Makefile:36: recipe for target 'deps/secp256k1/configure' failed
make: *** [deps/secp256k1/configure] Error 127

I've updated Ubuntu via apt update followed by apt upgrade, with no change in behavior.

Any ideas what I'm doing wrong (aside from running Windows lol)

Cannot install on MacOS

Tried:

brew install automake
git clone https://github.com/jb55/nostril.git
cd nostril
make install

Error: install: illegal option -- D

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.