CoreWorkPage

Protocol.CoreWorkPage History

Hide minor edits - Show changes to output

Added line 46:
   ("field": (JSON address),)
Added lines 49-73:


'''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.
Added line 15:
Added lines 1-46:
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),
    ("message": (string))
}