Skip to content


Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Example system for processing Dash InstantX payments

This repo contains everything needed to recreate the Miami "dash'n'drink" soda machine InstantX tech demo.


Dashvend is a network-driven python script which:

  • generates payment addresses
  • masquerades as a local dashd peer (port 9999 communication)
  • watches for transactions on the dash network to the next payment address
  • refunds non-InstantX transactions and over/underpaid InstantX transactions
  • counts masternode locks for passing transactions
  • triggers two relays (sign light, product release) when the lock count meets a configurable threshold

processing overview

network traffic -> dashd -> -> -> -> -> screen/relay

There are two message types involved in confirming an InstantX transaction:

  • The initial InstantX transaction - A standard-format transaction with a message type 'ix' instead of 'tx'
  • The masternode consensus locks - Dash-specific messages of type 'txlvote'

During initialization,

  • configures to forward these message types (and 'tx's) to
  • configures with the current payment address to monitor

Messages forwarded to

  • are checked against the current payment address
  • are stored in a temporary mempool
  • are counted until a configurable threshold of locks is met

Once the lock count is met,

  • calls trigger_sale()
  • flushes the mempool entry

All signature validation of locks is performed by dashd. Only valid locks are forwarded to

component overview


bin/          - top-level script
bin/dashvend/   - system configuration variables
bin/dashvend/  - InstantX processing
bin/dashvend/ - dash node peer connection
bin/dashvend/     - python-bitcoinlib compatibility monkey-patch
bin/dashvend/  - dashd rpc communication (refunds, balances)
bin/dashvend/  - display controller (setuid bash wrapper)
bin/dashvend/  - relay controller (setuid bash wrapper)
bin/dashvend/     - main application


bin/         - fresh install - Makefile utility
/etc/init.d/dashvend          - starts dashd/dashvend on boot/shutdown
bin/      - called by above, starts/stops screen processes
bin/dashvend_screens.screenrc - gnu screen config file for above
bin/trigger_relay             - setuid script, calls .sh file below
bin/          - run as root, triggers gpio pins
display/show_image            - setuid script, calls .sh file below
display/         - run as root, invokes fbi to display image
display/ - screen image builder, uses imagemagic
display/source_images/        - source images for above

boot sequence

After running 'make init', on boot, /etc/init.d/dashvend will (through bin/ start a screen session named 'dashvend_screens' with two screens running:

  • dashd (printtoconsole=1) (no debug.log writing to sd card)
  • bin/ (the main application)

Once the cpu load settles to under 50%, (this can take a while on a pi, see limitations below) the vending app indicates it is ready to process payments.

rpi2 limitations

Slow disk I/O is a major contributor to slow rpi2 startup times. Using a class 10 SD card, after booting, dashd can take up to two hours (sometimes longer) to fully synchronize with the network and be ready to accept InstantX transactions. Mounting a USB drive and symlinking the .dash directory can bring startup times down to around an hour.


For relay and 480x800 lcd display support, you'll need to build or download the raspberry pi 2 image shown below.

Once you have a base image, run the following to install all the dashvend dependencies:

git clone
cd dashvend
# after entering your sudo password, allow several hours/overnight for
# dashd to finish bootstrapping the blockchain

dedicated install

To install the boot/shutdown init scripts, do:

make init

dedicated raspberry pi 2 install


To build your own dash'n'drink implementation you'll need:

  • a raspberry pi 2
  • an hdmi monitor and attached keyboard (to build the image)
  • a 480x800 pixel hdmi lcd screen - the soda machine used
  • any 5v dual relay board attached to (gpio 5 (sign light) and 6 (soda release), pins 29 and 31)

A 2 amp power supply is recommended for stability.

downloading the base raspberry pi 2 image

If you want to save time, and have the 480x800 lcd screen attached, you can skip building the base image by downloading it from: If you don't have the 480x800 screen, you can ssh into the machine (user pi, password raspberry) over ethernet and comment out the lcd-specific entries in /boot/config.txt (see section below) and reboot to use a hdmi monitor.

building the base image

Write image 'raspbian jessie lite' found on to an sd card

# be careful with this command, you can destroy data if you don't set the
# dd target (sd card location) correctly
unzip -qc 2016-02-03-raspbian-jessie-lite.img | sudo dd of=/dev/sdb
  • attach keyboard, hdmi monitor, ethernet, sd card
  • boot
  • login as pi, password raspberry
  • change pi password
  • resize partition with 'raspi-config'
  • reboot
  • configure /boot/config.txt and /boot/cmdline.txt for 480x800 screen and overclocking (see below)
  • connect lcd
  • reboot
  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt-get install git
  • configure wifi -
  • ssh in through wifi
  • disconnect ethernet
  • reboot
  • ssh in through wifi
  • install dashvend

480x800 hdmi lcd screen configuration


hdmi_cvt 800 480 60 6 0 0 0


add consoleblank=0
for example:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 consoleblank=0 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait



optional overclocking (recommended)


arm_freq=1100  # with heatsink. works best @ 1100, but not all rpi2's can do it

post-install setup

configuration: bin/dashvend/

Before launching dashvend, you need to configure your payment address seed. See instructions in bin/dashvend/


You will need to fund the local wallet to process refunds. do:

dash-cli getnewaddress

and send some dash to it.

If the local wallet has insufficient funds to process a refund/bounce, it will write an error in the log file until funded.


dash InstantX vending system demo







No releases published


No packages published