Skip to content

Instantly share code, notes, and snippets.

@justmoon
Last active December 15, 2017 17:18
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 justmoon/1737d41f49c4f33e9de3f5a2408d0469 to your computer and use it in GitHub Desktop.
Save justmoon/1737d41f49c4f33e9de3f5a2408d0469 to your computer and use it in GitHub Desktop.
Interledger Dynamic Configuration Protocol (IL-DCP) Draft

Interledger Dynamic Configuration Protocol (IL-DCP)

Client sends a transfer to the host:

{
  amount: '0',
  executionCondition: '[SHA256(32 zero bytes)]',
  expiresAt: '[Five second timeout]',
  ilp: {
    account: 'peer.config',
    data: '[ConfigurationRequest]'
  }
}

The ConfigurationRequest is simply an empty buffer. The host should ignore any bytes in this buffer.

The host will:

  • Notice the ILP address is 'peer.config' and treat the packet as a dynamic configuration request (IL-DCP request)
  • Verify that it is a host (two clients may end up querying one another), otherwise reject with error type = 1
  • Verify the amount is zero, otherwise reject with error type = 0
  • Verify that the condition matches [SHA256(0)], otherwise reject with error type = 0
  • Assign a name to the client (or determine the client's name based on authentication information)
  • Fulfill the transfer with a ConfigurationFulfillment
IMPORTS
    Address,
    AddressCharset
    FROM InterledgerTypes
;

ConfigurationRequest ::= SEQUENCE {
  -- empty
}

ConfigurationFulfillment ::= SEQUENCE {
  -- Client's ILP address
  clientAddress Address
}

ConfigurationRejection ::= SEQUENCE {
  -- Error type
  type UInt8
}

Error types

  • 0 .. Invalid request
  • 1 .. I am not a host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment