TOC 
OpenTransactP. Braendgaard
Internet-DraftPicoMoney Inc
Intended status: InformationalN. Matake
Expires: July 13, 2012Cerego Japan Inc
 T. Brown
  
 D. Nicol
 TipJar
 January 10, 2012


OpenTransact Core
draft-pelle-opentransact-core-02

Abstract

This document specifies the OpenTransact standard for requesting and performing transfers of assets over the http protocol.

Status of this Memo

This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as “work in progress.”

This Internet-Draft will expire on July 13, 2012.

Copyright Notice

Copyright (c) 2012 IETF Trust and the persons identified as the document authors. All rights reserved.

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.



Table of Contents

1.  Status of Document
2.  Introduction
    2.1.  Assets
        2.1.1.  Asset Service
        2.1.2.  Transaction URL
        2.1.3.  Example of Asset Services
        2.1.4.  Derivative Assets
    2.2.  Roles
    2.3.  Transfer
    2.4.  Transfer Request
    2.5.  Transfer Authorization
    2.6.  Exchange Transaction
        2.6.1.  Exchanged item URI
        2.6.2.  Authorization
    2.7.  Vocabulary
    2.8.  Authentication
    2.9.  Parameter encoding
    2.10.  Extensions
    2.11.  Notational Conventions
3.  Transfer Request
    3.1.  Response
    3.2.  Errors
4.  Transfer Authorization
    4.1.  Validity duration
        4.1.1.  Validity Request Parameter
        4.1.2.  Validity Request Error
    4.2.  Response
    4.3.  Errors
5.  Transfer
    5.1.  Response
6.  Receipt
7.  Asset Meta data
    7.1.  Transaction history
    7.2.  Derivative assets
8.  Security Considerations
9.  Normative References
§  Authors' Addresses




 TOC 

1.  Status of Document

This document is in draft and reflects the current designs from the OpenTransact mailing list.



 TOC 

2.  Introduction

The goal is to develop a very simple low level standard for transferring an amount of an asset from one account to another.

Most payment systems and existing standards use the messaging paradigm for historical reasons. OpenTransact specifically rejects the message paradigm and prefers the RESTful (REpresentational State Transfer) resource approach as used on the web with URL’s and HTTP at it’s core.

We aim to create a new standard from scratch ignoring all legacy systems, while leaving it flexible enough to allow applications built on top of it to deal with legacy systems.

The standard is designed to follow standard RESTful practices and be concise and human readable.



 TOC 

2.1.  Assets

Within OpenTransact we use the accounting definition of the word “Asset” to mean anything fungible about which one could make an accounting book entry.

For example:



 TOC 

2.1.1.  Asset Service

An Asset Service is a service maintained by an organization to manage accounts of one asset. For money and other financial assets the Asset Service would normally be run by a Financial Service Provider of some type. Other types of assets are offered by non-financial services. The regulatory definition of “financial” is of course out of the scope of this document.



 TOC 

2.1.2.  Transaction URL

Each Asset Service has a unique transaction URL. An informal convention is developing, but is out of the cope of this document. Guidance concerning the form of these URLs with regard to specific details like currency, card type, size, color MAY become available in a future Best Current Practices document.

The service available at the transaction URL MUST follow basic REST practices:



 TOC 

2.1.3.  Example of Asset Services

Lets say it’s an imaginary electronic currency asset provider eepay.example.net they only offer one asset type, their currency. So they would only have one transaction url:

If the asset provider offered multiple currencies it should have a url for each currency as they are really separate asset types:

A bank offering OT as an alternative to ACH service could have a tranaction URL for each of the currencies in which it offers checking accounts. The details of interbank settlements are out of the scope of this document.

A mutual fund company would have a url for each of their funds.

With relaxation of current regulations on brokerage transactions all going through markets, a broker (rather, a stock market) could implement an OpenTransact API and have a different URL for each symbol.

This would ease the barrier to registered securities being used directly as money.

If we let the URL do the describing, there are many different possibilities. This allows support for all manners of asset types.

All the above examples are fungible assets. In general it is best practice that one item of value for one asset is fungible for one another.

For unique items such as domain names, property titles and diamonds that are unique and infungible, we can still create asset urls for each item, but only accept transfer amounts of 1.

All the above examples are fungible assets.

For unique items such as domain names, property titles and diamonds that are unique and infungible, we may define a separate currency for the item representing partial ownership. The legal framework for defining the resulting partnerships and their governance is out of scope of this document.



 TOC 

2.1.4.  Derivative Assets

A Derivative asset is an asset that is based on the current asset but provides different semantics and business rules.

Examples:

It is out of scope to define here exactly how these would work, but the OpenTransact community will build a list of recipes for how to implement these and may publish further drafts outlining specifics in the future.



 TOC 

2.2.  Roles

