Skip to content

Implement account regeneration in Settings view #18

@roninjin10

Description

@roninjin10

Problem

The Settings view has a TODO at line 50 for regenerating test accounts. Confirming does nothing.

Current State

  • Line 50: // TODO: Regenerate accounts
  • Uses same confirmation dialog as reset
  • Shows "Accounts regenerated" but nothing changes

Required Implementation

  1. Add regenerateAccounts() method to Blockchain:
    • Generate 10 new random private keys
    • Derive addresses from private keys
    • Clear existing accounts from EVM database
    • Create new accounts with 10,000 ETH each
    • Update self.accounts list
  2. Private key generation:
    • Use secure random bytes (std.crypto.random)
    • 32 bytes per key
    • Derive address via secp256k1 (or use evm's address derivation)

Key Files

  • src/views/settings.zig:48-52 - Regenerate handler
  • src/core/blockchain.zig - Need to add regenerateAccounts() method

Note

This is lower priority than other features. The hardcoded test accounts (Hardhat-compatible) are generally sufficient for development.

Acceptance Criteria

  • Confirming regenerate creates 10 new accounts
  • New private keys are cryptographically random
  • Old accounts removed from EVM state
  • New accounts have 10,000 ETH each
  • Accounts view shows new accounts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions