Signed Message
{
"signed": {
(Ripple message)
},
"signatures": [
{
"hash": ("sha1" | "md5"),
"sign": ("rsa" | "dsa" | "elgamal"),
"signature": (base64)
}
]
}
Hash all characters between the signed-message curly braces. Sign the hash.
Public Key Data Structures
{
"dsa-key": {
("p": (base64),)
("q": (base64),)
"g: (base64),
"y: (base64),
"j: (base64),
("seed": (base64),)
("p-gen-counter": (base64),)
}
}
{
"rsa-key": {
"modulus": (base64),
"exponent": (base64),
}
}
Error
{
"type": "error",
"code": (string),
("field": (JSON address),)
("message": (string))
}
JSON Addressing
JSON addressing works like unix filesystem paths. Take the following piece of JSON:
{
"a": 1,
"b": 2,
"c": {"d": 4,"e": 5,"f":"d"},
"g": [6, 7, 8],
}
Maps (dictionaries) are easy to address -- use the key name. Array sequences (lists) are trickier. The array element at position n (first position is 0) is addressed by "[n]". A wildcard "[*]" indicates any array position.
So
/"a" is 1
/"c"/"e" is 5
/"g"/[1] is 7
/"g"/[*] may be any of 6, 7, or 8
Paths may be relative to the path of an element as well, meaning that the value "d" at /"c"/"f" may be interpreted as pointing to /"c"/"d" with is 5. (Only if you're expecting a JSON path at /"c"/"f" though, otherwise it's just the string "d" of course.)
Note that the quotations around path elements need to be escaped in JSON strings.