Transaction Vouchers

From ArdorDocs
Jump to: navigation, search
This page contains changes which are not marked for translation.
Other languages:

Transaction Vouchers is an Ardor feature that was introduced in the release Ardor client 2.1.0e

Introduction to Transaction Vouchers

See an article about transaction vouchers and their use cases.


API support

To create a voucher set the "voucher" parameter to "true" when submitting any type of transaction. As a result the transaction won't get broadcast to the network, instead the response will include the special voucher format. Convert this response to a file or QR code in order to generate a deliverable voucher.

Please note that the "publicKey" parameter is mandatory when "voucher" is "true", as the private key supplied is from the account signing the voucher.

processVoucher - the process voucher API is used to submit a transaction based on voucher file provided as parameter and the secret phrase of the account submitting the transaction.

Usage Example

Vouchers are useful when Alice wants Bob to pay her in a secure tamper proof way.

Assume that Alice with account ARDOR-KX2S-UULA-7YZ7-F3R8L wants Bob whose account is ARDOR-V4D7-D3XW-JX9Z-EAC8K to pay her 100 IGNIS. Alice logs into the wallet using Bob's address and using the normal send money dialog performs a payment from Bob to her account. But of course she cannot submit this payment since she doesn't have Bob's passphrase. Instead she enters her passphrase and checks the voucher checkbox.

Alice.asks.bob.to.pay.PNG

As a result the wallet generates a digitally signed voucher which she sends to Bob as a json file or QR code off blockchain. Nothing is submitted to the blockchain at this stage. Note the download button above the voucher text.

Alice.voucher.PNG

Bob now uses the "Load Voucher" function from the wallet gear menu to load Alice's voucher. He double checks all the details then signs and submits voucher to the blockchain. The wallet helps Bob verify that the voucher was indeed signed by Alice, however Bob still needs to verify that the amount is correct in case of payment or in general that the transaction he is about submit is indeed acceptable according to his agreement with Alice.

Bob.submit.voucher.PNG

The result is that Alice received her payment while Bob now has the voucher file or QR code which represents an invoice for his financial records. Alice got her tokens and Bob is sure that he really paid Alice and that Alice indeed has a passphrase to her account.

This voucher is tamper proof, if Charlie attempts to change anything in the voucher file while in transit, the wallet will detect this change and alert Bob when he loads the voucher by reporting a "Cannot validate voucher content." message.