nostr-types

Crates.ionostr-types
lib.rsnostr-types
version0.4.0
sourcesrc
created_at2022-12-23 04:51:40.358668
updated_at2023-03-11 23:05:16.435268
descriptionTypes for nostr protocol handling
homepage
repositoryhttps://github.com/mikedilger/nostr-types
max_upload_size
id744279
size236,934
Michael Dilger (mikedilger)

documentation

https://docs.rs/nostr-types

README

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.

Progress

Basic functionality is coded for the following NIPs. Be aware that we only provide types, so a lot of NIP content is not applicable.

  • NIP-01
  • NIP-02
  • NIP-03 - OpenTimestamps are low priority
  • NIP-04 - Will not support. Do not recommend.
  • NIP-05
  • NIP-06 - Not interesting to me, not being a bitcoiner; low priority
  • NIP-07 - n/a
  • NIP-08 - TBD
  • NIP-09 - mostly n/a but supported where applicable
  • NIP-10 - mostly n/a but supported where applicable
  • NIP-11
  • NIP-12 - TBD
  • NIP-13 - TBD
  • NIP-14
  • NIP-15 - n/a
  • NIP-16
  • NIP-19 - supported for keys only
  • NIP-20 - mostly n/a but supported where applicable
  • NIP-22 - n/a
  • NIP-25 - mostly n/a but supported where applicable
  • NIP-26 - TBD, can be done manually currently.
  • NIP-28 - Partially. EventKind recognizes, them but content handling not there.
  • NIP-35 - n/a
  • NIP-36 - mostly n/a but supported where applicable
  • NIP-40 - mostly n/a but supported where applicable

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.

Commit count: 296

cargo fmt