Skip to content

Commit dd1a7f4

Browse files
authored
Merge pull request #130 from MeshJS/Readme-update
docs: overhaul README.md to provide comprehensive documentation for M…
2 parents ed15451 + 3c19c15 commit dd1a7f4

File tree

8 files changed

+2240
-37
lines changed

8 files changed

+2240
-37
lines changed

README.md

Lines changed: 294 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,295 @@
1-
- can create multisig wallets
2-
- can add owners
3-
- can choose number of signing
4-
5-
- can create transactions
6-
- will create transaction
7-
- users can see transactions that need them to sign
8-
- fees paid by funds in the script
9-
10-
- drep
11-
- able register
12-
- able to vote
13-
14-
- can migrate to new wallets configs
15-
- will ask for sign and create new script and move all funds to new script
16-
17-
- can stake to pool
18-
19-
- need to reserve UTXOs
20-
- manage utxo?
21-
- add more outputs to new transactions
22-
- message sign to verify wallet
23-
- discord integration, to ping people to sign
24-
- can reject signing to delete transaction
25-
- add readme support to desc
26-
- send all assets
27-
- handle UI where amount is edge cases
28-
- support catayst reporting
29-
- convert to datetime
30-
- edit wallet info
31-
- migrate wallet by adjusting signers
32-
- move funds to new wallet
33-
- new db schema for multisig for changes
34-
35-
product:
36-
- store + spend treasury funds
37-
- vote as team
1+
# Mesh Multi-Sig Wallet
382

