Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Zyra-V21/argent-wallet-creator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ฎ Invisible Wallet Creator

Automated Starknet L2 wallet creation system that generates, funds, and deploys Argent wallets for seamless L1โ†”L2 bridge operations.


โš ๏ธ ๐Ÿšจ CRITICAL SECURITY WARNING ๐Ÿšจ โš ๏ธ

๐Ÿ”ด THIS IS A DEVELOPMENT-ONLY MVP - NOT FOR PRODUCTION USE

๐Ÿšซ NEVER USE IN PRODUCTION ENVIRONMENTS

โŒ STORING PRIVATE KEYS IN DATABASE IS EXTREMELY DANGEROUS

  • This MVP stores wallet private keys in a local JSON file
  • THIS IS ONLY FOR DEVELOPMENT AND TESTING PURPOSES
  • NEVER deploy this to production servers
  • NEVER use with real funds on mainnet

๐Ÿ”’ FOR PRODUCTION, YOU MUST:

  1. โŒ DO NOT store private keys anywhere
  2. โœ… Use non-custodial wallet generation only
  3. โœ… Return only public addresses to users
  4. โœ… Let users control their own private keys
  5. โœ… Implement proper key management (HSM, hardware wallets)
  6. โœ… Use account abstraction for gasless transactions

๐ŸŽฏ THIS MVP IS FOR:

  • โœ… Development and testing
  • โœ… Understanding Starknet wallet creation flows
  • โœ… Prototyping bridge mechanics
  • โœ… Learning account abstraction concepts

๐Ÿšจ PRODUCTION REQUIREMENTS:

  • Use proper key management systems
  • Implement non-custodial architecture
  • Follow security best practices
  • Conduct security audits
  • Use hardware security modules (HSM)

โšก YOU HAVE BEEN WARNED - USE AT YOUR OWN RISK โšก


๐ŸŽฏ What it does

This MVP creates complete Argent wallets on Starknet L2:

  1. โœ… Generates cryptographic keypairs
  2. โœ… Calculates correct Argent wallet addresses
  3. โœ… Funds wallets with 0.1 STRK for gas
  4. โœ… Deploys wallets to Starknet
  5. โœ… Saves all data to local database
  6. โœ… Returns Sepolia Starkscan links

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+
  • sncast (Starknet Foundry)
  • starkli (Starknet CLI)

Installation

npm install
cp .env.example .env  # Configure your environment

Usage

# Create a new wallet
node index.js create <userId>

# List all wallets
node index.js list

โš™๏ธ Configuration

All sensitive data is loaded from .env:

# Starknet Configuration
STARKNET_RPC_URL=https://starknet-sepolia.public.blastapi.io
MASTER_ACCOUNT_ADDRESS=0x...
STRK_TOKEN_ADDRESS=0x...
ARGENT_ACCOUNT_CLASS_HASH=0x...

# Wallet Settings
FUNDING_AMOUNT=100000000000000000  # 0.1 STRK in wei
WALLETS_DB_FILE=./data/wallets-db.json
NETWORK=sepolia

๐Ÿ“ Project Structure

invisible-wallet/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ complete-wallet-creator.js  # Main wallet creation logic
โ”œโ”€โ”€ data/
โ”‚   โ””โ”€โ”€ wallets-db.json            # Wallet database
โ”œโ”€โ”€ scripts/
โ”‚   โ””โ”€โ”€ mixing-executor.js         # Reference implementation
โ”œโ”€โ”€ temp/                          # Temporary files
โ”œโ”€โ”€ .env                          # Environment configuration
โ”œโ”€โ”€ index.js                      # Entry point
โ””โ”€โ”€ README.md                     # This file

๐Ÿ” Security

  • โœ… No hardcoded secrets - All sensitive data in .env
  • โœ… Private keys secured - Never logged or exposed
  • โœ… Environment validation - Checks required variables
  • โœ… Temporary file cleanup - No sensitive data left behind

๐ŸŽฏ MVP Features

โœ… Completed

  • Automatic Argent wallet generation
  • STRK funding (0.1 STRK per wallet)
  • Complete wallet deployment
  • Database persistence
  • Environment-based configuration
  • Sepolia testnet integration

๐Ÿ”ฎ Next Steps

  • Mainnet support
  • Frontend integration
  • LayerSwap API integration
  • L1โ†”L2 bridge automation
  • Paymaster integration

๐Ÿ› ๏ธ Technical Details

Dependencies

  • starknet: Starknet.js library
  • dotenv: Environment variable loading
  • sncast: Starknet Foundry CLI (external)
  • starkli: Starknet CLI (external)

Wallet Creation Flow

  1. Generate random keypair using Starknet.js
  2. Use starkli to calculate correct Argent address
  3. Fund address with STRK using sncast
  4. Deploy wallet using starkli account deploy
  5. Save complete wallet data to JSON database

๐Ÿ”— Example Output

$ node index.js create alice

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
๐Ÿ†• Creating complete wallet for: alice
๐Ÿ”‘ Generating keypair...
๐Ÿ“ Generating Argent account config with starkli...
โœ… Starknet L2 Wallet Address: 0x063597c2ff6f08d298a627911f05510e3bcb2ede2693c9b92c09946c7eb46797
๐Ÿ’ธ Funding wallet with 0.1 STRK...
โœ… STRK transfer TX: 0x0258dbe557fb46f9fbb9a8e54af8f7c8ca079106c961ed98d30e818a7cae0b2e
๐Ÿ’ฐ Account balance: 0.1000 STRK
๐Ÿš€ Deploying account using starkli account deploy...
โœ… Account deployed via starkli! TX: 0x006cb97731018303616548b2f39f18dedc61fcec35c89f2b969d43fe38ab6255

๐ŸŽ‰ WALLET CREATION COMPLETE!
   Status: DEPLOYED โœ…
   ๐Ÿ”— DEPLOYED WALLET: https://sepolia.starkscan.co/contract/0x063597c2ff6f08d298a627911f05510e3bcb2ede2693c9b92c09946c7eb46797
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

๐Ÿ“‹ Development

Testing

# Test wallet creation
node index.js create test_user_$(date +%s)

# Check database
node index.js list

Debug Mode

Set DEBUG=1 in .env for verbose logging.

๐Ÿค Contributing

This is an MVP for research and development. Focus on:

  • Security improvements
  • Error handling
  • Performance optimization
  • Frontend integration preparation

MILESTONES/IDEAS for contribute:

  • Use account abstraction for gasless UX
  • Generate wallets client-side only
  • Implement proper session management
  • Use hardware security modules (HSM)
  • Follow zero-knowledge principles

โš ๏ธ Testnet Only: Currently configured for Sepolia testnet. NEVER use on mainnet without complete security overhaul.

๐ŸŽฏ Remember: This is a learning tool and proof of concept - not production-ready code.

DISCLAIMER: I know that this may be doable just by using starknet-js w/o sncast/starkli, but I can't simply make v3 transaction's resource bounds work as expected.*

About

Non-custodial wallet creation toolkit for Starknet L2 bridge development

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published