OpenTransact defines 4 roles:



 TOC 

2.3.  Transfer

We will use the term “Transfer” as it is more widely applicable than “Payment”.

A Transfer is legally a transfer in ownership of some amount of the Asset from the Transferer to the Transferee.

Eg. A Payment of $12 from Bob to Alice is a Transfer of $12 with Bob being the Transferer and Alice the Transferee.



 TOC 

2.4.  Transfer Request

A Transfer request is when the Transferee requests a transfer of a given amount of an asset from the Transferer.

Eg. Alice sends an invoice to Bob for $12. This is a Transfer Request from Alice to Bob where Alice is the Transferee and Bob the Transferer.

A Transfer Request is simply a specially formatted payment link that takes Bob to Asset Service if followed. The Asset Service shall present the Transfer Request to Bob who can authorize or decline it.



 TOC 

2.5.  Transfer Authorization

A Transfer Authorization is when the Transferee or a third party application requests an authorization to transfer of a given amount of an asset from the Transferer.

Eg. Bob wants to hire someone on an online job board to edit a document for $33. The Job Board creates a Transfer Authorization link. Bob follows this link to the Asset Service and authorizes the Job Board to transfer $33 from his account to some one else within a time period.

A Transfer Request is simply a specially formatted payment link that takes Bob to Asset Service if followed. The Asset Service shall present the Transfer Request to Bob who can authorize or decline it. If Bob authorizes it the Asset Service issues an authorization code to the Job Board that they can use to exchange for an OAuth token.



 TOC 

2.6.  Exchange Transaction

A Transfer is often but not always part of an exchange of value between 2 types of assets. Eg.:

There are as many different exchange mechanisms for creating exchanges as there are exchange types.

It is outside the scope for OpenTransact to define every single type of exchange that is possible. OpenTransact provides a fundamental building block in building such systems. It integrates well with exchange systems that don’t yet understand OpenTransact.



 TOC 

2.6.1.  Exchanged item URI

In an Exchange Transaction we can include a url to the exchanged item. This URI could either be a link to the exchanged item itself or the unique URI identifying the transaction itself.



 TOC 

2.6.2.  Authorization

A useful building block for creating Exchange services is the Transfer Authorization flow.



 TOC 

2.7.  Vocabulary

OpenTransact includes a standard list parameter names used in the GET and POST requests.

They are designed to be small and semantically correct. eg

A transfer of 10 USD from Bob to Alice for consulting.

Would become the following:



 TOC 

2.8.  Authentication

OpenTransact does not define any new authentication mechanisms, but relies on the Asset Provider’s existing mechanisms for authenticating the Transferer and OAuth 2.0 [I‑D.ietf‑oauth‑v2‑bearer] (Jones, M., Hardt, D., and D. Recordon, “The OAuth 2.0 Authorization Protocol: Bearer Tokens,” December 2011.) for authenticating 3rd party applications on behalf of the Transferer.



 TOC 

2.9.  Parameter encoding

Since OpenTransact is designed to be simple to implement, the basic parameter encoding is URL form encoding.

Data responses should be in JSON format.

OpenTransact includes a standard for name strings and value ranges for use with the JSON objects returned from a request made to a compliant OT transaction URL.



 TOC 

2.10.  Extensions

OpenTransact is designed to be extensible, either through proprietary extensions, conventions or futher standards.

For example it may be useful to follow the lat/lon convention allowing geotagging of data.



 TOC 

2.11.  Notational Conventions

The key words ‘MUST’, ‘MUST NOT’, ‘REQUIRED’, ‘SHALL’, ‘SHALL NOT’, ‘SHOULD’, ‘SHOULD NOT’, ‘RECOMMENDED’, ‘MAY’, and ‘OPTIONAL’ in this specification are to be interpreted as described in [RFC2119] (Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” March 1997.).

This specification uses the Augmented Backus-Naur Form (ABNF) notation of [RFC5234] (Crocker, D. and P. Overell, “Augmented BNF for Syntax Specifications: ABNF,” January 2008.).

Certain security-related terms are to be understood in the sense defined in [RFC4949] (Shirey, R., “Internet Security Glossary, Version 2,” August 2007.). These terms include, but are not limited to, ‘attack’, ‘authentication’, ‘authorization’, ‘certificate’, ‘confidentiality’, ‘credential’, ‘encryption’, ‘identity’, ‘sign’, ‘signature’, ‘trust’, ‘validate’, and ‘verify’.

Unless otherwise noted, all the protocol parameter names and values are case sensitive.



 TOC 

3.  Transfer Request

A Transfer Request consists of a GET to the Asset URL.



GET /usd?to=bill@example.com&amount=100.00&note=Milk&redirect_uri=http://site.example.com/callback HTTP/1.1
Host: pay.me
 Figure 1 

