@qntx/nostr-native
v0.15.3
Published
Native libsecp256k1 (Nitro) verification and signing backend for @qntx/nostr on React Native
Maintainers
Readme
@qntx/nostr-native
Native libsecp256k1 verification and signing for @qntx/nostr on React Native (iOS/Android), via a Nitro C++ HybridObject over vendored libsecp256k1.
npm install @qntx/nostr-native @qntx/nostr react-native-nitro-modulesimport { Keys, createEventVerifier } from "@qntx/nostr";
import { signing, verifySerialized } from "@qntx/nostr-native";
import { Relay } from "@qntx/nostr/relay";
// Verifier injection: relays verify incoming events natively.
const verifyEvent = createEventVerifier(verifySerialized);
const relay = await Relay.connect("wss://relay.example", { verifyEvent });
// Signing backend: `keys` signs on the same randomized native context.
const keys = Keys.fromSecretKey(secretKey, signing);Requirements
- React Native with the New Architecture (Nitro Modules 0.37.x), iOS and Android only.
- Expo projects need a dev client / prebuild — the module compiles from source and cannot run in Expo Go.
- libsecp256k1 v0.8.0 is vendored under
vendor/secp256k1(MIT, seevendor/secp256k1/COPYING); its symbols are namespacednostr_native_secp256k1_*, so the module links alongside other copies of libsecp256k1 in the same app. cpp/nostr_core.cis the platform-independent half of this package (context-in, status-code-outnostr_core_*functions over the vendored library);@qntx/nostr-wasmbuilds the same file for wasm32.
License
MIT OR Apache-2.0
