Tutorial on transaction vouchers

From ArdorDocs
Jump to: navigation, search

Other languages:

In this installment, it will be reviewed two demonstrations of the new “Transaction Voucher” feature available on the Ardor mainnet. Transaction Vouchers make it simple for users to send dual signature, fixed invoices and share distributions between two addresses on the blockchain — this sounds insignificant, but it is a major step forward for mainstream adoption of blockchain technology. The information here represents a modified version of the information in the following video tutorial:

Why Does this Matter? Context for Transaction Vouchers

Rule number one on the blockchain: the blockchain is immutable. This means transactions are irreversible. If you make a mistake entering a recipient address, or if you enter too many zeros at the end of the amount you are sending, you can send your funds into oblivion or bankrupt yourself with no recourse. This is clearly not a sustainable design for businesses to operate with thousands of users on the blockchain. The risks are simply too high for losing user funds.

With the invention of “Transaction Vouchers” on the Ardor platform, you can now create secure, fixed invoices between two accounts — essentially eliminating the risks mentioned a moment ago. This feature is available for many types of transactions across Ardor and its child chains — including those involving assets, monetary supplies, and the marketplace.

Let’s take a look at how Transaction Vouchers work by walking through a basic example, then we can take some time to discuss and demonstrate additional use cases. To participate in this demonstration, you must download the Ardor client from Jelurida. Refer to the guide that explains the download process for the Ardor client wallet.

How to Create a Transaction Voucher

In this first demonstration, we will be creating a Transaction Voucher on the Ardor parent chain, but the process is essentially the same when using child chains. The Transaction Voucher feature is available on the Ardor mainnet.

Let’s consider a basic situation for this first Voucher: pretend you need to invoice Big Corp. for $200 of services that you provided in July 2018. You already know how much they owe you, and you know their wallet address because it is listed in your employment agreement. All you need to do is the following:

Open the wallet.

1 e8WfTwUGe6SdP90Ca6fcQg.png

For this practice exercise to work, we will be using the two addresses below:

Pretend ARDOR-XC6S-U47K-W2LN-2XSK2 is your personal address

Pretend ARDOR-63EF-NL2A-WWNC-6JL6N is the address for Big Corp.

You should copy the address for Big Corp. and log in as them.

1 zQjKhK5332Szm2FU tyhYA.png

You are now unofficially logged in as Big Corp. If you are running the Full Client instead of a Light Client, you will need to wait for the blockchain to synchronize. While you wait, you should confirm the wallet address in the upper left corner matches the wallet address for Big Corp. in your contract.

1 kU-yBuwUvYHcKXSSO28e2A.png

Now that you have verified this is the correct address and the blockchain is up-to-date, let’s continue with the example. (Note: If you are having trouble getting the blockchain to synchronize, consider re-installing the client and selecting the options for the “light client” and during the installation process. You will be able to create a transaction voucher using the light client, but you must be using the full client when you attempt to redeem the voucher.)

Big Corp. owes you $200 worth of Ardor. As of your invoice date of 18 August 2018, that means approximately 1702 Ardor. Click “Send ARDR” in the menu at the top of the screen.

1 ePGxwYts3XUAvuUmdpj09Q.png

A pop up box appears.

1 rsyNzhC1fflDm6 QsgnGdQ.png

Enter your personal address as the recipient, enter 1702 ARDR as the amount, click the box next to Voucher, and then enter the passphrase for your personal address.

1 QjSu3KIrlxH6NdID 4VWww.png

Check the details are correct, and then click “Submit.” If you are submitting this for a child chain, you will have to click “Calculate” the minimum fee, then “Submit.” This generates the Transaction Voucher as a json file and a QR code.

1 AKF8BYJ26RiMRk8Z ovNfQ.png

There should be a download button we can click near the top, or you can also just copy the json data or QR code, and send it to Big Corp. through email or some other means.

Basic Implications of Transaction Vouchers

Once you have completed this process, you are done. When Big Corp. receives the Transaction Voucher, they will be able to see that you entered your own recipient address, the amount to be paid, and it was signed by you — so they know you have reviewed this transaction and approved it.

One of the major selling points here: your secret passphrase can only sign transactions for your wallet address, so if you entered the wrong receiving address by mistake when you created the Voucher invoice, then you would not have been able to sign this transaction or generate the Voucher. Similarly, if you made a mistake and requested funds from the wrong account, Big Corp. would not be able to sign the transaction when they attempt to redeem the Voucher. In both situations, you would discard the Voucher, and simply request a new one.

The details of this Transaction Voucher are tamperproof, but it’s important to understand nothing in this process occurs on the blockchain until the actual transaction fee is paid by Big Corp. when they upload the Voucher and redeem/submit it. This design essentially eliminates the potential for lost funds and provides a new level of security for financial transactions. Let’s see what Big Corp. needs to do to redeem/pay this “Transaction Voucher,” or invoice.

Redeeming a Transaction Voucher

Big Corp. opens the Ardor wallet and logs in using their own wallet address.

1 d0JXcmr3HLrUeaGx3MIXwQ.png

They navigate to the gear symbol in the upper right corner to open the settings menu and click on the “Load Voucher” option.

1 Tz Jgso-RK4vKudpIFx2iw.png