We use the following parameters from our common vocabulary. All fields are optional:

When a user follows this link, the Asset Service should present the user with a form authorizing the payment.

Note: Client can include OpenID Connect parameters.



 TOC 

3.1.  Response

The user is redirected back to the clients redirect uri with the following url encoded parameters:

Asset provider can include an access_token in the query string of txn_url.



 TOC 

3.2.  Errors

Error types use OAuth 2.0’s error codes. [I‑D.ietf‑oauth‑v2] (Hammer-Lahav, E., Recordon, D., and D. Hardt, “The OAuth 2.0 Authorization Protocol,” September 2011.)



 TOC 

4.  Transfer Authorization

A Transfer Authorization consists of a GET to the Asset URL with a client_id.



GET /usd?to=bill@example.com&amount=100.00&note=Milk&redirect_uri=http://site.example.com/callback&client_id=1234 HTTP/1.1
Host: pay.me
 Figure 2 

A Transfer Authorization is really a OAuth2 Authorization [I‑D.ietf‑oauth‑v2] (Hammer-Lahav, E., Recordon, D., and D. Hardt, “The OAuth 2.0 Authorization Protocol,” September 2011.) with a few extra payment related parameters.

We use the following parameters from our common vocabulary. All fields are optional:

OAuth2 related parameters. See [I‑D.ietf‑oauth‑v2] (Hammer-Lahav, E., Recordon, D., and D. Hardt, “The OAuth 2.0 Authorization Protocol,” September 2011.) section 5 for full details

When a user follows this link, the Asset Service should present the user with a form authorizing the payment.

Note: Client can include OpenID Connect parameters.



 TOC 

4.1.  Validity duration

A client can request a specific validity length of the oauth token.

The asset provider will assign a default expiration of the token if client doesn’t specify a validity.

A validity can be request which is either a fixed duration or a repeating interval.

For a fixed interval the amount SHOULD be guaranteed and reserved for the client.

For a repeating interval the amount SHOULD be guaranteed for the first interval only.



 TOC 

4.1.1.  Validity Request Parameter

The validity is requested using A ISO8601 duration, interval or repeating interval.

A duration is written



P30D                      # 30 days
PT5M                     # 5 minutes
P1M14DT3H5M23S # 1 month 14 days 3 hours 5 minutes and 23 seconds
 Figure 3 

Intervals are either 2 ISO Dates or an ISO date and a duration separated by the ‘/’ character:



2007-03-01T13:00:00Z/2008-05-11T15:30:00Z # The interval between 2 dates
2007-03-01T13:00:00Z/P1Y2M10DT2H30M     # The interval starting at a date and finishing after a duration
P1Y2M10DT2H30M/2008-05-11T15:30:00Z     # The interval starting with a duration and finishing at a given date
P1M                                                             # The duration starting at the time the token was authorized.
 Figure 4 

Repeating intervals by prefix one of the above intervals or durations with the letter ‘R’ and an optional number specifying the amount of times to repeat:



RP1M                     # repeat once a month
R12P1M                 # repeat 12 times once a month
RP1M/2008-05-11T15:30:00Z  # repeat monthly until a given date
 Figure 5 

By supporting a single parameter with any of the above durations/intervals/repeated intervals we can support a lot of different kinds of applications:



 TOC 

4.1.2.  Validity Request Error

If a specified interval is not supported by service or user refuses to authorize the interval an OAuth2.0 Authorization error response MUST be returned through redirection with the following error:

error=unsupported_interval



 TOC 

4.2.  Response

Follows OAuth 2 response depending on response_type requested. [I‑D.ietf‑oauth‑v2] (Hammer-Lahav, E., Recordon, D., and D. Hardt, “The OAuth 2.0 Authorization Protocol,” September 2011.)



 TOC 

4.3.  Errors

Error types use OAuth 2.0’s error codes. [I‑D.ietf‑oauth‑v2] (Hammer-Lahav, E., Recordon, D., and D. Hardt, “The OAuth 2.0 Authorization Protocol,” September 2011.)



 TOC 

5.  Transfer

A transfer consists of a HTTP POST to the asset url by a 3rd party application on behalf of the Transferer.

The Application MUST have an OAuth 2.0 access token issued as defined in the [I‑D.ietf‑oauth‑v2] (Hammer-Lahav, E., Recordon, D., and D. Hardt, “The OAuth 2.0 Authorization Protocol,” September 2011.) section 7.

The asset provider SHOULD support the [I‑D.ietf‑oauth‑v2‑bearer] (Jones, M., Hardt, D., and D. Recordon, “The OAuth 2.0 Authorization Protocol: Bearer Tokens,” December 2011.) Access Token type and can support other access token such as [I‑D.ietf‑oauth‑v2‑http‑mac] (Hammer-Lahav, E., Barth, A., and B. Adida, “HTTP Authentication: MAC Access Authentication,” May 2011.).

