Skip to content

feat: support WIF for Bitcoin, Litecoin and Decred - #56

Merged
oritwoen merged 2 commits into
mainfrom
feat/wif
Sep 9, 2026
Merged

feat: support WIF for Bitcoin, Litecoin and Decred#56
oritwoen merged 2 commits into
mainfrom
feat/wif

Conversation

@aeitwoen

@aeitwoen aeitwoen commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

WIF should work across Bitcoin, Litecoin and Decred, not stop at a configurable Bitcoin prefix. encodeWIF and decodeWIF now cover all three native formats, checked against Bitcoinjs, Litecoin Core and dcrd vectors.

@aeitwoen
aeitwoen requested a review from oritwoen as a code owner September 9, 2026 14:25
@aeitwoen aeitwoen self-assigned this Sep 9, 2026
@coldtea-pr-lens

coldtea-pr-lens Bot commented Sep 9, 2026

Copy link
Copy Markdown

◈ PR Lens

🟢 +1 new · 🟠 ~4 changed · 🔴 -0 removed · 2 flows · 8 files · commit 765846f


Architecture

Architecture diagram for agntn/keys at 765846f

5 components touched across 6 lanes.

Open the interactive canvas


Inside the changed components — 2 views

Component view — Agent WIF tools

Integration of WIF encoding and decoding tools across MCP and Pi agent interfaces via shared executors

Architecture view of Component view — Agent WIF tools in agntn/keys

Component view — WIF conversion engine

WIF serialization, Base58Check/BLAKE-256 checksum verification, and secp256k1 scalar validation for Bitcoin, Litecoin, and Decred

Architecture view of Component view — WIF conversion engine in agntn/keys

Data flow

Data flow diagram for agntn/keys at 765846f

Encoding a private key as WIF via MCP · Decoding WIF and deriving wallet

Open the interactive canvas


The other flows — 1 sequence

Decoding WIF and deriving wallet

Sequence diagram of Decoding WIF and deriving wallet in agntn/keys

Drill down
Client Interfaces — 3 components
🟡 CHANGED MCP Server

Exposes keys capabilities as MCP tools over stdio, now including keys_encode_wif and keys_decode_wif.

🟡 CHANGED Pi Coding Agent Extension

Pi coding agent extension registering keys tools, now expanded to 15 tools with WIF conversion support.

🟡 CHANGED Public Library API

Public library exports exposing encodeWIF and decodeWIF functions and associated types alongside blockchain and HD utilities.

Tool Operations — 1 component
🟡 CHANGED Tool Operations Dispatcher

Shared tool executors and validation schemas for MCP and Pi agent transports, implementing encodeWif and decodeWif.

Derivation & Mnemonics — 1 component
🟢 NEW WIF Converter

Encodes and decodes WIF private keys for Bitcoin, Litecoin, and Decred with checksum verification, network prefix handling, and secp256k1 scalar validation.


View

  • Architecture lens
  • Data flow lens
  • Expand every detail
  • Show unchanged neighbours

Tip

GitHub will not let you zoom an image in a comment. The link under each diagram opens it on an interactive canvas, where you can zoom, pan and step through the flow.

🪧 More tips
  • Run PR Lens on your own machine: npx skills add coldteadotai/pr-lens installs the agent skill. Then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Draw a diff before it is even a pull request: npx @coldtea/pr-lens-cli analyze --base origin/main reads the diff with your own model key, and npx @coldtea/pr-lens-cli render .pr-lens/graph.json draws the same lenses on your machine.
  • The boxes under View are live. Tick Architecture lens or Data flow lens to choose which diagrams appear, or Expand every detail to open every drill-down at once. The comment redraws in place a few seconds later.
  • Show unchanged neighbours lists the components this change did not touch alongside the ones it did, so the drill-down shows what the changed code sits next to.
  • The CLI's render picks up .github/pr-lens.yml automatically and applies your corrections (renames, exclusions, lane pins) at draw time.
  • Would you rather run it from CI on a key of your own? Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and a model key in your repository secrets, say GEMINI_API_KEY. The Action asks Gemini by default, or OpenAI and any endpoint speaking /chat/completions through its provider input.
  • PR Lens is free for open source. A star on the repository is what keeps it going.
  • Push a new commit and the whole comment re-renders for the new head. An older run never overwrites a newer one, so a slow render cannot put a stale diagram back.
  • The diagrams follow your GitHub theme, so dark mode gets the dark render and light mode the light one, and the moving dots show this pull request's data in motion.

◈ Rendered by PR Lens · crafted with ❤️ by the Coldtea team · Come say hi on Discord

@oritwoen
oritwoen merged commit 6bed42c into main Sep 9, 2026
3 checks passed
@oritwoen
oritwoen deleted the feat/wif branch September 9, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants