A cli util for generating nostr events
Go to file
2023-08-01 20:41:00 -04:00
.github/workflows .github/workflows/... building 2023-07-23 14:06:26 -04:00
deps embed libsecp256k1 build 2022-08-08 15:46:36 -07:00
devtools Add missing file 2022-08-09 07:51:04 -07:00
doc Adds install doc for Ubuntu (#24) 2023-03-05 11:02:56 -05:00
ext/secp256k1 Add secp256k1 from https://github.com/bitcoin-core/secp256k1 2023-05-20 03:26:57 -04:00
scripts cleanup scripts 2022-12-01 06:42:27 -08:00
.envrc direnv envrc 2022-07-13 10:40:33 -07:00
.gitignore .gitignore: .DS_Store 2023-07-23 12:57:12 -04:00
.gitmodules .github/workflows/... building 2023-07-23 14:06:26 -04:00
aes.c encrypted dms 2022-04-14 19:30:27 -07:00
aes.h encrypted dms 2022-04-14 19:30:27 -07:00
base64.c encrypted dms 2022-04-14 19:30:27 -07:00
base64.h Add CMake and Windows Visual Studio build 2023-05-20 03:31:35 -04:00
build.cmake.sh Add CMake and Windows Visual Studio build 2023-05-20 03:31:35 -04:00
CHANGELOG Release v0.1.0 2022-11-17 13:21:07 -08:00
clock_gettime.h Add CMake and Windows Visual Studio build 2023-05-20 03:31:35 -04:00
CMakeLists.txt CMakeLists.txt: Debug/Release CMAKE_BUILD_TYPE 2023-08-01 20:41:00 -04:00
compiler.h initial commit 2022-04-14 07:52:29 -07:00
configurator.c Add CMake and Windows Visual Studio build 2023-05-20 03:31:35 -04:00
COPYING add license 2022-08-17 07:53:45 -07:00
cursor.h Add CMake and Windows Visual Studio build 2023-05-20 03:31:35 -04:00
default.nix nix build 2022-04-20 17:15:25 -07:00
endian.h initial commit 2022-04-14 07:52:29 -07:00
hex.h initial commit 2022-04-14 07:52:29 -07:00
Makefile .github/workflows/... building 2023-07-23 14:06:26 -04:00
nostril-query nostril-query: fix limit:0 queries 2022-11-21 16:28:48 -08:00
nostril.c .github/workflows/... building 2023-07-23 14:06:26 -04:00
proof.h add proof-of-work mining 2022-04-15 10:30:52 -07:00
random.h encrypted dms 2022-04-14 19:30:27 -07:00
README.md Change README to .md for Formatting to Work 2023-01-22 19:54:29 -08:00
sha256.c initial commit 2022-04-14 07:52:29 -07:00
sha256.h initial commit 2022-04-14 07:52:29 -07:00
shell.nix add --mine-pubkey 2022-08-28 14:34:58 -07:00

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.

--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