A pop up appears.

1 A6lfHLqYon2UpgDWTKtmxg.png

Big Corp. will click “Choose File” and select the json file that was sent to them, or they can copy the json data, as noted below. Alternative option: the QR code provided during the Voucher generation process can be redeemed through certain 3rd party wallets and can be integrated into applications for a smoother redemption process.

1 IbkR1UMPoa04CvUmEZF-7g.png

Big Corp. pastes this json data into the Voucher Reader.

1 YcfG8QDO8VJjkOOH-d wiw.png

Big Corp. hits “tab” on their keyboard. The details of the Transaction Voucher will load in the pop up box.

1 pUtio5WJEOA-BMHSU4HAmw.png

Big Corp. checks the details (noted in the red box above), they ensure the “Creator Account” matches the account they have on file for you, enter their passphrase, click “Calculate” for the lowest fee, and then hit “Submit.” You land on the Dashboard and can view the pending transaction.

1 x4eDmdNfcn5YKDOwdpvLcA.png

In approximately 1 minute, you will see your balance update as the transaction gets included in the next block of the blockchain.

1 BBbCrG4RH0mSu9BNGiRYpA.png

Use Cases for Transaction Vouchers

That’s the basics of how to create and redeem your first “Transaction Voucher.” Now, users can ensure they are sending funds between their correct wallet addresses. Friends can securely invoice each other, just like they do on Venmo and ApplePay. And Businesses can be certain they are sending funds to the correct individuals when invoiced. Let’s take this one step further and consider two, slightly more complex use cases for Transaction Vouchers.

Exchange “Deposit” and “Withdrawal” Vouchers

If you have ever withdrawn funds from a cryptocurrency exchange, you know the process is risky. Many times, you need to include randomly generated “messages” from the exchange alongside your receiving address. This has resulted in the loss of thousands of dollars worth of cryptocurrency because people are people. Human error exists, and sometimes we copy and paste the wrong receiving addresses or messages.

Now, if cryptocurrency exchanges wanted to eliminate “help desk” tickets associated with people who send their money to the wrong exchange address, or people who fail to include messages in their withdrawals — exchanges like Bittrex and Binance could directly integrate Transaction Vouchers to create secure “deposit” and “withdrawal” vouchers.

Consider the situation for one moment — you tell Bittrex you want to move 4000 Ardor to a certain address. The Bittrex system would create a secure Voucher, signed by Bittrex, for this transaction. Then, you would upload this Voucher in your wallet, sign the transaction, and receive your funds.

Remember one of the major selling points here: your secret passphrase can only sign transactions for your wallet address, so if you entered the wrong receiving address by mistake when you requested the Voucher, then you would not be able to sign this transaction. You would discard this Voucher, and simply request a new one from the exchange. This dual-entry system essentially eliminates the potential for sending funds to the wrong address.

Share Distributions on the Blockchain Using Vouchers

Let’s consider another use case and do a demonstration: what if you run an ICO or you want to distribute shares on the blockchain and you want to issue your tokens in a secure way? Perhaps you don’t want to just disburse 100 million tokens, and instead, you want each investor to sign off on receiving the correct amount of funds at the correct address. Well — we can do this too with Transaction Vouchers. Let’s take a moment to look at how we could create a Transaction Voucher for an Asset on the Ignis child chain. If you do not know how to create an Asset in the first place, refer to issue asset.

Demonstrating Share Distributions Using Transaction Vouchers

Log in to the Ignis child chain (in red) in the wallet and navigate to “Assets” (yellow) and then click “My Assets” (green).

1 3I-X4QX8sXVfpTKgNGdMhQ.png

You’ll notice I have two assets here that I have created in the past. I will click the “transfer” button next to the “CDTest1” asset. Note: the options for deleting and adding shares can be limited using the Account and Asset control functions. Those topics will be covered in following guides.

1 oRNBeZJoKKzB-qqEjsMpTg.png

A pop up box appears.

1 A-IaCpV7Mn4aNqlN7ZoKJA.png

For the recipient address, enter the address of an individual who participated in this imaginary ICO. Then, enter the quantity of the assets they should receive. Third, check the voucher box, and fourth, enter your passphrase.

Once we’re happy with the information, click calculate minimum fee and then, “Submit.” Download the Transaction Voucher, just like in the previous example. Now, we can send this file to the ICO participant and they can follow the same Voucher Redemption process demonstrated earlier to claim their assets.

Versatility of Transaction Vouchers

If your company shares or ICO tokens used a Monetary Supply instead of Assets, Transaction Vouchers will still work. And if you decide to use the marketplace, you can create Transaction Vouchers in those contexts as well.

As you can see, the Transaction Voucher process can be completed in just a few minutes. Individuals and businesses can now sign off on blockchain based transactions with confidence, knowing that the json file and QR code vouchers are secure and customized to each individual transaction. This represents a major leap forward in creating a secure ecosystem where individuals and businesses can send funds without worrying about small, irreversible mistakes.

Continue your journey through the Ardor ecosystem by learning how Turing-complete Lightweight Contracts create a more simple and secure environment for blockchain based smart contracts. Written guidance on lightweight contracts is available here and you can refer to several articles describing the functionality [1]