Less Technical
Implementation
Old Stuff
Older Stuff
Oldest Stuff |
Protocol /
AccountSubprotocol name: Account CoreRipple nodes may connect when one or both accept the other's obligations as valuable. Connected nodes are said to be neighbours. A neighbour connection is a relationship defined by an agreement to participate in Ripple transactions as neighbours, and does not refer to the messaging connection that may exist from time to time between the neighbouring nodes' hosts, and over which the neighbour relationship takes place. The Ripple Payment Protocol involves nodes issuing and accepting obligations of a certain value to and from their neighbours, but doesn't specify how these obligations are recorded or what the terms or limits of these obligations are. Neighbours must agree on an accounting system that will approve potential transactions and record the balance of committed transactions between them. One such system is the Ripple Account Protocol. A neighbour connection consists of nothing other than one or more accounts between the neighbours. The minimal set of data that must be known by two neighbouring nodes in order to participate in Ripple payments is:
The JSON data structure for these core account fields is:
{
"account": {
"account-id": (string),
"account-type": (string),
"unit": (URI),
"initiator": {
"node-id": (Ripple ID),
"key": (public key data structure)
},
"partner": {
"node-id": (Ripple ID),
"key": (public key data structure)
},
}
}
The roles of Account types are described below. Different account types will have various other fields in addition to the core fields listed above. There are two primary account messages: An
{
"type": "account-request",
"to": (string),
"from": (string),
"request-id": (integer),
"body": {
"account": {
"account-id": (string),
(remaining account data structure containing requested field values)
},
("note": (string))
}
}
To avoid overlap, the The An
{
"type": "account-set",
"to": (string),
"from": (string),
("request-id": (integer),)
"time": (date/time string),
"body": {
"account": {
"account-id": (string),
(remaining account data structure containing requested field values)
},
}
}
The The timestamp establishes the exact time the changes to the account fields take effect. Account messages, other than at account-creation time, should only alter one account field at a time unless two or more fields must be altered in atomic fashion. Accounts are established by a signed
Example:
{
"type": "account-request",
"to": "random",
"from": "rfugger",
"request-id": 1,
"time": "2007-04-01 15:53:41.537449",
"body": {
"account": {
"account-id": "550e8400-e29b-41d4-a716-446655440000",
"unit": "urn:ripple:units:CAD",
"external-id": "120489",
"initiator": {
"node-id": "rfugger@ripplepay.com",
"key": (...),
},
"partner": {
"node-id": "random@example.com",
}
},
"note": "Let's have an account!"
}
}
An affirmative reply means the offer has been understood being held for consideration. If the offer recipient accepts the offer, his node sends back an To indicate that the account has been created, the node receiving the Identification of Account Partner Ripple has no universal mechanism for positively identifying the owner of another node. The owner of a node receiving a new account request should confirm the identity of the owner of the requesting node before assigning it a non-zero credit limit. Even if the node ID in the form node@host.com of the requesting node is familiar to the request recipient, one must ensure that the transport layer has verified positively by some means that the request actually comes from the correct host and that the host is trustworthy before relying solely on that piece of information. The requesting node's owner may put secret, personal, or other information that could help the receiving node's owner identify them, such as a message signed with a personal signing key, into the To declare a change to one or more account data fields, a node sends a signed To request a change to one or more account data fields, a node sends an Once the request is approved, the request recipient sends an The following errors allow nodes to negotiate between them what are permissible unilateral changes and what aren't in case of disagreement:
To add a new data field to an account, use An account message declaring or requesting a key change should be signed by the old key. Subsequent signed messages must be signed by the new key. To request a copy of an account partner's account data for verification, send an Example:
{
"account-verify-request": {
"account-id": "550e8400-e29b-41d4-a716-446655440000"
}
}
The immediate reply must contain the complete account data structure of the node receiving the Example:
{
"account-verify": {
"timestamp": "2006-11-07 02:11:28.401000",
"account": {
(...)
}
}
}
Neither message nor reply must be signed. To request from an account partner a list of every signed message that has changed the value of an account field over a certain period, send an Example:
{
"account-history-request": {
"starting": "2006-01-01 00:00:00.000000",
"ending": "2006-11-07 02:11:28.401000"
}
}
If the "starting" field is omitted, messages from beginning of the account should be included in the reply. If the "ending" field is omitted, messages up to the present should be included. The reply is as follows:
{
"account-history": [
(a chronological order of signed messages sent and received over
this account during the requested period that have changed a piece
of shared account data, in the format they were originally sent or
received, including signatures)
]
}
This account history may be used as an audit to find the source of any data discrepancies between partners. This same output may also be taken for each account by a node owner from her own node in order to backup account data or move a node to a different host. To close an account, either party may send an Example:
{
"account-close": {
"request-id": 14590,
"account-id": "550e8400-e29b-41d4-a716-446655440000"
}
}
An affirmative reply indicates assent to close the account. An error indicates refusal. Account TypesRipple Mutual Credit AccountRipple mutual credit accounts are electronically-kept accounts between two Ripple nodes. Both nodes keep a copy of the account data, and both share responsibility for maintaining it. Account Data Structure
{
"account": {
"account-id": (string),
"account-type": "ripple-mutual",
"unit": (URI),
"balance": (decimal),
"initiator": {
"node-id": (Ripple ID),
"key": (public key data structure),
("limit": (decimal))
},
"partner": {
"node-id": (Ripple ID),
"key": (public key data structure)
("limit": (decimal))
},
"precision": (integer),
"interest-rate": (decimal),
"last-interest": (date/time),
"agreement": (string)
}
}
Nodes may directly set their own keys and reduce their own limits using
{
"type": "account-entry",
"to": (string),
"from": (string),
"time": (date/time),
"body": {
"account-id": (string),
"entry-id": (decimal),
"amount": (decimal),
("interest": (decimal),)
}
}
An External AccountExtra field: Example: bank account, where one partner (the bank) handles all the accounting in a pre-existing external mechanism. i-WAT AccountKeys are i-WAT keys, Ripple transactions are completed using i-WAT value transfers. |