Skip to content

Instantly share code, notes, and snippets.

View sappenin's full-sized avatar

David Fuelling sappenin

  • RippleX
View GitHub Profile
@sappenin
sappenin / stream.asn
Created April 12, 2020 00:47
Proposed STREAM Receipt ASN.1 OER
FrameSet FRAME ::= {
{1 ConnectionError} |
{2 ConnectionNewAddress} |
{3 ConnectionMaxData} |
{4 ConnectionDataBlocked} |
{5 ConnectionMaxStreamId} |
{6 ConnectionStreamIdBlocked} |
{16 StreamClose} |
{17 StreamMoney} |
{18 StreamMaxMoney} |

Keybase proof

I hereby claim:

  • I am sappenin on github.
  • I am sappenin (https://keybase.io/sappenin) on keybase.
  • I have a public key ASBGc2tr4GbaBkYRb2nQUx0QUQ1JjxjRCDGPX2CassW5vgo

To claim this, I am signing this object:

Note: This snippet was taken from this issue #12 the Interledger project.

From Adrian:

I am trying to take a technology and architecture neutral perspective here so I have ignored some of the comments about plugins vs middle-ware approaches. I see those as implementation decisions as opposed to something that would be part of the ILP standard.

I am strongly in favour of the following changes to ILPv1 (but probably for very different reason to @emschwartz which I'll explain below).

Remove ILQP from the ILP layer

I have always maintained that quoting is not something that is required at the ILP layer so I am happy to see this being dropped. That said, I think there may still be a desire to support it between certain nodes. I.e. It should not be a requirement of every node on the network (in the same way that my home router isn't expected to implement BGP) but we shouldn't discard our work on it as some nodes (likely larger backbone connectors) may stil

@sappenin
sappenin / Interledger-QOS-Routing.md
Last active June 25, 2017 19:22
Quality of Service (QOS) in Interledger Networks

Summary

This document expands the concept of Quality of Service to Interledger payment networks, thereby allowing Interledger nodes to dynamically route payments using the best paths according to both the real-time conditions of the network as well as the characteristics of a given payment.

Background

[Dynamic](## Dynamic Routing) payment routing paths in Interledger networks can vary based upon a nearly infinite combination of characteristics including network health, liquidity, and even properties of each payment sent across the network.

Typically, Interledger payments are routed using a predefined path provided by a payment [# Quote] that is generated before a payment is actually sent. While this mechanism is adequate for many payment use-cases, this document suggests a better framework where payment senders can specify certain characteristics of their payment, and then allow the Interledger network to find the most appr

@sappenin
sappenin / InterledgerProtocolPayment Encoding.md
Last active April 24, 2017 15:32
Canonical ASN.1 OER encodings for an InterledgerProtocolPayment

This gist outlines how to encode an InterledgerProtocolPayment in binary using ASN.1 OER encoding according to the rules defined in the document Overview of OER, published by OSS Nokalva. This gist outlines two different examples of InterledgerProtocolPayment encoding.

For the formal ASN.1 OER definitions for all Interledger packets, please reference the Interledger ASN1 RFCs.

InterledgerProtocolPayment Example 1

Example 1 is an InterledgerProtocolPayment with the following data, represented as a JSON payload for readability:

{
 "type": 1,
@sappenin
sappenin / InterledgerException.java
Last active April 6, 2017 03:39
Example of InterledgerException
package org.interledger.ilp.exceptions;
import java.time.ZonedDateTime;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import org.interledger.ilp.InterledgerAddress;
import org.interledger.ilp.InterledgerAddressBuilder;
@sappenin
sappenin / ILP 2 Connector Transfer Quote
Last active June 17, 2016 20:14
ILP 2 Connector Transfer Quote
This file uses https://bramp.github.io/js-sequence-diagrams/ as a generator.
Title: ILP Quote\n2-Connector
Alice($USD)->USD_LEDGER: ($20)
USD_LEDGER->Connector1($USD): $20
Connector1($USD)->Connector1($USD): Take 1% ($0.20)
Connector1($USD)->Connector1(¥JPY): Convert $19.80 to ¥2062.96
Connector1(¥JPY)->JPY_LEDGER: (¥2062.96)
JPY_LEDGER->Connector2(¥JPY): ¥2062.96
Connector2(¥JPY)->Connector2(¥JPY): Take 1% (¥20.63)
@sappenin
sappenin / NewCounter.java
Last active November 23, 2015 23:10
Create a new instance of an Instacount client
final InstacountClientParams myClientParams = new AbstractInstacountClientParams(false) {
@Override
public String getInstacountApplicationId()
{
... // Your Instacount Application Id
}
@Override
public String getInstacountReadOnlyApplicationKey()
{
@sappenin
sappenin / Counter.java
Last active August 29, 2015 14:18
A example of a generic mechanism to transactionally commit a unit Work using Objectify with a "once-only" guarantee
package com.googlecode.objectify.idempotence.examples.counters;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
/**
* An Objectify entity for storing a simple count.
*/
@Entity
public class Counter