PaymentWorkPage

Todo

  • Rename this subprotocol to "transaction"
  • message signing
  • public key data structure
  • certificate data structure
  • routing onion data structure
  • releasing promises
  • collecting on penalties
  • delays/disputes
  • third-party timestamp/relay/verifiers - how can they deliver?
  • partial receipts/max receipt amount field
  • fees (flat fees possible by intermediary altering path-amount?)
  • max-fees limit on promise (requires specifying known path-units)
  • define valid receipt
  • error messages
  • flesh out finalizing payment
  • handle rounding

Payment Completion

Maybe the payment shouldn't be complete until the signed receipt makes it back to the payer, at which point he has "proof of payment"? That gives the payer motivation to pay to get the receipt, and maybe makes deadlines not so much of an issue.


Ripple Payment Protocol Messages

Account Data Structure

{

    "payment-account": {
        "account-id": (string),
        "unit": (URI),
        "initiator": {
            "node-id": (Ripple ID),
            "key": (public key data structure)
        },
        "partner": {
            "node-id": (Ripple ID),
            "key": (public key data structure)
        },
    }

}

Account Request

{

    "type": "payment-account-request",
    "to": (string),
    "from": (string),
    "request-id": (integer),
    "body": {
        "payment-account": {
            "account-id": (string),
            (remaining account data structure containing requested field values)
        },
        "note": (string)
    }

}

Account Set

{

    "type": "payment-account-set",
    "to": (string),
    "from": (string),
    "request-id": (integer - only present on responses to account-requests),
    "time": (date/time string),
    "body": {
        "payment-account": {
            "account-id": (string),
            (remaining account data structure containing requested field values)
        },
    }

}

Account Close

{

    "type": "payment-account-close",
    "to": (string),
    "from": (string),
    "request-id": (integer),
    "body": {
        "account-id": (string)
    }

}


Payment Request

{

    "type": "payment-request",
    "to": (string),
    "from": (string),
    "body": {
        "payment-id": (string),
        "amount": (decimal),
        "unit": (URI),
        "note": (string)
    }

}

Payment Init

{

    "type": "payment-init",
    "to": (string),
    "from": (string),
    "body": {
        "payment-id": (string),
        "amount": (decimal),
        "units": (URI),
        "note": (string)
    }

}

Payment Accept

{

    "type": "payment-accept",
    "to": (string),
    "from": (string),
    "body": {
        "payment-init": {
            (copy of payment init message)   
        }
        "recipient-receipt-key": (public key data structure),
        "recipient-certificate": (certificate data structure)
    }

}

Promise

{

    "type": "promise",
    "to": (string),
    "from": (string),
    "time": (date/time),
    "body": {
        "payment-id": (string),
        "path-id": [(ordered list of strings)],
        "path-amount": (decimal),
        ("path-units": (URI),)
        "account-id": (string),
        "amount": (decimal),
        ("onion": (routing onion data structure),)
        "ttl": (date/time string),
        ("penalty-deadline": (date/time string),)
        ("penalty-rate": (decimal),)
        "deadline": (date/time string),
        ("max-receipt": (decimal),)
        "payer-receipt-key": (public key data structure),
        "recipient-receipt-key": (public key data structure),
        "timestamp": (date/time string)
    }

}

Routing Onion Data Structure

{

    "encryption-method": ("none" | "rsa" | "dsa")
    ("key-id": (string),)
    "blob": (encrypted routing blob data structure)

}

Routing Blob Data Structure

{

    (arbitrary data),
    "onion": (inner layers of onion)

}

Promise Received

{

    "type": "promise-received",
    "to": (string),
    "from": (string),
    "time": (date/time),
    "body": {
        "payment-id": (string),
        "path-id": [(ordered list of strings)],
        "deadline": (date/time string),
        "amount": (decimal),
        ("max-receipt": (decimal))
    }

}

Receipt

{

    "receipt": {
        "payment-id": (string),
        "path-id": [(ordered list of strings)],
        "path-amount": (decimal)
    }

}

Receipt Redeem

{

    "type": "receipt-redeem",
    "to": (string),
    "from": (string),
    "body": {
        "account-id": (string),
        "amount": (decimal),
        "signed": {
            (receipt)
        },
        "signatures": [
            (...)
        ]
    }

}

Promise Release

{

    "type": "promise-release",
    "to": (string),
    "from": (string),
    "time": (date/time),
    "body": {
        "payment-id": (string),
        "path-id": (string),
        "path-amount": (decimal),
        "amount": (decimal),
    }

}