Skip to content

Add Android Signer implementation (NIP-55) #973

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

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 136 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ members = [
"rfs/nostr-http-file-storage",

# Signers
"signer/nostr-android-signer",
"signer/nostr-browser-signer",
"signer/nostr-connect",
]
Expand Down Expand Up @@ -53,6 +54,7 @@ nostr-ndb = { version = "0.42", path = "./database/nostr-ndb", default-features
nostr-relay-builder = { version = "0.42", path = "./crates/nostr-relay-builder", default-features = false }
nostr-relay-pool = { version = "0.42", path = "./crates/nostr-relay-pool", default-features = false }
nostr-sdk = { version = "0.42", path = "./crates/nostr-sdk", default-features = false }
once_cell = "1.21"
reqwest = { version = "0.12", default-features = false }
serde = { version = "1.0", default-features = false }
serde_json = { version = "1.0", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The project is split up into several crates in the `crates/` directory:
* Libraries:
* [**nostr**](./crates/nostr): Rust implementation of Nostr protocol
* Signers
* [**nostr-android-signer**](./signer/nostr-android-signer): Nostr Android signer implementation (NIP-55)
* [**nostr-browser-signer**](./signer/nostr-browser-signer): Nostr Browser signer implementation (NIP-07)
* [**nostr-connect**](./signer/nostr-connect): Nostr Connect (NIP-46)
* [**nostr-database**](./database/nostr-database): Events database abstraction and in-memory implementation
Expand Down
2 changes: 2 additions & 0 deletions contrib/scripts/check-crates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ buildargs=(
"-p nostr --no-default-features --features alloc" # Only alloc feature
"-p nostr --no-default-features --features alloc,all-nips" # alloc + all-nips
"-p nostr-browser-signer --target wasm32-unknown-unknown"
"-p nostr-android-signer"
"-p nostr-blossom"
"-p nostr-http-file-storage"
"-p nostr-database"
Expand All @@ -61,6 +62,7 @@ buildargs=(
)

skip_msrv=(
"-p nip55" # MSRV: 1.73.0
"-p nostr-lmdb" # MSRV: 1.72.0
"-p nostr-mls-storage" # MSRV: 1.74.0
"-p nostr-mls-memory-storage" # MSRV: 1.74.0
Expand Down
1 change: 1 addition & 0 deletions contrib/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -euo pipefail
args=(
"-p nostr"
"-p nostr-browser-signer"
"-p nostr-android-signer"
"-p nostr-database"
"-p nostr-lmdb"
"-p nostr-mls-storage"
Expand Down
2 changes: 1 addition & 1 deletion crates/nostr-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ indicatif = "0.17"
nostr-connect.workspace = true
nostr-relay-builder.workspace = true
nostr-sdk = { workspace = true, features = ["all-nips", "lmdb", "tor"] }
once_cell = { version = "1.21", default-features = false }
once_cell.workspace = true
prettytable-rs = "0.10"
regex = "1.11.1"
rustyline = { version = "16.0", default-features = false, features = ["with-file-history"] }
Expand Down
21 changes: 21 additions & 0 deletions signer/nostr-android-signer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "nostr-android-signer"
version = "0.42.0"
edition = "2021"
description = "Nostr Android signer implementation (NIP-55)."
authors.workspace = true
homepage.workspace = true
repository.workspace = true
license.workspace = true
readme = "README.md"
rust-version = "1.73.0"
keywords = ["nostr", "nip55", "android", "signer"]

[dependencies]
jni = "0.21"
jvm-getter = "0.1" # MSRV: 1.73.0
nostr = { workspace = true, features = ["std"] }
once_cell.workspace = true
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true, features = ["std"] }
tracing = { workspace = true, features = ["std"] }
17 changes: 17 additions & 0 deletions signer/nostr-android-signer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Android signer (NIP-55)

## Description

Nostr Android signer implementation ([NIP-55](https://github.com/nostr-protocol/nips/blob/master/55.md)).

## State

**This library is in an ALPHA state**, things that are implemented generally work but the API will change in breaking ways.

## Donations

`rust-nostr` is free and open-source. This means we do not earn any revenue by selling it. Instead, we rely on your financial support. If you actively use any of the `rust-nostr` libs/software/services, then please [donate](https://rust-nostr.org/donate).

## License

This project is distributed under the MIT software license - see the [LICENSE](../../LICENSE) file for details
Loading
Loading