Home / Standards / Payment Protocol

Payment Protocol

The main purpose of this protocol is to transfer a Payment Cheque to a merchant and and for the merchant to validate, claim and collect its money.

Introduction

protocol_validationThe main purpose of the Payment Protocol is to transfer Payment Cheques to a receiver and for the receiver of such a cheque to have a mean to validate the cheque and collect the money the cheque is promising.

The protocol is typical used between a Bitcoin Bank and a Merchant’s Web Shop during the payment operation. But it is also possible for the Customer to send a cheque directly to the Web Shop’s server from his own computer.

The protocol is currency independent. The currency and terms are stated on the cheque, which enables the payment of any currencies. Whatever the currency is accepted, is up to the receiving to decide. If the currency, or some other terms stated by the cheque are not accepted, the receiver can reject the cheque.

The protocol is implemented on web servers on the top of the HTTP layer. The protocol uses GET and POST methods to send, validate and claim cheques. This makes it easy to send cheques to any servers on the Internet, since the server can be accessed by using standard HTTP request methods and ports. It also makes it easy to implement the protocol on a web server, as GET and POST methods are supported by most servers and scripting language for web sites.

A web server that will be issuing or receiving cheques must have a link tag in the head section of the web pages to inform where the payment interface is. The link tells where to send the GET and POST methods. Typical it will look like this:

<link rel="PaymentProtocol" href="https://bitcoindemobank.com/wp-admin/admin-ajax.php">

The protocol also have GET methods to look up server details like server names, required payment conditions and a list of trusted banks. This information can be useful for preparing a payment operation and to select a bank that can issue a cheque that will be accepted by the receiver.

Money Address

A central part of the Payment Protocol is the “Money Address” concept, which is a kind of an e-mail address equivalent. The Money Address looks similar to an e-mail address, except that the @ character is replaced with an * character (astrix, star):

john.smith*bitcoindemobank.com

By using the Money Address, a user can easily send a cheque to another person, provided that person has signed up a Money Address account at some server. By sending a cheque to the above address, the money will be sent to an account named john.smith at the server bitcoindemobank.com.

The same Money Address is also used during purchase operation. When a visitor, by using a Banking App, is required to pay for some content on the web, a cheque is sent to the Merchant’s Money Address. The Money Address may be located at the Merchant’s own Web Shop server or at another bank server.

The Money Address also can receive Payment Requests. This allow a user to send bills and invoices to another person. The handling of a payment request may be user and server dependent. Either a request can be handled automatically, or require a interaction from the Money Address’s account owner.

Requirements

The protocol is currently in development and draft state. To make it complete, it should meet the following requirements:

  • The protocol must be flexible, and a cheque sender and receiver must not be tied to a specific bank or merchant.
  • The cheque receiver must be able to validate, claim and collect the money promised by the cheque
  •  The cheque receiver must be able to bundle several cheques in one collect operation, in order to reduce the transaction fee. This will also reduce the load on the block-chain.
  • The protocol must have methods for resolve payment conflicts between merchants and customer.
  • The protocol must provide information of which banks a merchant trusts. This will make it easier for users to find a bank.
  • The protocol must support cheque exchange in order to allow “repeater banking”.

Protocol document

The Payment Protocol is under development. Contributions, improvement suggestions and reviewing are welcome. Comments and discussions can be made on the forum.

Below is the current draft of the document. It can also be found on Github:

https://github.com/bitcoincheque/specifications/blob/master/PaymentProtocol.md

Payment Protocol

1 Introduction

This protocol will enable the transfer of money from a sender to a receiver by using a Payment Cheque. This include both the operation of sending the Payment Cheque itself and the operation of validate, claim and collect the money the cheque is promising.

If the parties involved trusts each other, the process can be executed in short time, which allow for instant payment. The protocol also includes methods to communicate which other peers are trusted and mechanisms to receive trust by exchanging a cheques at a trusted third party.

2 Definitions

  • Payment Cheque File – This is the cheque as defined in the Payment Cheque File Specification. A cheque is a promise that its issuer will pay its face value to a receiver by terms as noted in the cheque.
  • Payment Request File –
  • Repeater Banking –

3 Roles

3.1 Cheque Issuer

The Cheque Issuer is the body issuing a Payment Cheque and making the promising that the cheque’s money will be paid to the Cheque Receiver.

3.2 Cheque Sender

The Cheque Sender is a body that sends the Payment Cheque to a Cheque Receiver. It can be the same body as the cheque Issuer or it can be anybody else that is holding the cheque.