3+
A comprehensive, enterprise-grade multi-signature wallet solution built on Cardano, designed for teams, DAOs, and organizations to securely manage treasury funds and participate in governance.
4+
5+
[![Next.js](https://img.shields.io/badge/Next.js-14.2.4-black)](https://nextjs.org/)
6+
[![TypeScript](https://img.shields.io/badge/TypeScript-5.5.3-blue)](https://www.typescriptlang.org/)
7+
[![Prisma](https://img.shields.io/badge/Prisma-6.4.1-2D3748)](https://www.prisma.io/)
8+
[![Mesh SDK](https://img.shields.io/badge/Mesh%20SDK-1.9.0--beta.18-orange)](https://meshjs.dev/)
9+
10+
## Features
11+
12+
### Multi-Signature Wallet Management
13+
- **Create Multi-Sig Wallets**: Set up wallets with customizable signer requirements
14+
- **Flexible Signing Thresholds**: Choose between "all", "any", or "at least N" signing schemes
15+
- **Signer Management**: Add/remove signers with descriptive labels and verification
16+
- **Wallet Migration**: Seamlessly migrate to new wallet configurations
17+
- **Multi-Asset Support**: Manage ADA and custom tokens in a single wallet
18+
19+
### Advanced Transaction Management
20+
- **Intuitive Transaction Creation**: User-friendly interface for creating complex transactions
21+
- **UTxO Selection**: Manual or automatic UTxO selection with visual highlighting
22+
- **Recipient Management**:
23+
- Add multiple recipients with different assets
24+
- Quick-add self and signer addresses
25+
- CSV import/export for bulk operations
26+
- ADA Handle resolution support
27+
- **Transaction Descriptions**: Add context for signers with descriptions and metadata
28+
- **Deposit Functionality**: Easy deposits from personal wallets to multi-sig wallets
29+
- **Send All Assets**: Option to send all available assets in one transaction
30+
31+
### Governance & DRep Integration
32+
- **DRep Registration**: Register your team as a Delegated Representative
33+
- **Governance Participation**: View and vote on Cardano governance proposals
34+
- **Team Voting**: Collaborative decision-making for governance actions
35+
- **On-Chain Transparency**: All governance actions recorded on the blockchain
36+
37+
### Staking & Delegation
38+
- **Stake Pool Delegation**: Delegate to any Cardano stake pool
39+
- **Reward Management**: Withdraw staking rewards through multi-sig
40+
- **Stake Registration**: Register and deregister stake addresses
41+
- **Multi-Sig Staking**: Secure staking operations requiring multiple signatures
42+
43+
### Collaboration & Communication
44+
- **Real-Time Chat**: Built-in Nostr-based chat for team communication
45+
- **Discord Integration**:
46+
- Discord notifications for pending transactions
47+
- User verification through Discord
48+
- Avatar integration
49+
- **Signer Verification**: Message signing to verify wallet ownership
50+
- **Transaction Notifications**: Automated alerts for required signatures
51+
52+
### Developer & API Features
53+
- **RESTful API**: Comprehensive API for wallet operations
54+
- **tRPC Integration**: Type-safe API with React Query
55+
- **Swagger Documentation**: Interactive API documentation
56+
- **JWT Authentication**: Secure token-based authentication
57+
- **Database Management**: PostgreSQL with Prisma ORM
58+
- **File Storage**: Vercel Blob integration for asset storage
59+
60+
### User Experience
61+
- **Responsive Design**: Mobile-first design with desktop optimization
62+
- **Dark/Light Mode**: Theme switching support
63+
- **Real-Time Updates**: Live transaction status updates
64+
- **Transaction History**: Comprehensive transaction tracking
65+
- **Asset Management**: Detailed asset portfolio view
66+
- **Error Handling**: Robust error handling with user-friendly messages
67+
68+
## Architecture
69+
70+
### Frontend
71+
- **Next.js 14**: React framework with App Router
72+
- **TypeScript**: Type-safe development
73+
- **Tailwind CSS**: Utility-first styling
74+
- **Framer Motion**: Smooth animations
75+
- **Radix UI**: Accessible component primitives
76+
- **React Hook Form**: Form management
77+
- **Zustand**: State management
78+
79+
### Backend
80+
- **tRPC**: End-to-end typesafe APIs
81+
- **Prisma**: Database ORM with PostgreSQL
82+
- **NextAuth.js**: Authentication system
83+
- **JWT**: Token-based authentication
84+
- **CORS**: Cross-origin resource sharing
85+
86+
### Blockchain Integration
87+
- **Mesh SDK**: Cardano blockchain interaction
88+
- **Native Scripts**: Multi-signature script generation
89+
- **UTxO Management**: Advanced UTxO handling
90+
- **Transaction Building**: Comprehensive transaction construction
91+
92+
### Database Schema
93+
```prisma
94+
model User {
95+
id String @id @default(cuid())
96+
address String @unique
97+
stakeAddress String @unique
98+
nostrKey String @unique
99+
discordId String @default("")
100+
}
101+
102+
model Wallet {
103+
id String @id @default(cuid())
104+
name String
105+
description String?
106+
signersAddresses String[]
107+
signersStakeKeys String[]
108+
signersDescriptions String[]
109+
numRequiredSigners Int?
110+
verified String[]
111+
scriptCbor String
112+
stakeCredentialHash String?
113+
type String
114+
isArchived Boolean @default(false)
115+
clarityApiKey String?
116+
}
117+
118+
model Transaction {
119+
id String @id @default(cuid())
120+
walletId String
121+
txJson String
122+
txCbor String
123+
signedAddresses String[]
124+
rejectedAddresses String[]
125+
description String?
126+
state Int
127+
txHash String?
128+
createdAt DateTime @default(now())
129+
updatedAt DateTime @updatedAt
130+
}
131+
```
132+
133+
## Getting Started
134+
135+
### Prerequisites
136+
- Node.js 18+
137+
- PostgreSQL database
138+
- Cardano wallet (Nami, Eternl, etc.)
139+
140+
### Installation
141+
142+
1. **Clone the repository**
143+
```bash
144+
git clone https://github.com/your-org/multisig.git
145+
cd multisig
146+
```
147+
148+
2. **Install dependencies**
149+
```bash
150+
npm install
151+
```
152+
153+
3. **Set up environment variables**
154+
```bash
155+
cp .env.example .env.local
156+
```
157+
158+
Configure the following variables:
159+
```env
160+
DATABASE_URL="postgresql://username:password@localhost:5432/multisig"
161+
NEXTAUTH_SECRET="your-secret-key"
162+
NEXTAUTH_URL="http://localhost:3000"
163+
JWT_SECRET="your-jwt-secret"
164+
DISCORD_CLIENT_ID="your-discord-client-id"
165+
DISCORD_CLIENT_SECRET="your-discord-client-secret"
166+
DISCORD_BOT_TOKEN="your-discord-bot-token"
167+
DISCORD_GUILD_ID="your-discord-guild-id"
168+
```
169+
170+
4. **Set up the database**
171+
```bash
172+
npm run db:push
173+
npm run db:generate
174+
```
175+
176+
5. **Start the development server**
177+
```bash
178+
npm run dev
179+
```
180+
181+
6. **Open your browser**
182+
Navigate to [http://localhost:3000](http://localhost:3000)
183+
184+
## Usage
185+
186+
### Creating a Multi-Sig Wallet
187+
188+
1. **Connect your wallet** using one of the supported Cardano wallets
189+
2. **Navigate to "New Wallet"** from the main dashboard
190+
3. **Add signers** by entering their Cardano addresses and descriptions
191+
4. **Set signing requirements** (e.g., "at least 2 of 5 signers")
192+
5. **Configure wallet details** including name and description
193+
6. **Deploy the wallet** to the blockchain
194+
195+
### Creating Transactions
196+
197+
1. **Select your multi-sig wallet** from the dashboard
198+
2. **Click "New Transaction"**
199+
3. **Add recipients** with addresses, amounts, and assets
200+
4. **Select UTxOs** manually or use automatic selection
201+
5. **Add transaction description** for signers
202+
6. **Submit for signing** - all required signers will be notified
203+
204+
### Participating in Governance
205+
206+
1. **Navigate to Governance** section
207+
2. **Register as DRep** if not already registered
208+
3. **View active proposals** and their details
209+
4. **Vote on proposals** using your multi-sig wallet
210+
5. **Track voting history** and results
211+
212+
## API Documentation
213+
214+
The application provides comprehensive API documentation through Swagger UI:
215+
216+
- **Local Development**: [http://localhost:3000/api-docs](http://localhost:3000/api-docs)
217+
- **API Endpoints**: RESTful endpoints for wallet operations
218+
- **Authentication**: JWT-based authentication system
219+
220+
### Key API Endpoints
221+
222+
- `GET /api/v1/walletIds` - Get user's wallet IDs
223+
- `POST /api/v1/addTransaction` - Create new transaction
224+
- `POST /api/v1/authSigner` - Authenticate signer
225+
- `GET /api/v1/lookupMultisigWallet` - Lookup multisig wallet
226+
- `POST /api/discord/send-message` - Send Discord notifications
227+
228+
## Development
229+
230+
### Available Scripts
231+
232+
```bash
233+
# Development
234+
npm run dev # Start development server
235+
npm run build # Build for production
236+
npm run start # Start production server
237+
238+
# Database
239+
npm run db:push # Push schema changes to database
240+
npm run db:generate # Generate Prisma client
241+
npm run db:studio # Open Prisma Studio
242+
npm run db:format # Format Prisma schema
243+
244+
# Code Quality
245+
npm run lint # Run ESLint
246+
npm run type-check # Run TypeScript compiler
247+
```
248+
249+
### Project Structure
250+
251+
```
252+
src/
253+
├── components/ # React components
254+
│ ├── common/ # Shared components
255+
│ ├── pages/ # Page-specific components
256+
│ └── ui/ # UI component library
257+
├── hooks/ # Custom React hooks
258+
├── lib/ # Utility libraries
259+
├── pages/ # Next.js pages and API routes
260+
├── server/ # Backend logic
261+
│ ├── api/ # tRPC routers
262+
│ └── db.ts # Database connection
263+
├── types/ # TypeScript type definitions
264+
└── utils/ # Utility functions
265+
```
266+
267+
## Security Features
268+
269+
- **Multi-signature Security**: All transactions require multiple signatures
270+
- **Message Signing**: Cryptographic verification of wallet ownership
271+
- **JWT Authentication**: Secure token-based authentication
272+
- **Input Validation**: Comprehensive input sanitization and validation
273+
- **CORS Protection**: Cross-origin request security
274+
- **Nonce System**: Replay attack prevention
275+
276+
## Supported Networks
277+
278+
- **Mainnet**: Production Cardano network
279+
- **Preprod**: Cardano testnet for development and testing
280+
281+
282+
## License
283+
284+
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
285+
286+
## Support
287+
288+
- **Documentation**: Check our documentation
289+
- **Issues**: Report bugs and request features on GitHub Issues
290+
- **Discord**: Join our Discord community for support at [https://discord.gg/jQZVcMbdKU](https://discord.gg/jQZVcMbdKU)
291+
292+
293+
---
294+
295+
**Built for the Cardano ecosystem**

0 commit comments

Comments
 (0)