The Transfer MUST be created using HTTPS when using [I‑D.ietf‑oauth‑v2‑bearer] (Jones, M., Hardt, D., and D. Recordon, “The OAuth 2.0 Authorization Protocol: Bearer Tokens,” December 2011.) and other unsigned access tokens.



POST /usd HTTP/1.1
Host: pay.me
Authorization: Bearer vF9dft4qmT

to=bill@example.com&amount=100.00&note=Milk
 Figure 6 

We use the following parameters from our common vocabulary in 1.6. All fields are optional:



 TOC 

5.1.  Response

http 201 with Receipt json.



 TOC 

6.  Receipt

The receipt is returned when creating a transaction as well as when accessing a transaction url. It can also be used for creating a transaction list by the asset provider.

The receipt is a JSON object consisting of the following fields:



 TOC 

7.  Asset Meta data

A client can find out information about an asset by accessing the asset url directly with a http Accept header of application/json:



GET /usd HTTP/1.1
Host: pay.me
Accept: application/json
 Figure 7 

This returns a json hash of meta information about the asset.

The minimum required data would be:

The minimal asset meta data is:



{
  "name":"Pay Me"
}
 Figure 8 

Further OpenTransact specific parameters could be:

Example:



{
  "name":"Pay Me",
  "default_amount":1.0,
  "provider_uri":"http://pay.sample.com",
  "logo_uri":"http://pay.sample.com/logo.png",
  "unit":"USD",
  "derivatives": [
    {"reserve":"http:/pay.sample.com/reserves"},
    {"subscription":"http:/pay.sample.com/subscriptions"},
    {"exchange":"http:/pay.sample.com/exchange"}
  ]
}
 Figure 9 

Asset services can provide further information more specific to their particular asset type.

If an OAuth Access Token is provided the Asset Service should provide information related to the capabilities of the token.

For tokens obtained through a Transfer Authentication this should reflect the remaining balance of the authorized amount.



 TOC 

7.1.  Transaction history

If tokens scope allows access to accounts transaction history a url to the transaction history or a transaction history SHOULD be included here:



 TOC 

7.2.  Derivative assets

If an asset has derivative assets they SHOULD be listed in the optional derivatives list:



{
  "name": "Pay Me",
  "derivatives": [
    {"reserve":"http:/pay.sample.com/reserves"},
    {"subscription":"http:/pay.sample.com/subscriptions"},
    {"exchange":"http:/pay.sample.com/exchange"}
  ]
}
 Figure 10 

The OpenTransact group will maintain a list of recipes that may be further standardized.



 TOC 

8.  Security Considerations

The security of OpenTransact is achieved by it’s use of [I‑D.ietf‑oauth‑v2] (Hammer-Lahav, E., Recordon, D., and D. Hardt, “The OAuth 2.0 Authorization Protocol,” September 2011.). Please see its security discussion and a more thorough discussion in [I‑D.ietf‑oauth‑v2‑threatmodel] (Lodderstedt, T., McGloin, M., and P. Hunt, “OAuth 2.0 Threat Model and Security Considerations,” October 2011.).



 TOC 

9. Normative References

[I-D.ietf-oauth-v2] Hammer-Lahav, E., Recordon, D., and D. Hardt, “The OAuth 2.0 Authorization Protocol,” draft-ietf-oauth-v2-22 (work in progress), September 2011 (TXT, PDF).
[I-D.ietf-oauth-v2-bearer] Jones, M., Hardt, D., and D. Recordon, “The OAuth 2.0 Authorization Protocol: Bearer Tokens,” draft-ietf-oauth-v2-bearer-15 (work in progress), December 2011 (TXT, PDF).
[I-D.ietf-oauth-v2-http-mac] Hammer-Lahav, E., Barth, A., and B. Adida, “HTTP Authentication: MAC Access Authentication,” draft-ietf-oauth-v2-http-mac-00 (work in progress), May 2011 (TXT, PDF).
[I-D.ietf-oauth-v2-threatmodel] Lodderstedt, T., McGloin, M., and P. Hunt, “OAuth 2.0 Threat Model and Security Considerations,” draft-ietf-oauth-v2-threatmodel-01 (work in progress), October 2011 (TXT).
[ISO.8601.1988] International Organization for Standardization, “Data elements and interchange formats - Information interchange - Representation of dates and times,” ISO Standard 8601, June 1988.


 TOC 

Authors' Addresses

  Pelle Braendgaard
  PicoMoney Inc
Email:  pelle@picomoney.com
  
  Nov Matake
  Cerego Japan Inc
Email:  nov@matake.jp
  
  Tom Brown
Email:  herestomwiththeweather@gmail.com
  
  David Nicol
  TipJar
Email:  davidnicol@gmail.com