3.3 Cheque Receiver

The Cheque Receiver is the body receiving the Payment Cheque from a Cheque Sender and which intends to claim and collect the money the cheque is promising.

3.4 Cheque Exchanger

A Cheque Exchanger is a body that receives a Payment Cheque and issue a new cheque of with its own promise. Hence, the a Cheque Exchanger will act both as a Cheque Receiver and a Cheque Issuer. The purpose of Cheque Exchanger is to allow repeater banking.

4 Message flow

4.1 Overview of a complete payment operation

The following message diagram describes a complete payment operation of requesting payment, issue a cheque, transferring the cheque and the validation and collecting of the cheque’s money.

Note that message (A), (B) and (C) of the operation is described in other specification and protocol documents.

Note that the Cheque Issuer body at the left and right in the diagram is the same body. It is painted twice in order to make the diagram easier to read.

The operation involves a Cheque Sender, Cheque Receiver and Cheque Issuer. In this example the Cheque Sender may be a customer and Cheque Receiver may be a merchant.

 +------------+           +------------+           +------------+           +------------+
 |            |           |            |<---(A)----|            |           |            |
 |            |<---(B)----|            |           |            |           |            |
 |            |----(C)--->|            |           |            |           |            |
 |  Cheque    |           |   Cheque   |----(D)--->|   Cheque   |           |   Cheque   |
 |  Issuer    |           |   Sender   |           |  Receiver  |----(E)--->|   Issuer   |
 |  (bank)    |           | (customer) |           | (merchant) |<---(F)----|   (bank)   |
 |            |           |            |<---(G)----|            |           |            |
 |            |           |            |<---(H)--->|            |           |            |
 |            |           |            |           |            |<---(I)----|            |
 +------------+           +------------+           +------------+           +------------+

A: Cheque Sender (customer) reads some information from the Cheque Receiver (merchant) and is requested to make a payment. Customer reads price and terms as a payment request from the merchant. (This payment request and the message is not covered by this protocol. The payment request may provided as a Payment Request as defined by the Payment Request File Specification and the message may be provided as defined in the Payment Request Protocol.)

B: Cheque Sender (customer) accepts the price and terms stated in the Payment Request and requests the Cheque Issuer (bank) to issue a cheque. (This request is not covered by this protocol, but may be sent using the Banking App Protocol.)

C: The Cheque Issuer (bank) accepts the request and issue a Payment Cheque and responds back to the customer with a Payment Cheque File. (This response is not covered by this protocol, but may be sent using the Banking App Protocol.)

D: Cheque Sender (customer) sends a send_cheque message to Cheque Receiver (merchant) containing a Payment Cheque File.

E: The Cheque Receiver (merchant) receives the Payment Cheque File from the Cheque Sender (customer). The merchant verifies that the cheque’s terms meet his own payment requirements. If the merchant accepts the cheque and trusts the Cheque Issuer (bank), he can send a claim_cheque message to the bank.

F The Cheque Issuer (bank) receive the claim_cheque message. The issuer verifies the claimed cheque is a cheque that the issuer has issued and that it is unclaimed and that the claim meets the terms stated in the cheque. If the claim is valid, the issuer responds with claim_cheque_response message with result set to OK.

G: If the Cheque Receiver receives claim_cheque_response with result set to OK, the receiver can responds back to Cheque Sender with send_cheque_response message with result set to OK.

H: The payment operation between the Cheque Issuer (customer) and Cheque Receiver (merchant) is successfully completed and the customer is entitled to access whatever has been agreed from the merchant.

I: Some time later, when the Payment Cheque Escrow Time has elapsed and provided that Cheque Sender (customer) has not given complain to the Cheque Issuer (bank), the bank will make the money transfer according to the claim_cheque message. When the bank starts the money transfer, the bank will send a transfer_status message to the Cheque Receiver (merchant).

Message definition

Overview of protocol messages:

Method Request message Response messages Sender Receiver
POST send_cheque send_cheque_response Any Any with Money Address
POST validate_cheque validate_cheque_response Any Cheque Issuer
POST claim_cheque claim_cheque_response Any Cheque Issuer
POST collect_money collect_money_response Any Cheque Issuer
POST cheque_status cheque_status_response Cheque Issuer Any
POST get_cheque_status get_cheque_status_response Any Cheque Issuer
POST exchange_cheque exchange_cheque_response Any Cheque Issuer
GET ping ping_response Any Any with Money Address
GET trusted_banks trusted_banks_response Any Any with Money Address

 

Top