SatMask
🛰️🎭
Install / Use
/learn @summa-tx/SatMaskREADME
SatMask
Proof of Concept code for signing Bitcoin transactions via MetaMask.
DO NOT USE THIS CODE IN PRODUCTION.
How it works
MetaMask's eth_sign api allows the user to sign arbitrary digests. Unlike
geth, it does not modify or hash the argument. This means we can calculate the
sighash of a Bitcoin transaction and pass it to eth_sign. After that, we
need to translate the signature from Ethereum's hex-encoded RSV standard to
Bitcoin's DER-Encoded RS format, and add the signature to the transaction.
Calculating the sighash requires knowledge of the public key that will sign,
so an extra personal_sign call is made. This generates a signature from which
we can recover the users' pubkey to use in the sighash algorithm.
The current version signs only transactions with 1 witness pubkeyhash input and one witness pubkeyhash output. The resulting transaction is logged to console.
A brief tour of the codebase
-
src/tx.jshandles transaction datastructure manipulation. This includes construction, sighash serialization, and adding the signature to the transaction (inside a witness). -
src/sigs.jshandles interfacing with MetaMask, retrieving the signature, and translating from RSV to DER. -
src/App.jsis a simple react app that provides a convenient interface for specifying a transaction. All credit to @tynes for this part :)
How to run it
Don't. Like really don't. Read the code, but don't run it.
Related Skills
node-connect
350.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
350.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
350.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
