The PAKET Scheme

Israel Levin
PAKET.Global
Published in
5 min readJan 3, 2019
Photo by Leone Venter on Unsplash

In this story I will describe the PAKET L1 scheme for cryptographically funding and insuring deliveries in a way that allows couriers to break them down into legs and relay them to the target.

Basic Delivery

The person who initiates the delivery is the LAUNCHER. He wants a package to be taken from its current location and delivered to the RECIPIENT. This work, the actual delivery of the package, is performed by a COURIER, for a promised PAYMENT.

So the most basic delivery works like this:

  1. The launcher locks away the promised payment in a virtual escrow
  2. The courier takes the package
  3. The courier gives the package to the recipient, who approves receiving the package by unlocking the escrow and releases the payment to the courier

Refund and Deadline

In some cases, a delivery will fail, and the launcher should receive a REFUND. For this purpose, the launcher has to set a DEADLINE by which the delivery should be completed. If the recipient does not unlock the escrow by that time, the delivery may be considered failed.

A refundable delivery looks like this:

1) The launcher locks away the promised payment in for a defined period of time
2) The courier takes the package
3.1) If the courier manages to complete the delivery before the DEADLINE then the recipient releases the payment to the courier
3.2) Otherwise, the timelock on the escrow expires and releases the payment back to the launcher as refund

Relay and Custodianship

In many cases, a courier can perform only a part of the delivery, and subcontract the rest of the delivery to another courier for a part of the payment. This is called a RELAY. Relays enable deliveries to be broken down into legs, with each leg performed by the most proficient and competitive courier. And since there can be many legs and many couriers, we have a special name for the person currently holding the package. We call this person the CUSTODIAN.

A refundable delivery with a single relay looks like this:

  1. The launcher locks away the promised payment in for a defined period of time
  2. The first courier takes the package, becoming the custodian
  3. The first courier promises an agreed part of the payment already in the escrow to the second courier
  4. The second courier takes the package, becoming the custodian

5.1. If the second courier manages to complete the delivery on time then the recipient releases the payment to the two couriers

5.2. Otherwise, the timelock on the escrow expires and releases the payment back to the launcher as refund

Important: when initiating a relay, every courier can only promise a part of whatever payment was promised specifically to him. If the first courier was promised 10 BUL, he can promise any part of it to the second courier, but if he promised the second courier 5 out of those 10 BUL, the second courier can only promise a part of those 5 BUL to the next courier.

Collateral

The package itself is often worth some money, so the courier has a clear incentive to fail the delivery, forgo the payment and keep the package for himself. The launcher, on the other hand, will often wish to insure the package, in case it is lost. The solution to both these problems is to demand a collateral from the courier(s).

A refundable insured delivery looks like this:

  1. The launcher locks away the promised payment in for a defined period of time
  2. The courier locks away the required collateral in the same escrow and under the same conditions, and takes the package

3.1) If the courier manages to complete the delivery on time then the recipient releases the payment and returns the collateral to the courier

3.2) Otherwise, the timelock on the escrow expires and releases the payment (as refund) and the collateral (as insurance) to the launcher

Collateral in Relay

As long as there are no relays, collateral and payment behave identically. They are both released from the escrow and given in full to the courier in case of a successful delivery, and to the launcher otherwise. However, as soon as relays enter the picture they behave differently. Collateral is not generally divided between the couriers. Instead, a courier that takes the package needs to cover the entire collateral, immediately and completely freeing the incumbent courier from his commitment. In other words, the scheme ensures that the person committed to the safety of the package, the person who will pay a penalty in case of a failed delivery, is always the custodian of the package.

A refundable insured delivery with a single relay looks like this:

1) The launcher locks away the promised payment in for a defined period of time

2) The first courier deposits the collateral and takes the package, becoming the custodian

3) The first courier promises an agreed part of the payment and the entire collateral (both already in the escrow) to the second courier

4) The second courier covers the first courier’s collateral, transferring him the entire amount, and takes the package, becoming the custodian

5.1) If the second courier manages to complete the delivery on time then the recipient releases the payment to the two couriers and the collateral to the second

5.2) Otherwise, the timelock on the escrow expires and releases the payment (as refund) and the collateral (as insurance) to the launcher

Notes

In some cases, the roles of the different participants can overlap. It is quite common, for example, for the recipient and the launcher to be the same person. Just think about a pizza delivery, where the launcher wants the pizza to arrive at his door because he is hungry. It is also easy to imagine a case in which the recipient is also a courier. Think about an online shop that offers 10 BUL from a courier who is willing to pick up a purchase from their warehouse and deliver it to the person who ordered it, and then that person decides that 10 BUL make it worth his time to go to the warehouse and pick up the purchase himself.

Both payment and collateral may, in some cases, get distributed over more than one financial entity. An online shop can decide to pay for part of the delivery, expecting the customer to pay for the rest. A local delivery cooperative can help its members by covering a part of their collateral.

Dive Deeper

Read the next story in which I go into the technical details of implementing all this over the Stellar distributed ledger.

--

--