β Back to IDE
π What is BTC-TKP?
BTC-TKP (Bitcoin Telephone Keypad), the FatCat Protocol, is a minimalist, stack-based
programming language designed specifically for Bitcoin transaction signing on devices with only 12 buttonsβthe
standard telephone keypad layout (0-9, *, #).
This language enables Bitcoin operations on extremely constrained hardware: signing devices, vending machines,
ATMs, door locks, and any embedded system with a telephone keypad. It's a complete Bitcoin transaction language
that fits on 12 buttons.
Open Source Project: BTC-TKP is open source software, designed to be freely used, studied,
modified, and distributed by anyone building Bitcoin-enabled hardware devices.
π― Design Philosophy
The 12-button constraint isn't a limitationβit's a feature:
- Universal Hardware Compatibility: Works with any device that has a telephone keypad
- Air-Gapped Security: Perfect for offline signing devices with minimal attack surface
- Embedded Systems: Ideal for vending machines, ATMs, and IoT devices
- Low Cost: No expensive touchscreens or complex input devices required
- Intuitive: Everyone knows how to use a telephone keypad
β¨οΈ The 12-Button Telephone Keypad
Standard telephone keypad layout used in BTC-TKP
ποΈ Stack-Based Execution Model
BTC-TKP uses a stack-based virtual machine similar to Bitcoin Script, Forth, and other stack languages.
All data operations work with a Last-In-First-Out (LIFO) stack.
How the Stack Works
Think of the stack like a stack of plates:
- You can only add (push) plates to the top
- You can only remove (pop) plates from the top
- The last plate added is the first one removed
Example: Stack Operations
100* β Stack: [100] (push 100)
20* β Stack: [100, 20] (push 20)
*1 β Peek: 20 (look at top, don't remove)
*2 β Stack: [20, 100] (swap top two items)
π Complete Command Reference
Digit Keys (0-9)
Digit keys build numbers in the input buffer. You can type multiple digits to create larger numbers.
1 β Buffer: "1"
2 β Buffer: "12"
3 β Buffer: "123"
4 β Buffer: "1234"
* β Push 1234 to stack
* (Star/Asterisk) - Push & Stack Operations
The * key handles data stack operations:
| Command |
Name |
Description |
Example |
| * |
Push |
Push input buffer to stack (if buffer has data) |
100* pushes 100 onto stack |
| *1 |
Peek |
View top item without removing it |
*1 shows what's on top |
| *2 |
Swap |
Swap the top two stack items |
*2 swaps positions |
# (Hash/Pound) - Bitcoin Commands
The # key initiates Bitcoin transaction operations:
| Command |
Name |
M-Alias |
Description |
| #0 |
Clear Stack |
M0 (Mode 0) |
Remove all items from stack |
| #1 |
Scan Address |
- |
Scan recipient Bitcoin address (QR code or input) |
| #2 |
Set Fee |
- |
Pop stack top and set as fee rate (sat/vB) |
| #3 |
Sign |
- |
Sign the transaction with private key |
| #4 |
Broadcast |
- |
Broadcast signed transaction to Bitcoin network |
| #5 |
Get Balance |
M5 (Memory 5) |
Push wallet balance to stack (in satoshis) |
M-Alias System
Some commands have dual purposes and are called "M-aliases" (Mode/Memory aliases):
- #0 = C0 (Command 0) or M0 (Mode 0) - Clear/Reset
- #5 = C5 (Command 5) or M5 (Memory 5) - Balance/Memory
This dual naming helps users remember commands: "M0 to clear Mode" or "M5 to check Memory (balance)".
π‘ Complete Transaction Examples
Example 1: Simple Bitcoin Send
Send 1000 sats with 20 sat/vB fee:
#5 Check balance first (M5)
1000* Push 1000 (amount in satoshis)
20* Push 20 (fee rate in sat/vB)
#2 Set fee from stack
#1 Scan recipient address
#3 Sign transaction
#4 Broadcast transaction
Full one-liner: #51000*20*#2#1#3#4
Example 2: Using Stack Operations
Prepare amounts, swap them, then send:
5000* Push 5000
10* Push 10
*1 Peek at top (shows 10)
*2 Swap (now: 10, 5000)
#2 Set fee to 10
#1 Scan address
#3 Sign (send 5000 sats)
#4 Broadcast
Example 3: Multiple Checks
Check balance multiple times during transaction setup:
#5 Check balance
*1 Peek at balance
2000* Push amount
#5 Check balance again
*1 Peek at new balance
15* Push fee
#2 Set fee
#1 Scan address
#3 Sign
#4 Broadcast
π Dual Notation Support
BTC-TKP supports both TKP notation (*/# keys) and legacy notation (P/C keys)
for backward compatibility and keyboard convenience:
| TKP Notation (Primary) |
Legacy Notation |
Function |
| * |
P |
Push / Stack operations |
| # |
C |
Command / Bitcoin operations |
You can type either notationβthey work identically:
100*#5 β Telephone keypad notation
100P#5 β Also works (P maps to *)
100*C5 β Also works (C maps to #)
100PC5 β Also works (legacy notation)
π§ͺ TEST Mode vs LIVE Mode
TEST Mode (Default) β
Safe sandbox environment for learning and development:
- Mock wallet with 5,000,000 test sats
- Simulated address scanning
- Fake transaction signing
- No real Bitcoin is sent
- Perfect for practicing and debugging
- Status: Fully functional and ready to use
LIVE Mode π§
Framework for real Bitcoin operations:
- VM fully supports LIVE mode commands
- Complete protocol implementation ready
- Requires backend API endpoint for real Bitcoin transactions
- See INTEGRATION.md in the repository for complete API specification
- Developers can implement their own backends
- β οΈ WARNING: When connected, real Bitcoin will be sent!
Implementation Status:
The BTC-TKP virtual machine and protocol fully support both TEST and LIVE modes. LIVE mode requires
a backend API service (such as fatcatide.com or your own implementation) to handle real Bitcoin
operations. The VM architecture is complete and ready to connect to any compatible backend that
implements the specification in INTEGRATION.md.
This enables the open source community to build their own backend implementations while using the
same BTC-TKP language and IDE frontend.
π οΈ Hardware Applications
BTC-TKP is designed for these use cases:
Hardware Signing Devices
Build air-gapped Bitcoin wallets using simple keypads. No touchscreen requiredβjust 12 buttons
and minimal display.
Vending Machines
Accept Bitcoin payments on vending machines. Customer enters amount on telephone keypad, scans their
address, and the machine creates the transaction.
ATM-Style Terminals
Bitcoin ATMs with telephone keypad interface. Simple, familiar input method that everyone understands.
Door Locks & Access Control
Bitcoin-enabled door locks where users pay to unlock using the telephone keypad interface.
Embedded Systems
Any IoT device or embedded system with a 12-button keypad can now handle Bitcoin transactions.
π± Hardware Implementation Example
Here's how a BTC-TKP transaction would appear on an embedded device with a small OLED display
and 12-button telephone keypad:
Device Startup
ββββββββββββββββββββ
β BTC-TKP v1.0 β
β Wallet Ready β
β β
β Balance: β
β 5,000,000 sats β
β β
β Press # for menu β
ββββββββββββββββββββ
Step 1: Check Balance (Press #5)
[User Presses: # then 5]
ββββββββββββββββββββ
β Fetching... β
β ββββββββββ 80% β
ββββββββββββββββββββ
[Then Updates to:]
ββββββββββββββββββββ
β β Balance β
β 5,000,000 sats β
β β
β Stack: [5000000] β
β β
β Ready >_ β
ββββββββββββββββββββ
Step 2: Enter Amount (1000*)
[User types: 1 0 0 0 *]
ββββββββββββββββββββ
β Input: 1000 β
β Press * to push β
ββββββββββββββββββββ
[Display updates:]
ββββββββββββββββββββ
β β Pushed 1,000 β
β Stack: [1000] β
ββββββββββββββββββββ
Step 3: Set Fee (20* then #2)
[User types: 2 0 *]
ββββββββββββββββββββ
β β Pushed 20 β
β Stack: [1000,20] β
ββββββββββββββββββββ
[User presses: # 2 (set fee)]
ββββββββββββββββββββ
β β Fee: 20 sat/vB β
β Stack: [1000] β
ββββββββββββββββββββ
Step 4: Scan Recipient (#1)
[User presses: # 1 (scan address)]
ββββββββββββββββββββ
β SCAN ADDRESS β
β β
β Show QR code or β
β type address via β
β USB/companion appβ
ββββββββββββββββββββ
[After scanning bc1q...]
ββββββββββββββββββββ
β Recipient: β
β bc1q...vx7e β
β β
β Amount: 1,000 β
β Fee: 20 sat/vB β
β β
β Press #3 to sign β
ββββββββββββββββββββ
Step 5: Sign Transaction (#3)
[User presses: # 3 (sign)]
ββββββββββββββββββββ
β β CONFIRM β
β Send 1,000 sats? β
β β
β 1 = Yes β
β 0 = Cancel β
ββββββββββββββββββββ
[User presses: 1 (confirm)]
ββββββββββββββββββββ
β Signing... β
β [ββββββββ] β
ββββββββββββββββββββ
[Then shows:]
ββββββββββββββββββββ
β β Signed! β
β TXID: a1b2... β
β β
β Press #4 to β
β broadcast β
ββββββββββββββββββββ
Step 6: Broadcast (#4)
[User presses: # 4 (broadcast)]
ββββββββββββββββββββ
β Broadcasting... β
β [ββββββββ] β
ββββββββββββββββββββ
[Success!]
ββββββββββββββββββββ
β β SENT! β
β TXID: a1b2c3d4 β
β β
β New Balance: β
β 4,998,560 sats β
ββββββββββββββββββββ
Complete Transaction: #51000*20*#2#1#3#4
This entire transaction flow demonstrates how BTC-TKP works on credit-card-sized hardware devices
with minimal displays and 12-button keypadsβperfect for embedded Bitcoin applications.
π File Format
BTC-TKP scripts are saved with the .btctpk extension.
Files are plain text containing valid TKP commands:
# example_transaction.btctpk
# Send 1000 sats with 20 sat/vB fee
#51000*20*#2#1#3#4
Comments start with # followed by a space.
π Getting Started
- Start in TEST Mode: The IDE defaults to safe TEST mode
- Try the keypad: Click buttons to enter commands
- Or use your keyboard: Type 0-9, *, # (or P, C for legacy)
- Watch the VM State: See stack, balance, and registers update live
- Run examples: Try #51000*20*#2
- Export scripts: Save your work as .btctpk files
π Open Source
BTC-TKP is open source software. The language specification, reference implementation, and IDE
are freely available for anyone to use, study, modify, and distribute.
This enables:
- Community-driven development and improvements
- Independent security audits and verification
- Custom hardware implementations
- Educational use and research
- Commercial and non-commercial applications
Build your own Bitcoin-enabled devices using BTC-TKP without restrictions or licensing fees.
π Quick Reference Card
BTC-TKP Command Cheat Sheet
| 0-9 |
Build numbers in input buffer |
| * |
Push buffer to stack |
| *1 |
Peek top of stack |
| *2 |
Swap top two items |
| #0 |
Clear stack (M0) |
| #1 |
Scan recipient address |
| #2 |
Set fee rate |
| #3 |
Sign transaction |
| #4 |
Broadcast transaction |
| #5 |
Get balance (M5) |
β Back to IDE