π@hsuite/multisig
π§ Work in Progress - This application is currently under active development. Features and APIs may change.
π Multi-Signature Wallet Platform - Enterprise-grade security and transaction management for the Hedera ecosystem.
A comprehensive multi-signature wallet solution designed specifically for the Hedera network, providing secure transaction management, customizable approval workflows, and enterprise-grade controls with maximum security for digital assets. Built with NestJS, MongoDB, and seamless Hedera integration.
π Table of Contents
π Overview
The @hsuite/multisig application provides enterprise-grade multi-signature wallet functionality that supports:
Multi-Signature Wallets: Create wallets requiring multiple signatures for transactions
Flexible Threshold Management: Configure custom signature requirements (M-of-N)
Comprehensive Transaction Support: HBAR transfers, token operations, staking, and account updates
Queue-based Processing: Asynchronous transaction handling with Bull Queue
Real-time Updates: WebSocket integration for live transaction status updates
Cross-Chain Support: Extensible architecture for multiple blockchain networks
β¨ Features
π¦ Multi-Signature Wallet Management
Create multi-signature wallets with custom threshold requirements
Add/remove wallet owners with proper validation and authorization
Update wallet configurations including keys and thresholds
Track wallet history with comprehensive audit trails
π° Transaction Operations
HBAR Transfers: Send and receive HBAR with multi-signature approval
Token Operations:
Fungible token transfers (HTS tokens)
Non-fungible token (NFT) transfers
Token association/dissociation
Account Management:
Account updates (keys, auto-renew, etc.)
Staking operations to consensus nodes
Transaction Batching: Group multiple operations for efficiency
π Security & Approval Workflows
Threshold Signatures: Configurable M-of-N signature requirements
Transaction Validation: Comprehensive checks before execution
Owner Management: Secure addition/removal of wallet owners
Audit Logging: Complete transaction and signature history
Queue Safety: Time-limited transaction windows for security
π Real-time Features
WebSocket Gateway: Live updates for transaction status changes
Event-driven Architecture: Pub/sub system for real-time notifications
Background Processing: Asynchronous transaction handling
Status Monitoring: Real-time wallet and transaction status tracking
ποΈ Technical Architecture
Core Components
Data Models
Multisig Wallet Entity
Transaction History Entity
Transaction Event Entity
Infrastructure Stack
Framework: NestJS with TypeScript
Database: MongoDB with Mongoose ODM
Queue System: Bull Queue with Redis
WebSockets: Socket.IO for real-time communication
Blockchain: Hedera Hashgraph SDK integration
Validation: class-validator and custom business rules
Background Jobs: Automatic retry and error handling
π API Endpoints
Wallet Management
Get Wallet Information
Response:
Wallet Creation
Create Wallet Request
Execute Wallet Creation
Transaction Operations
Create Withdrawal Request
Create Update Request
Create Staking Request
Signature Management
Sign Transaction
Get Transaction Status
Token Operations
Associate Token Request
Dissociate Token Request
π Installation & Setup
Prerequisites
Node.js 18+ and npm/yarn
MongoDB 5.0+
Redis 6.0+
Hedera testnet/mainnet account
Environment Configuration
Create .multisig.env file:
Installation Steps
Install dependencies:
Start required services:
Initialize database (if required):
Start the application:
Verify installation:
π Usage Examples
Complete Multi-Signature Workflow
WebSocket Integration for Real-time Updates
Token Operations Example
ποΈ Database Schema
Collections Structure
multisig_wallets
multisig_histories
multisig_events
π Security Features
Transaction Security
Time-limited requests: Transactions expire after 2 minutes to prevent replay attacks
Signature validation: All signatures verified against Hedera public keys
Threshold enforcement: Transactions only execute when signature threshold is met
Owner validation: Only wallet owners can sign transactions
Access Control
JWT Authentication: All API endpoints require valid authentication tokens
Wallet ownership: Users can only access wallets they own or are members of
Role-based permissions: Different access levels for wallet operations
Data Protection
Encrypted storage: Sensitive data encrypted at rest
Audit logging: Complete audit trail for all operations
Input validation: Comprehensive validation of all inputs
SQL injection prevention: MongoDB queries properly parameterized
βοΈ Queue System
The application uses Bull Queue for reliable background processing:
Queue Types
create.request: Wallet creation requests with 2-minute delay
create.execute: Wallet creation execution
withdraw.request: Withdrawal requests
withdraw.execute: Withdrawal execution
update.request: Wallet update requests
update.execute: Wallet update execution
stake.request: Staking requests
stake.execute: Staking execution
transaction.sign: Transaction signature processing
Queue Configuration
Retry Policy: 3 attempts with exponential backoff
Timeout: 2-minute timeout for transaction execution
Concurrency: Configurable concurrent job processing
Error Handling: Comprehensive error logging and recovery
Monitoring Queues
π§ Development
Project Structure
Running Tests
Development Commands
Adding New Features
Define interfaces in
src/interfaces/Create/update entities in
src/entities/Implement business logic in
src/multisig.service.tsAdd API endpoints in
src/multisig.controller.tsAdd queue processing in
src/multisig.consumer.tsUpdate WebSocket events in
src/multisig.gateway.tsWrite tests for all new functionality
π§ͺ Testing
Test Categories
Unit Tests
Service method testing
Controller endpoint testing
Model operation testing
Utility function testing
Integration Tests
Database integration
Queue system integration
WebSocket communication
Hedera SDK integration
E2E Tests
Complete wallet creation workflow
Multi-signature transaction flow
Error handling scenarios
Performance testing
Running Specific Tests
π€ Contributing
We welcome contributions to improve the multisig platform! Please read our Contributing Guide for details on:
Code Style: Follow ESLint and Prettier configurations
Testing Requirements: Maintain >90% test coverage
Documentation: Update documentation for new features
PR Process: Use conventional commits and proper PR templates
Development Workflow
Fork the repository
Create a feature branch:
git checkout -b feature/amazing-featureMake changes and add tests
Run the test suite:
npm run test multisigCommit changes:
git commit -m 'feat: add amazing feature'Push to branch:
git push origin feature/amazing-featureOpen a Pull Request
π License
This package is part of the HSuite ecosystem and is covered by its license terms.
π Support & Documentation
GitHub Issues: Report bugs and request features
API Documentation: Swagger UI at
/api/docswhen runningCommunity: Join our Discord for real-time support
Enterprise Support: Contact us for enterprise deployment assistance
Built with β€οΈ by the HSuite Team Securing digital assets on Hedera with enterprise-grade multi-signature solutions Copyright Β© 2025 HSuite. All rights reserved.
Last updated