In a mutual credit network, how would you program an automatic jubilee?

A little explanation might be needed. I mean mutual credit the way that it’s defined here:

a type of alternative currency in which the currency used in a transaction can be created at the time of the transaction

Imagine you have a network of accounts. Each starts out at zero and any account can extend a limited line of credit to any other account. My total balance would just be the sum of what others “owe” to me, minus the sum of what I owe to others.

Lines of credit can be represented with a simple table. In pseudo-code for some kind of ORM:

type LineOfCredit struct {
    IOURecipient  string, // Account ID of IOU recipient
    IOUIssuer     string, // Account ID of IOU issuer
    Owed          int,    // Amount owed to IOU recipient
    Limit         int,    // Maximum IOU amount
}

To hopefully make the concept clearer: The “recipient” would generally be the person getting “paid” in a transaction; the “issuer” is the person “paying.” For example:

  • Persons A requests service from person B
  • B agrees and extends a line of credit to A
  • A issues IOU to B

These debts may or may not be settled in some real-world currency, at some point, but the idea is that they eventually cancel out one another, either directly or indirectly.

I’ll use “$” to represent the currency, though, of course, the units are arbitrary. Imagine that…

  • Bob owes $20 to Sally
  • Sally owes $20 to Joe
  • Joe owes $20 to Bob

It’s clear that there’s no actual debt here and they don’t owe one another anything.

So, how would you detect these kinds of cycles in a balance sheet and then eliminate them? Is this a problem for graph theory? I imagine this can be represented as a directed network graph. My knowledge here is very limited, but I understand it’s possible to detect cycles with Tarjan’s strongly connected components algorithm, though that doesn’t seem to offer much help, especially as those cycles get larger. I also thought that, maybe, shortest-paths could be crunched at the time of a transaction, with the reciprocals of outstanding “debts” represented as edge-weights/distances.

I think Ripple pay possibly did something like this, but I’m having trouble finding a precedent.

1

The IOU trio you gave as an example, who are balancing each other out, down to zero debt when taken as a whole, evokes the typical counter-example of a (pathological) isolated cycle that defeats reference counting used in memory allocators: the mere existence of a (directed) reference between one node and another prevents those to be deallocated; because each having a use count greater than zero (1).

A classic, common way to garbage-collect such cycles nonetheless (to overcome the limitations of naive reference counting) is by a two-phase “mark-and-sweep” procedure: first, you mark all the nodes as being “dead”. Then, from some root node (say, Jack), you recursively follow all the references, using a hop-by-hop from one node to another, and unmark (“revive”) the nodes thus-reached after each hop, until all the references have been followed exactly once.

Eventually, some references will have never been followed (because their starting node is unreachable from any other in the first place), and the nodes they point to, will thus still be marked “dead”. Just as for your Bob, Joe, Sally trio.

Of course, in your case, we must tweak the notions a bit and define a “reference type” by analogy with the notion of equivalence class:

say, for the equivalence class / reference type “has an IOU of $20 on someone else”, each of the three Bob, Sally, and Joe has exactly one such “reference”.

So, I believe you can leverage the mark-and-sweep algorithm, at the cost of maintaining, for each node, the set of (distinct) equivalence classes “has an IOU of $X on someone else” that it uses, along with the corresponding markers (1 bit per node and per equivalence class it uses is enough) and running it, mark-and-sweep, as many times over your entire graph as there are (distinct) equivalence classes in use, in total (*)

This may not be a good solution (at all) if there are many possible, distinct amounts of IOUs between any two nodes, though… say, if your graph is already millions of nodes-wide and your distinct IOUs are arbitrarily found in the range $1 to $1,000,000 with a normal distribution, for instance.

‘Hope this helps.

(*) E.g.,

Bob owes Joe $20;
Jack owes Pete $15;
Joe owes Pete $30 and Sally $20;
Pete owes Bob $20 and Sally $15;
Sally owes Jack $15 and Pete $20:

[IOU...]Bob     Jack    Joe     Pete    Sally
Bob                     (20)

Jack                            (15)

Joe                             (30)    (20)

Pete    (20)                            (15)

Sally           (15)            (20)

After reduction:

[IOU...]Bob     Jack    Joe     Pete    Sally
Bob         

Jack

Joe                             (30)

Pete

Sally

(Only remaining: Joe owes Pete $30)

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật