I’m excited to share the release of version 0.6.0
of the nostr gem.
Marking a significant update with a focus on enhancing cryptographic functionalities and introducing a systematic
approach to documenting architectural decisions.
What’s new in 0.6.0
?
- Architecture Decision Records (ADRs)
- Message signing and verification
- Event signature verification
KeyPair
destructuring
Detailed Overview
Architecture Decision Records (ADRs)
I’ve begun documenting architectural decisions using Architecture Decision Records (ADRs). This structured approach aids in recording architectural changes and their rationale.
An ADR typically includes the following sections:
- Title: A short, descriptive name for the architectural decision.
- Status: The current status (proposed, accepted, deprecated, etc.) of the decision.
- Context: The circumstances that led to the decision being considered.
- Decision: A detailed explanation of the decision.
- Consequences: The expected impact of the decision, both positive and negative.
Here’s an abbreviated example of an ADR for introducing the Signature
class:
Message signing and verification
Introducing a Signature
class addresses primitive obsession with string signatures by providing a dedicated class for
signature handling, including validation and error handling.
This may raise InvalidSignatureTypeError
, InvalidSignatureLengthError
, or InvalidSignatureFormatError
if the
signature is invalid.
Furthermore, new functionalities for signing messages and verifying the authenticity of messages and events have been added, ensuring data integrity within the nostr ecosystem.
The valid_sig?
method checks if a signature is valid, whereas check_sig!
raises an error if the signature is
invalid.
Event signature verification
Signing an event ensures its authenticity. Verification confirms the event was not tampered with.
KeyPair
destructuring
Enhancing usability, the KeyPair
class now supports destructuring, making it easier to work with private and public
keys.
Coming next
The next release will focus on enhancing error messages and debugging capabilities. Feedback is welcome as development continues. Feel free to start a discussion on the GitHub repository.