This commit implements bech32 format and segwit addressing like defined in Bitcoin implementation. A module called bech32 and another one called segwit have been created. These two modules offers the support for encoding and decoding of bech32 string in different formats. In final, 99% coverage for bech32 and 97% coverage for segwit. The document is enough for now. Added an article explaining how and why Bech32/Segwit were implemented in pure Erlang.
7.3 KiB
nostr
An implementation of nostr in pure Erlang using OTP stack with minimal dependencies. Here the list of features offered by this application:
-
A library defined in module
nostrlib -
A client defined in module
nostr_client -
A relay defined in module
nostr_relay -
A common interface called
nostrto play with previously defined modules.
Disclamer
This project is in active development and cannot provide a stable application. This application should be used only for test at the moment.
NIP Support
Here the list of currently supported nips:
- nip/01: Basic protocol flow description
- nip/02: Contact List and Petnames
- nip/03: OpenTimestamps Attestations for Events
- nip/04: Encrypted Direct Message
- nip/05: Mapping Nostr keys to DNS-based internet identifiers
- nip/06: Basic key derivation from mnemonic seed phrase
- nip/07:
window.nostrcapability for web browsers - nip/08: Handling Mentions
- nip/09: Event Deletion
- nip/10: On "e" and "p" tags in Text Events (kind 1)
- nip/11: Relay Information Document
- nip/12: Generic Tag Queries
- nip/13: Proof of Work
- nip/14: Subject tag in Text events
- nip/15: End of Stored Events Notice
- nip/16: Event Treatment
- nip/19: bech32-encoded entities
- nip/20: Command Results
- nip/21: URL scheme
- nip/22: Event
created_atLimits - nip/23: Long-form Content
- nip/25: Reactions
- nip/26: Delegated Event Signing
- nip/28: Public Chat
- nip/33: Parameterized Replaceable Events
- nip/36: Sensitive Content/Content Warning
- nip/40: Expiration Timestamp
- nip/42: Authentication of clients to relays
- nip/46: Nostr Connect
- nip/50: Search Capability
- nip/56: Reporting
- nip/57: Lightning Zaps
- nip/65: Relay List Metadata
- nip/78: Arbitrary custom app data
Other Implementation (required by nostr)
- BIP-0340: Schnorr Signatures for secp256k1
- BIP-0173: Base32 address format for native v0-16 witness outputs
- BIP-0350: Bech32m format for v1+ witness addresses
Build
The code can be compiled using
rebar3 Erlang project manager.
$ rebar3 compile
Test
The current implementation is tested using
eunit and
common_test
both directly integrated with all default Erlang/OTP
release. cover is
enabled by default to have an idea of the coverage of the test. An
alias called check has been created to help using these tools.
$ rebar3 check
Documentation
A developer documentation is provided using
edoc and can be
generated on demand (automatically created if using rebar3 check
alias).
$ rebar3 edoc
This project has been created to explain how to create an Erlang/OTP
from scratch using only a release and few dependencies. The design
choices for the infrastructure, data-structures and algorithms can be
found in in notes directory. Those notes can be exported in
html, epub, pdf or plaintext using make.
$ make
The documents will be generated in _build/notes directory.
Development
For the developers, this project is using
asdf. The tools used are listed in
.tool-versions file. To bootstrap your system, install asdf and
just execute this command in the repository:
$ git clone https://github.com/erlang-punch/nostr
$ cd nostr
$ asdf install
Usage
This project is a work in progress, and no usages are currently displayed here.