@veive-io/mod-sign-as
v1.0.0
Published
Veive smart account signature module
Downloads
9
Readme
Mod Sign
Overview
mod-sign-as
is an essential component of the Veive protocol, providing the foundational framework for implementing signature verification modules. These modules play a crucial role in the authentication and validation of transactions within the Koinos blockchain smart accounts. Unlike traditional signature verification methods, the mod-sign-as
library allows for modular and interchangeable signature verification techniques, making it versatile and adaptable to different security needs.
Components and Functional Description
1. ModSign
Class
Description: The
ModSign
class is the base class for all signature verification modules in the Veive ecosystem. It is designed to be extended by specific implementations that handle different types of signature verification, such as ECDSA or WebAuthn.Key Methods:
is_valid_signature
: This critical method validates a given signature to ensure the authenticity of a transaction. It is meant to be overridden by subclasses to provide specific validation logic for different signature types. By default, it returnsfalse
, indicating that the signature is invalid unless verified by the subclass's logic.on_install
andon_uninstall
: These methods manage the installation and uninstallation processes for the module. They can include setup tasks, such as initializing necessary storage or configuration settings, and cleanup tasks during uninstallation.is_type
: This method checks whether the module instance matches a specific type ID, confirming its compatibility and identity within the system.manifest
: Returns metadata about the module, such as its name, description, and type ID. This information is useful for system management and module discovery.
Use Case: The
ModSign
class is fundamental for creating modules that verify the authenticity of transactions based on different cryptographic signature schemes. It is integral in scenarios where secure verification of identity and transaction integrity is required.
2. modsign
Proto
Description: The
modsign
protocol buffer (proto) defines the data structures and communication formats used for signature verification in the Veive protocol.Purpose: It standardizes the data exchange between the smart account and the signature verification modules, ensuring a consistent and secure verification process.
Usage and Integration
Integration in the Veive Protocol
The mod-sign-as
library is a core component of the Veive protocol, providing the necessary infrastructure for signature verification. It is particularly relevant in the is_valid_signature
method of the account interface, where it is used to authenticate transactions.
Flow Integration:
- When a transaction is initiated, the
is_valid_signature
method is invoked to verify the authenticity of the transaction's signature. The specific implementation ofModSign
determines the type of signature verification applied, ensuring that the transaction is legitimate and has not been tampered with.
Development and Customization:
- Developers can extend the
ModSign
class to create custom signature verification modules. This flexibility allows for the integration of various cryptographic algorithms and techniques, catering to different security requirements and use cases.
Usage
Installation
To install the mod-sign-as
library, use the following command:
yarn add @veive/mod-sign-as
Scripts
Build
To compile the package, run:
yarn build
Contributing
Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository.
License
This project is licensed under the MIT License. See the LICENSE file for details.