Recent Changes - Search:

Ripple Project


PmWiki

edit SideBar

AccountExtension

The Account Extension specifies common account types and the way they integrate with the basic protocol. The formal extension name for use in host-status messages is ripple-account.

Ripple External Account Type

The Ripple External account allows an existing electronic financial account between two parties to be used in the Ripple network.

Account Data Structure

The following fields/values are added to the account data structure specified in PaymentProtocol.

{
  "account": {
    "account-type": "ripple-external",
    "external-account-id": (string),
  }
}

The balance, credit limits, and other account details are stored in an underlying system by one of the parties, called the account authority, who must always act as the formal initiator of the account (ie, send the initial account-request). The account authority's Ripple host must be able to communicate with the underlying accounting system to pre-approve and commit transactions appropriately to enable Ripple payments. The exact details depend on the nature of the underlying system.

Ripple Mutual Account Type

The Ripple Mutual account provides a simple accounting system for creating a neighbour connection where no current formal account exists between node owners, or the existing account would be awkward to integrate with the Ripple core payment protocol (eg, it is not kept electronically).

Account Data Structure

The following fields/values are added to the account data structure specified in PaymentProtocol. Those fields in brackets are optional for any given account.

{
  "account": {
    "account-type": "ripple-mutual",
    "balance": (decimal)
    "initiator": {
      ("limit": (decimal))
    },
    "partner": {
      ("limit": (decimal))
    },
    "precision": (integer),
    ("interest-rate": (decimal),)
    ("agreement": (string))
  }
}

Notes:

  • balance is immutable by direct account-sets, it is a synthetic field calculated from past transactions plus interest
  • interest rate is given as a percentage per annum

Handling Interest

Interest is compounded continuously. Accumulated oustanding interest on the account is tacked on to each transaction to keep the balance up-to-date. For this purpose, there is an additional field on the receipt-redeem message:

{
  "receipt-redeem": {
    "interest": (decimal),
  }
}

This interest field indicates the amount that the amount field on the same receipt-redeem message has been adjusted by due to accumulated interest since the last transaction. It may be a positive or a negative amount. Either partner may make a dummy payment with a zero amount to the other partner in order to trigger an interest update.

Implementations must take into account leap years as having 366 days when calculating accumulated interest between transactions based on the specified annual rate. If the annual rate was changed at some point between transactions, that must also be taken into account, by applying the first rate to the period before the change, and the second rate to the period after the change.

Creative Commons Licence
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Edit - History - Print - Recent Changes - Search
Page last modified on March 16, 2007, at 10:19 PM