# 13riann/p2pkh-privatekey-data architecture

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

- Interactive diagram: https://gitdiagram.com/13riann/p2pkh-privatekey-data
- Repository: https://github.com/13riann/p2pkh-privatekey-data

## Overview

This is a small command-line script that accepts a decimal or hexadecimal private key and prints its P2PKH-related data. The main path derives compressed and uncompressed public keys, hashes them, encodes addresses, and displays the results. All runtime behavior is implemented in one file; relationships below follow calls visible in its excerpt.

Main entry points: [`pycoin.py`](https://github.com/13riann/p2pkh-privatekey-data/blob/main/pycoin.py) (Input and display)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_key_derivation["Key derivation"]
  node_key["Public key derivation<br/>[pycoin.py]"]
end

subgraph group_address_encoding["Address encoding"]
  node_hash["HASH160<br/>[pycoin.py]"]
  node_ripemd["RIPEMD160<br/>[pycoin.py]"]
  node_base58check["Base58Check<br/>[pycoin.py]"]
  node_base58["Base58 encoding<br/>[pycoin.py]"]
end

subgraph group_cli["Command line"]
  node_entry["Input and display<br/>[pycoin.py]"]
end

node_user(("User"))

node_user -->|"enters key"| node_entry
node_entry -->|"derives keys"| node_key
node_entry -->|"hashes public key"| node_hash
node_entry -->|"encodes address"| node_base58check
node_hash -->|"hashes digest"| node_ripemd
node_base58check -->|"encodes payload"| node_base58

click node_entry "https://github.com/13riann/p2pkh-privatekey-data/blob/main/pycoin.py"
click node_key "https://github.com/13riann/p2pkh-privatekey-data/blob/main/pycoin.py"
click node_hash "https://github.com/13riann/p2pkh-privatekey-data/blob/main/pycoin.py"
click node_ripemd "https://github.com/13riann/p2pkh-privatekey-data/blob/main/pycoin.py"
click node_base58check "https://github.com/13riann/p2pkh-privatekey-data/blob/main/pycoin.py"
click node_base58 "https://github.com/13riann/p2pkh-privatekey-data/blob/main/pycoin.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_key,node_user toneBlue
class node_hash,node_ripemd,node_base58check,node_base58 toneAmber
class node_entry toneMint
```

## Components

### Key derivation

- [Public key derivation](https://github.com/13riann/p2pkh-privatekey-data/blob/main/pycoin.py): `pycoin.py`

### Address encoding

- [HASH160](https://github.com/13riann/p2pkh-privatekey-data/blob/main/pycoin.py): `pycoin.py`
- [RIPEMD160](https://github.com/13riann/p2pkh-privatekey-data/blob/main/pycoin.py): `pycoin.py`
- [Base58Check](https://github.com/13riann/p2pkh-privatekey-data/blob/main/pycoin.py): `pycoin.py`
- [Base58 encoding](https://github.com/13riann/p2pkh-privatekey-data/blob/main/pycoin.py): `pycoin.py`

### Command line

- [Input and display](https://github.com/13riann/p2pkh-privatekey-data/blob/main/pycoin.py): `pycoin.py`

### Other components

- **User**

## Connections

- User → Input and display: enters key (evidence: `pycoin.py`)
- Input and display → Public key derivation: derives keys (evidence: `pycoin.py`)
- Input and display → HASH160: hashes public key (evidence: `pycoin.py`)
- Input and display → Base58Check: encodes address (evidence: `pycoin.py`)
- HASH160 → RIPEMD160: hashes digest (evidence: `pycoin.py`)
- Base58Check → Base58 encoding: encodes payload (evidence: `pycoin.py`)
