Skip to content

Instantly share code, notes, and snippets.

@emschwartz
Last active January 17, 2017 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emschwartz/63ce41a05ec6de02837d8658a8644ad3 to your computer and use it in GitHub Desktop.
Save emschwartz/63ce41a05ec6de02837d8658a8644ad3 to your computer and use it in GitHub Desktop.
ILP Foundations Discussion

This is a brief summary of some ongoing discussions about fundamental Interledger topics: the packet format, the addressing scheme, and the protocol layer built directly upon ILP. Ideas are welcome!

Packet

Full discussion: Proposal: we need an Interledger Packet -- not just an ILP Header

Questions

  1. Should the packet be:
  • JSON
  • Binary (CBOR, OER, Protobuf, or custom)
  • JSON for now and binary later when we are more concerned with performance
  • Only defined semantically, leaving encoding on the wire up to ledger plugins
  1. Should we define a canonical encoding of the packet? Some higher-level protocols will hash the details in the packet. Should they define their own canonical representation?
  2. Should the packet be comprised of the ILP details and an array of additional headers, or should all the headers, including the ILP header, be in one array?
  3. Should we separate headers for end-to-end protocols from routing-related ones?
  4. Should we support multihoming at the Interledger layer?

Address

Full discussion: How do we address small ledgers/currencies?

Specification

  • ILP specifies that addresses must match the regex ^[a-zA-Z0-9._~-]+$
  • None of the characters technically have special meaning
  • There is no requirement or guarantee that addresses are globally unique
  • One account may have multilple addresses

Convention

  • The address convention we are recommending to start is for addresses to be structured as: neighborhood.subneighborhoods.ledgergroup.ledger.account.subledger.subsubledger
  • “Neighborhoods” are arbitrary groupings by currency, geography, community, etc.
  • Addresses should be chosen such that connectors in the given neighborhood will have routes to the subneighborhood, and so on
  • Ledger addresses or prefixes should end in a period
  • Ledger addresses should not contain the full address of another ledger. To use a ledger as a routing landmark, its prefix should include a “ledger group” before the ledger part
  • “Subledgers” must have a 1-to-1 rate with the ledger they are under
  • Given an address, there is no way to determine what each of the segments represent
  • Ledger plugins must define a separator so they can extract the account from the part of the address following the ledger prefix (i.e. distinguish account from subledgers)

Connector Behavior:

  • Connectors use local routing tables and prefix matching to handle payments and quotes
  • Connectors answer quotes with local data if they know the rate to the destination ledger
  • Connectors request quotes from other connectors if they do not know the full path’s rate
  • Connectors relay payments through other connectors if their ledger prefix does not appear in the destination address
  • Connectors deliver the exact amount specified in the ILP header if their ledger prefix appears in the destination address

Transport Layer

Full discussion: Proposal: Our transport layers deal with condition generation, memo encryption, ...

Interledger Transport Layer protocols may provide / define

  • Details required for payment setup
  • Payment and data integrity
  • Automatic payment retry logic
  • Single or streams of payments
  • Non-repudiability
  • Stateful or stateless receivers

It seems like a good practice for Transport protocols to use an HMAC of some of the ILP packet details to generate the condition/fulfillment. They differ on whether the sender or receiver generates the HMAC key, and how the receiver fulfills the transfer once it is prepared.

Initial ideas for Transport Protocols

  • Payment Request Protocol
  • Encrypted Key Protocol
  • Split Request Protocol
  • Split Payment Protocol
  • Nested/Repeated Request Protocol
@justmoon
Copy link

Connector Behavior

Could add a bullet here that routing tables can contain a route for the empty prefix, also called a "default route".

Copy link

ghost commented Jan 17, 2017

Not sure if this is the right place but I think "expires at" field should have be defined/restricted as an utc time (I have only found the definition of the format).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment