Less Technical
Implementation
Old Stuff
Older Stuff
Oldest Stuff |
Protocol /
CoreRipple Core ProtocolThe following is common to all Ripple subprotocols. MessagingThe Ripple network consists of software agents called nodes connected together pairwise where one or both accept the other's obligations as valuable. These abstract connections are manifested over messaging connections between hosts, each of which may host multiple nodes. A message transport layer must distinguish between three message types: Replies and errors may carry any data that a regular message may carry. In addition, error messages must carry an error code. In general, nodes need not wait for the reply or error to send another message. Ripple messages carried within the transport layer are in JSON textual format. For example:
{
"type": "account-request",
"from": "rfugger@ripplepay.com",
"to": "otheruser@otherhost.com:2338",
("request-id": (integer),)
("time": "2007-03-30 14:10:03.112000",)
("body": (message body goes here))
}
The indentation and line breaks are for readability in this document only. The actual messages themselves do not have significant whitespace other than described in the JSON specification. The The Host MessagesCertain messages are sent to a host, rather than to an individual node on a host. The timestamp put on a Ripple message by the sending host is interpreted by the receiving host as the time the corresponding event occurred, so it is important that:
To allow two hosts to verify these two conditions at the beginning of a connection, and at any other time there is uncertainty (such as a long delay between timestamped messages), they may use a
{
"type": "time",
(request-id: 24223,)
"time": "2007-03-30 14:10:03.112000"
}
To request a
{
"type": "time-request",
"request-id": (4485093)
}
The host receiving a Ping may also be used to detect network latency. Ripple hosts should accept pings. This section presumes both hosts are making every effort to be honest about their timekeeping. Cheating is addressed elsewhere. Timekeeping issues such as clock differences between hosts, network latency, and cheating may be addressed in the future by allowing hosts to negotiate a third-party timestamping authority as an intermediary for their Ripple messaging. At any time they are connected, a host may request another for the status of its protocol support by sending a
{
"type": "host-status-request"
}
The host receiving such a message must reply immediately with a
{
"type": "host-status",
"body": [
{
"version": "1",
"subprotocols": [
"ripple-payment",
"ripple-routing",
"ripple-channel",
"ripple-account",
]
}
]
}
TransportHost Connections Ripple hosts connect to each other by TCP. (Need to specify a standard port for hosts to listen on.) TCP connections are meant to be persistent, but may be closed by either host at any time. Hosts may open multiple connections with each other. Connection Security After Node Identification Nodes are identified in standard node@host.com email-address style. For nonstandard ports, use node@host.com:xxxx, where xxxx is the port the host is listening on for Ripple connections. Host Messages Host messages are sent in BEEP-style frames as follows: (type) (version) (msgno) (more) (size)(CRLF) (content) END(CRLF) where (type) = MSG | RPY | ERR (version) = (string) (msgno) = 0..2147483647 (more) = . | * (size) = (integer) Message types The The If
Channels from the BEEP specification are omitted because Ripple interleaving message frames seems to accomplish much the same thing. The Errors If a received frame is not in the correct format, the association must be immediately closed. |