Skip to content

Instantly share code, notes, and snippets.

View justmoon's full-sized avatar

Stefan Thomas justmoon

View GitHub Profile
@justmoon
justmoon / DELEGATED_CHANNELS.md
Created March 17, 2017 19:54
Delegated Channels Proposal

Delegated Channels

State of the Art

Payment Channels

Ripple currently supports Payment Channels (PayChan). This allows users to transact in small amounts without reporting each incremental change to the Ripple Consensus Ledger (RCL). Unfortunately, the current scheme has a major limitation when used with Interledger payments: Interledger payments are conditional payments, whereas Ripple Payment Channels only support unconditional transfers of value.

In practice, this means that two parties who wish to settle Interledger transactions over RCL must decide whether the PayChan claim is sent when the Interledger payment is prepared or when it is executed. The difference is that in the former case, the sender takes the risk that the receiver will not actually forward the payment, while in the latter case, the receiver takes the risk that the sender will not actually send the PayChan claim. Either way, one party can trivially defraud the other if it so cho

@justmoon
justmoon / TOPLEVEL.md
Last active February 8, 2017 09:37
Top-level ILP address prefixes

(This document is a draft.)

We define the following top-level ILP address prefixes:

  • g. for the globally routable address space defined by IL-RFC 0015
  • private. for any privately routable address space (similar to private networks in IP, e.g. 192.168.0.0/16)
  • example. for addresses appearing in examples or documentation
  • test1., test2., test3. for addresses using in testing (similar to TEST-NET-{1,2,3}; used by five-bells-integration-test)
  • local. for ledger-local addresses (similar to link-local addresses in IP, i.e. 169.254.0.0/16)
  • peer. for ledger-local addresses used in the context of a peering relationship (used by ilp-plugin-virtual)
@justmoon
justmoon / BRIEFING.md
Last active January 30, 2017 17:46
Construct 2017 Interledger Workshop Pre-Briefing

Welcome aspiring connectors!

Explanation

What is Interledger?

Interledger is a protocol for payments across different (types of) ledgers. It is inspired by the history, architecture and philosophy of the Internet Protocol.

For those of you familiar with Lightning - it's basically like Lightning across different ledgers, even different types, e.g. from PayPal to a blockchain:

@justmoon
justmoon / log.txt
Created January 29, 2017 17:45
First ever SSP payment
ilp:receiver receiver id: OGlra9cQAos +0ms
ilp-plugin-bells:plugin connecting to account https://localhost/ledger/accounts/bob +5ms
ilp-plugin-bells:plugin request ledger metadata https://localhost/ledger +49ms
ilp-plugin-bells:ledger-context using service urls: { transfer: 'https://localhost/ledger/transfers/:id',
transfer_fulfillment: 'https://localhost/ledger/transfers/:id/fulfillment',
transfer_rejection: 'https://localhost/ledger/transfers/:id/rejection',
account: 'https://localhost/ledger/accounts/:name',
auth_token: 'https://localhost/ledger/auth_token',
websocket: 'wss://localhost/ledger/websocket',
message: 'https://localhost/ledger/messages' } +31ms
@justmoon
justmoon / REWORK.md
Last active February 13, 2017 14:28
ILP Formats Rework

Interledger Protocol data format

Interledger packets are pieces of data that can be sent from one ledger user to another either as a message or attached to a transfer.

Header format

Each ILP packet consists of a series of headers. All headers start with a common eight byte preamble which looks as follows:

@justmoon
justmoon / README.md
Last active February 8, 2017 15:34
Reverse Fishchain (Message Delivery Bounty using ILP)

Evan (@emschwartz) came up with this idea we sometimes refer to as Fishchain. The idea is that you can request a packet of data by broadcasting a payment where the condition is the hash of that data.

Not sure if this new or not, but I just noticed that the Fishchain idea works not just for message retrieval bounties as stated above, but message delivery bounties as well.

Imagine A wants to deliver a message m to B, but doesn't have a direct connection. C has a way to talk to both A and B, but doesn't want to relay a message for free. Neither A nor B trust C.

A could tell C: My buddy, B, will pay you 5 cents if you deliver my message to her.

C thinks that that is a fair price, so she first gets A to sign the hash of the message H(m). She then contacts B saying that she has a message for her whose hash is H(m) and presents A's signature over H(m). B promptly creates a transfer to C using H(m) as the condition.

@justmoon
justmoon / README.md
Last active December 5, 2016 22:57
Notes on crypto-condition JSON format and API

We'd like to simplify creating complex conditions by allowing users to describe them as JSON.

const conditionDescription = {
  type: 'threshold-sha256',
  threshold: 2,
  subconditions: [{
    type: 'prefix-sha256',
    prefixUtf8: '...',
 subcondition: {
@justmoon
justmoon / README.md
Last active November 24, 2016 04:54
ILP Extra Headers Semantics and JSON Syntax

Definitions

  • Ledger

    System that records asset transfers on behalf of a set of accounts.

  • Ledger client

    System that communicates with a ledger.

@justmoon
justmoon / README.md
Last active November 24, 2018 13:01
ILP Traceroute

Use Case

We'd like to know the path that a given ILP payment took or would take.

Solution

We add a header which lets you define a IPv6 UDP address and port and a unique ID.

{
@justmoon
justmoon / README.md
Last active November 24, 2018 13:02
ILP Kit Peering Flow

User Experience

Ben would like to peer with Stefan. So he logs into his server running ILP kit and runs:

$ ilp-admin help

Usage: ilp-admin [command] ...

peer list      List my peers