{"id":31378713,"url":"https://github.com/rust-nostr/nostr-elixir","last_synced_at":"2025-09-28T06:58:23.746Z","repository":{"id":306495120,"uuid":"1026026032","full_name":"rust-nostr/nostr-elixir","owner":"rust-nostr","description":"Nostr - Elixir bindings","archived":false,"fork":false,"pushed_at":"2025-07-25T22:03:23.000Z","size":702,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-18T00:33:48.094Z","etag":null,"topics":["elixir","nostr","nostr-protocol"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rust-nostr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-25T07:31:10.000Z","updated_at":"2025-09-01T06:56:16.000Z","dependencies_parsed_at":"2025-07-26T03:26:26.406Z","dependency_job_id":"0778b1ea-e5d7-4fe6-9ac9-8548d33929da","html_url":"https://github.com/rust-nostr/nostr-elixir","commit_stats":null,"previous_names":["rust-nostr/nostr-elixir"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rust-nostr/nostr-elixir","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-nostr%2Fnostr-elixir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-nostr%2Fnostr-elixir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-nostr%2Fnostr-elixir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-nostr%2Fnostr-elixir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-nostr","download_url":"https://codeload.github.com/rust-nostr/nostr-elixir/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-nostr%2Fnostr-elixir/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277335333,"owners_count":25800967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-28T02:00:08.834Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","nostr","nostr-protocol"],"created_at":"2025-09-28T06:58:22.735Z","updated_at":"2025-09-28T06:58:23.737Z","avatar_url":"https://github.com/rust-nostr.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NostrElixir\n\nA complete Elixir wrapper for the [nostr](https://github.com/rust-nostr/nostr) Rust library, built with Rustler for high performance.\n\n## Modular API Structure\n\nNostrElixir is organized into logical modules for clarity and maintainability:\n\n- `NostrElixir.Keys`   – Key management (generation, parsing, conversions)\n- `NostrElixir.Nip19`  – NIP-19 encoding/decoding\n- `NostrElixir.Event`  – Event creation, signing, verification, helpers\n- `NostrElixir.Filter` – Filter creation and helpers\n\nThe root `NostrElixir` module provides a facade for common operations, but direct use of submodules is recommended for clarity and maintainability.\n\n## Usage Examples\n\n### Key Management\n```elixir\nalias NostrElixir.Keys\n\n# Generate a new keypair\nkeys = Keys.generate_keypair()\n# %{public_key: ..., secret_key: ..., npub: ..., nsec: ...}\n\n# Parse a secret key\nparsed = Keys.parse_keypair(keys.nsec)\n\n# Convert keys\nnpub = Keys.public_key_to_bech32(parsed.public_key)\nnsec = Keys.secret_key_to_bech32(parsed.secret_key)\n```\n\n### NIP-19 Encoding/Decoding\n```elixir\nalias NostrElixir.Nip19\n\nnpub = Nip19.encode(\"npub\", \"eec7245d6b7d2ccb30380bfbe2a3648cd7a942653f5aa340edcea1f283686619\")\nresult = Nip19.decode_map(npub)\n# %{data_type: \"npub\", data: ...}\n```\n\n### Event Creation, Signing, and Verification\n```elixir\nalias NostrElixir.{Keys, Event}\n\nkeys = Keys.generate_keypair()\nevent_json = Event.new(keys.public_key, \"Hello, Nostr!\", 1, [])\nsigned_event_json = Event.sign(event_json, keys.secret_key)\nverified = Event.verify(signed_event_json) # true\n```\n\n### Filter Creation and Helpers\n```elixir\nalias NostrElixir.Filter\n\n# Create a filter for fetching text notes (kind 1) by a user\nfilter_json = Filter.user_notes_filter(\"eec7245d6b7d2ccb30380bfbe2a3648cd7a942653f5aa340edcea1f283686619\")\nfilter = Jason.decode!(filter_json)\n# filter[\"authors\"] == [\"...\"]\n\n# Create a filter for fetching a user's follow list (kind 3)\nfollow_list_filter_json = Filter.user_follow_list_filter(\"eec7245d6b7d2ccb30380bfbe2a3648cd7a942653f5aa340edcea1f283686619\")\nfollow_list_filter = Jason.decode!(follow_list_filter_json)\n# follow_list_filter[\"kinds\"] == [3]\n\n# Hashtag search\nfilter_json = Filter.search_hashtag(\"nostr\")\n```\n\n## Backward Compatibility\n\nThe root `NostrElixir` module still provides delegates for the most common operations, so existing code will continue to work. However, for new code, it is recommended to use the submodules directly.\n\n## Features\n\n- Key Management: Generate, parse, and convert keys\n- NIP-19: Encode/decode bech32 addresses\n- Event Management: Create, sign, verify, and serialize events\n- Filter Management: Create filters for querying events\n- Idiomatic, modular Elixir API\n- High performance via Rust NIFs\n\n## Roadmap\n\n- [ ] Async event signing support (if/when needed)\n- [ ] Full event verification implementation (if nostr Rust API changes)\n- [ ] Relay connection management\n- [ ] Event subscription handling\n- [ ] More convenience functions for common nostr operations\n\n## License\n\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-nostr%2Fnostr-elixir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-nostr%2Fnostr-elixir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-nostr%2Fnostr-elixir/lists"}