Giter Club home page Giter Club logo

nostr-types's Introduction

nostr-types

Crates.io MIT licensed Stable Docs Master Docs

nostr-types is a crate defining types useful for the nostr protocol.

We wrap all basic types. An i64 may or may not be a Unixtime. A &str might be a hex encoded private key, or it might be somebody's name. By using types for everything, common mistakes can be avoided.

We have extensive serde implementations for all types which are not simple to serialize such as Tag.

Private keys remember if you've seen them or imported them and set themselves to Weak if you have. Generated private keys start out as Medium. We don't support Strong yet which will require a hardware token. (Note: there are ways to leak a private key without it knowing, so if it says Medium that is the maximum security, not a guaranteed level of security). Private keys can be imported and exported in a password-keyed encrypted form without weakening their security.

License

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any additional terms or conditions.

nostr-types's People

Contributors

cryptoquick avatar ezicheq avatar faern avatar fiatjaf avatar mikedilger avatar optout21 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

Watchers

 avatar  avatar  avatar  avatar  avatar

nostr-types's Issues

NIP-47 Nostr Wallet Connect for Gossip

Nostr Wallet Connect (NWC) describes a way for clients to access a remote Lightning wallet through a standardized protocol. This allows users to make payments directly in the Nostr client app without switching context when opening another wallet.

Alby, Mutiny, Umbrel are wallets which already support NWC.
Amethyst, Damus, Primal and Nostur can servce as examples how the UI for NWC could look like.

NIP-47 spec: https://github.com/nostr-protocol/nips/blob/master/47.md
Alby SDK for clients (only JS): https://github.com/getAlby/alby-js-sdk#nostr-wallet-connect-documentation

Switch signature library from k256 to secp256k1

I'd recommend switching from k256 to secp256k1 because the library using C bindings to the same library used by Bitcoin Core are much faster, is better maintained, and it still compiles to wasm, since we also use it in BDK and RGB. I discovered k256 was much slower when I went to try it out for the Rana Nostr vanity key generator. If you're curious and want to see for yourself the difference, try this branch:
grunch/rana@main...cryptoquick:rana:perf-k256

Don't strip trailing slashes from relay urls

Stripping trailing slashes seems like a bug. In gossip, if I add a relay like wss://some.host/path/, the trailing slash gets stripped (which can be a problem if the server doesn't respond to both URLs), and then the NIP-11 request fails because it actually requests https://some.host/. I think slashes in the path of a url should always be preserved.

Use a workspace to seprate types from binary

What do you thing of separating moving the types into a sub crate with the types separated from the binary? This would let other projects use the types without the larger dependencies of the binary, specifically reqwest and tungstenite which are not necessarily needed depending on what the other project is doing.

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.