MCPcopy Index your code
hub / github.com/MuleTools/PonyDirect

github.com/MuleTools/PonyDirect @0.05

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.05 ↗ · + Follow
89 symbols 213 edges 12 files 2 documented · 2%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Pony Direct

Pony Direct is a proof-of-concept Android app developed by Samourai as part of the Mule.Tools research and development initiative exploring alternative means of transaction broadcasting to enhance censorship resistance.

Pony Direct can be used for transmitting transactions to the bitcoin network via SMS. Send your own transactions by SMS using a known Pony Relay or allow your own contacts to use your mobile number as an SMS relay.

Get Started

Build:

Import as Android Studio project. Should build "as is". PGP signed tagged releases correspond to builds that were released on GitHub.

APK:

The latest version of the APK can be installed from the Github Releases page

How to use

Broadcast a transaction by SMS:

  1. Launch PonyDirect and enter the mobile phone number of a known Pony Relay device in the toolbar settings. A known UK based Pony Relay (+447490741539) will be automatically entered. If adding a different mobile number make sure to use international format.
  2. Tap the FAB menu icon on main screen to paste or scan signed transaction hex. You can create and display raw signed transactions with a wallet like Samourai Wallet.
  3. The transaction hex will be automatically divided into segments and sent via multiple SMSs to the desired relay device. Please note, you will be charged at your normal rate for sending standard SMS messages.

Relay transactions for your mobile contacts:

  1. Launch PonyDirect and keep it open

  2. Incoming SMS using the payload format described below will be intercepted and parsed to reconstitute the signed hex transaction.

  3. Upon validation of the transaction hash, the transaction will be broadcast via the Samourai node pushTx.

SMS payload format

The format used is a simple JSON object for each SMS. Each SMS transmits a segment. The sending app breaks down a transaction into a sequence of segments and the receiving app sequentially parses the segments to reconstruct the signed transaction.

Name Description
s integer, number of SMS segments for this transaction. Only used in the first SMS for a given transaction.
h hash of the transaction. Only used in the first SMS for a given transaction.
n optional, network to use. 't' for TestNet3, otherwise assume MainNet.
i integer, Pony Direct payload ID (1-9999).
c integer, sequence number for this SMS. Should be zero if first SMS for a given transaction.
t hex transaction data for this segment.

Sample (1 transaction, 5 SMS, hex encoded)

{
    "s":5,
    "c":0,
    "i":1000,
    "h":"fa6ffa1b50c7638c692de20b9a6a0e2f7d5ae760c05201fc3307b1f9f84e020d",
    "t":"0100000001c69b800a73bf8016aef958994a4a1227849122d3"
}

{
    "c":1,
    "i":1000,
    "t":"09c03c9cb3ed1bc350ff8151000000006a473044022061bb12434713c4a04ebe1068301c01caf154362b9503913a17312e93bb2b568f02200a31e7a91a257065aa"
}

{
    "c":2,
    "i":1000,
    "t":"ebd49636de5a4b13524c1f49d75b44ad13d161db80eb3801210240d1bd817f2f862ceb39058119c1290effa325011d81718330a3318a26b12ecaffffffff02934a"
}

{
    "c":3,
    "i":1000,
    "t":"5700000000001976a914caa5aced5e82cd7af3d72a905aecc9b501ad3f3988acaf2782000000000017a914b385c8d94e28fb8bf21a1cb2933582f7321fafb98700"
}

{
    "c":4,
    "i":1000,
    "t":"000000"
}

Z85 encoding

Z85 encoding of transaction data can be selected in the settings. This will result in 40% less data in the transmitted payload and fewer outgoing SMS for a sender. A receiver will detect incoming Z85 data and decode accordingly.

Sample (1 transaction, 4 SMS, Z85 encoded)

{
    "s":4,
    "c":0,
    "i":30,
    "n":"t",
    "h":"31fe18833073f818846ef56d663920f835b84ec5a9a28a18dd13b7da0f7339ae",
    "t":"0rr910099?BH{)mCfen5Qmo<?G*.8{pqa2YWg7Wz"
}

{
    "c":1,
    "i":30,
    "t":"tdsyFxcu*E0000n7624Wwh)}]4]@+D.]z!8sa@W<+GzQt%nS92f<Gn}000007Pwapa.v!NI%<&{zRotVY}net9Y?P40f\/u+000007Pw9vOAa>sv23If5M([."
}

{
    "c":2,
    "i":30,
    "t":"93h2h[v4ng0.j}j0W8+z}Mxm3hzK7p?]+pAhUQM6Zra^h<lT-?V+[8G@jSjPf\/:o[:UUK=P?Hn%6E4KQ=9mO:mYRQdX*34nNu$Y<0u?Kdk6l?@1FhE]^BHSJ"
}

{
    "c":3,
    "i":30,
    "t":"!FQy>-*Y=0I1tEqp85]MTn}O!0000"
}

Contributions and PRs encouraged

We highly encourage PR's and contributions to this proof-of-concept. Below are some low hanging fruit items that we would like to see PR's for:

  • run SMS receiver broadcast as a service
  • manage several SMS relays
  • manage several pushTx ('trusted node')
  • improve logging
  • improve error control

Info

License:

Unlicense

Contributing:

All development goes in 'develop' branch - do not submit pull requests to 'master'.

Dev contact:

PGP

Extension points exported contracts — how you extend this code

ZBarConstants (Interface)
(no doc) [1 implementers]
app/src/main/java/com/dm/zbar/android/scanner/ZBarConstants.java

Core symbols most depended-on inside this repo

has
called by 15
app/src/main/java/com/samourai/ponydirect/PrefsUtil.java
getInstance
called by 12
app/src/main/java/com/samourai/ponydirect/PrefsUtil.java
getValue
called by 6
app/src/main/java/com/samourai/ponydirect/PrefsUtil.java
setValue
called by 6
app/src/main/java/com/samourai/ponydirect/PrefsUtil.java
getInstance
called by 5
app/src/main/java/com/samourai/ponydirect/TxFactory.java
getInstance
called by 5
app/src/main/java/com/samourai/ponydirect/Z85.java
decode
called by 5
app/src/main/java/com/samourai/ponydirect/Z85.java
getInstance
called by 3
app/src/main/java/com/samourai/sms/SMSSender.java

Shape

Method 77
Class 11
Interface 1

Languages

Java100%

Modules by API surface

app/src/main/java/com/samourai/ponydirect/MainActivity.java22 symbols
app/src/main/java/com/dm/zbar/android/scanner/ZBarScannerActivity.java11 symbols
app/src/main/java/com/dm/zbar/android/scanner/CameraPreview.java11 symbols
app/src/main/java/com/samourai/ponydirect/TxFactory.java9 symbols
app/src/main/java/com/samourai/ponydirect/PrefsUtil.java8 symbols
app/src/main/java/com/samourai/ponydirect/Z85.java7 symbols
app/src/main/java/com/samourai/sms/SMSSender.java6 symbols
app/src/main/java/com/samourai/ponydirect/SettingsActivity.java6 symbols
app/src/main/java/com/samourai/sms/SMSReceiver.java4 symbols
app/src/test/java/com/samourai/ponydirect/ExampleUnitTest.java2 symbols
app/src/androidTest/java/com/samourai/ponydirect/ExampleInstrumentedTest.java2 symbols
app/src/main/java/com/dm/zbar/android/scanner/ZBarConstants.java1 symbols

For agents

$ claude mcp add PonyDirect \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page