ATMs that accept Dollars and Return CloudCoins

From CloudCoin Wiki
Jump to: navigation, search

ATM machines can receive Dollars and return CloudCoins. The customer will need to tell the ATM their Skyvault account.

Step 1: Create a Skyvault Account


CloudCoin Developers are happy to walk you through the process of integrating CloudCoin onto your exchange including spending weeks over Skype helping you set things up. We estimate that it should take no more than one developer two weeks to implement.

SkyVault is a virtual bank that allows you to store, send, receive and transfer CloudCoins. Each Skyvault account has an address. A sample address would be '', '' or ''. You and your customers will need SkyVault Accounts to use as wallets.

  1. Go to
  2. Click on "Get Skyvault"
  3. Enter a temporary wallet name for your account. If your exchange is called Foo, you would choose "" as your wallet name and Skyvault Address.
  4. Click the "GET SKYVAULT" button. You will then receive a virtual Skyvault debit card as a PNG. Click on the "DOWNLOAD YOUR SKYVAULT DEBIT CARD" button to download it. Keep this PNG safe. You will need to have it on your web server.
  5. Look at the IP address on the back of the Debit Card. This translates to the decimal serial number of your Skyvault Account. You will need this in the next step.
  6. Now you need to create another SkyVault account to act as the test customer. Logout of SkyVault and create another account called something like "". Again, download this PNG file and keep it in a safe place.

Step 2. Add Some DNS Records To Your DNS Zone

You will create DNS records so that people can figure out your Skyvault address and find your webhook. This allows them to send you payments and allows them to tell you in real time that their payment was sent.

Example: IN	A IN     TXT  ""

1. Create an 'A' record on your DNS server.

  • The type will be 'A',
  • The Name will be 'cloudcoin'
  • The IPv4 Address will be the number on the back of your Skyvault debit card.
  • The TTL with be 'Auto'.*
  • Make sure you do not proxy this 'A' record but use DNS only (only applicable if your DNS supports proxy. Most do not).

2. Test that your DNS records are working by going to a command prompt (Windows) and typing:


where you replace "" with the name of your domain. You should receive the IP address that is on the back of your Skyvault Debit card.

Step 3. Install SkyVault Connect CLI on your Linux Server

1. Download the latest version of the skyvault_connect binary If you need a version that runs in Windows, let us know.

2. Install it to the bin directory and give it exec permissions

# cp skyvault_connect /usr/local/bin
# chmod +x /usr/local/bin/skyvault_connect

3. Impersonate a web-user on your server (e.g. apache, nginx, www, www-data) and define the home directory (e.g. /var/www).

# mkdir -p /var/www/cloudcoin_manager
# chown www-data:www-data /var/www/cloudcoin_manager
# su -m www-data

4. Run the program and make sure the output ends with a json string

$ /usr/local/bin/skyvault_connect -home /var/www -debug -cli

{"code":4189,"message":"Command is missing","details":null}

5. Put your Skyvault debit card png file in to the SkyWallets folder (You got this when you created the account) Note: This location assumes you are using it on a web server. You may place it somewhere else.

$ mkdir /var/www/cloudcoin_manager/SkyWallets/
$ cp /var/www/cloudcoin_manager/SkyWallets/

6. Execute the SkyVault Connect's 'balance' command to make sure the program recognized the Debit Card Account.

$ /usr/local/bin/skyvault_connect -cli skybalance | jq '.balance'

$ 0

Step 4. Ask for you customer's Skyvault address

Skyvault addresses are very easy for people to write and type into machines. They look like fully qualified domain names: "". However, customers also have the ability to show this information as a QR code so that the ATM machine can read this.

To get the customers SkyVault address you may provide them a text box or allow them to show you a QR code from their phone.

The only catch is that the QR code contains the URL of the website that another user use to give the person CloudCoins. But the ATM only needs the last part which is the customer's SkyVault address.

The QR code contains this:
(Where "customer" is the customer's unique account name.

However, you only want:

So you must remove the:

If you can delete the path from the QR code, then you will be left with the customer's address. This is the customer's address that you can send CloudCoins to. Below you can see how the customer can show their QR code from their software.

Showing the SkyVault Address from

Step 5. Program Your Server to Send Coins to Customers when Cashing Out

1. In order to transfer coins from your SkyVault account to a customer's SkyVault account you will want to execute a 'skytransfer' command

/usr/local/bin/skyvault_connect -cli skytransfer <Your Account Name> <Customer Account Name> <amount to send> <memo>


$ /usr/local/bin/skyvault_connect -cli skytransfer 10 "Payment from Bitmart"


You need to check "TotalAuthentic" and "TotalFracked" number. Upon successful operation the sum of these values must be equal to the amount sent.

There is a log file can be found in the home folder:


Step 6. Test The Whole Process

  1. Use the to create a second Skyvault account.
  2. Using your new ATM to enter your this test account and see if it receives the funds.
  3. Check the balance of your main Skyvault to see if the withdrawal was registered in statements.

Step 7. Setup a Maintenance Chronjob

With CloudCoin, it is up to the user to synchronize its wallet on all the clouds. This cron-job will synchronize once a day.

0 1 * * * /usr/local/bin/skyvault_connect -cli maintenance

The line above will launch at 1am at night

(!) The cron job must be launched as the same user as the one that calls 'skyvault_connect skytransfer' Check the main.log and make sure the cronjob is working after the setup.

This is an example of the page


// Your skyvault address
define('SKYVAULT_ADDRESS', '');

// Path to skyvault_connect
$skyvault_connect = "/usr/local/bin/skyvault_connect";

if (!file_exists($skyvault_connect))
  die("skyvault_connect not found");

if (!is_executable($skyvault_connect))
  die("skyvault_connect doesn't have exec permissions");

// Authorize the request
// By IP Address, By Auth Token or Authorization header on your choice

// Customer SkyVault address
$to = $_GET['to'];

// Amount to send
$amount = intval($_GET['amount']);

// Any reference 
$memo = $_GET['memo'];

if (!filter_var(gethostbyname($to), FILTER_VALIDATE_IP)) 
  die("Invalid Customer Skyvault");

if ($amount <= 0)
	die("Invalid Amount");

$cmd =  "$skyvault_connect -cli skytransfer " . SKYVAULT_ADDRESS . " $to $amount $memo";

// Exec the binary
$json = exec($cmd, $outarray, $error_code);
if ($error_code != 0) 
  die("Invalid response from skyvault_connect: $error_code, Output $json");

$arr = json_decode($json, true);
if (!$arr) 
  die("Failed to decode json: $json");

if ($arr['code'] != 0) 
	die("Failed to send coins: $json");

echo "Coins sent";