# gangi94/blockchainaddress architecture

> Architecture diagram of the GitHub repository gangi94/blockchainaddress, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gangi94/blockchainaddress
- Repository: https://github.com/gangi94/blockchainaddress

## Overview

This educational cryptography project turns example private keys or supplied public keys/scripts into Bitcoin and Ethereum address encodings. The demonstrated workflow in Main.py derives a secp256k1 public point, formats Bitcoin keys, and requests Bitcoin addresses; it also demonstrates Ethereum key/address conversion and vanity search. Supporting capabilities include Bitcoin P2PKH, P2SH, and SegWit formats, Ethereum EIP-55 checksums and contract addresses. Edges reflect shown calls; Ethereum’s library-internal use of external crypto packages is not expanded.

Main entry points: [`Main.py`](https://github.com/gangi94/blockchainaddress/blob/master/Main.py) (Example runner), [`BtcAddress.py`](https://github.com/gangi94/blockchainaddress/blob/master/BtcAddress.py) (Bitcoin address formats), [`KeyFormats.py`](https://github.com/gangi94/blockchainaddress/blob/master/KeyFormats.py) (Bitcoin key formats), [`Weierstrass.py`](https://github.com/gangi94/blockchainaddress/blob/master/Weierstrass.py) (secp256k1 arithmetic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_demo["Examples"]
  node_demo["Example runner<br/>[Main.py]"]
end

subgraph group_curve["Curve and keys"]
  node_curve["secp256k1 arithmetic<br/>[Weierstrass.py]"]
  node_formats["Bitcoin key formats<br/>[KeyFormats.py]"]
end

subgraph group_btc["Bitcoin addresses"]
  node_btc["Bitcoin address formats<br/>[BtcAddress.py]"]
end

subgraph group_eth["Ethereum addresses"]
  node_eth["Ethereum address tools<br/>[EthAddress.py]"]
end

node_user(("Experimenter"))

node_user -->|"runs examples"| node_demo
node_demo -->|"derives public point"| node_curve
node_demo -->|"formats keys"| node_formats
node_demo -->|"requests addresses"| node_btc
node_demo -->|"derives Ethereum address"| node_eth
node_formats -->|"reads point coordinates"| node_curve
node_btc -->|"computes checksum"| node_formats
node_btc -->|"searches public points"| node_curve

click node_demo "https://github.com/gangi94/blockchainaddress/blob/master/Main.py"
click node_curve "https://github.com/gangi94/blockchainaddress/blob/master/Weierstrass.py"
click node_formats "https://github.com/gangi94/blockchainaddress/blob/master/KeyFormats.py"
click node_btc "https://github.com/gangi94/blockchainaddress/blob/master/BtcAddress.py"
click node_eth "https://github.com/gangi94/blockchainaddress/blob/master/EthAddress.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_demo toneBlue
class node_curve,node_formats toneAmber
class node_btc toneMint
class node_eth toneRose
class node_user toneIndigo
```

## Components

### Examples

- [Example runner](https://github.com/gangi94/blockchainaddress/blob/master/Main.py): `Main.py`

### Curve and keys

- [secp256k1 arithmetic](https://github.com/gangi94/blockchainaddress/blob/master/Weierstrass.py): `Weierstrass.py`
- [Bitcoin key formats](https://github.com/gangi94/blockchainaddress/blob/master/KeyFormats.py): `KeyFormats.py`

### Bitcoin addresses

- [Bitcoin address formats](https://github.com/gangi94/blockchainaddress/blob/master/BtcAddress.py): `BtcAddress.py`

### Ethereum addresses

- [Ethereum address tools](https://github.com/gangi94/blockchainaddress/blob/master/EthAddress.py): `EthAddress.py`

### Other components

- **Experimenter**

## Connections

- Experimenter → Example runner: runs examples (evidence: `Main.py`)
- Example runner → secp256k1 arithmetic: derives public point (evidence: `Main.py`)
- Example runner → Bitcoin key formats: formats keys (evidence: `Main.py`)
- Example runner → Bitcoin address formats: requests addresses (evidence: `Main.py`)
- Example runner → Ethereum address tools: derives Ethereum address (evidence: `Main.py`)
- Bitcoin key formats → secp256k1 arithmetic: reads point coordinates (evidence: `KeyFormats.py`)
- Bitcoin address formats → Bitcoin key formats: computes checksum (evidence: `BtcAddress.py`)
- Bitcoin address formats → secp256k1 arithmetic: searches public points (evidence: `BtcAddress.py`)
