In this example from the Ripple whitepaper, where I've given Sally an IOU for $100 in exchange for her IOU, which I pass along to you, and you needed to pay Bob $50, and you discovered that Bob knew and trusted me so I gave Bob $50 of Sally's IOU, which he could give to me in exchange for my IOU, and I could settle $50 of my debt with Sally.
If Erik who Sally trusts then gives Sally an IOU of $50, and You who trust Erik gives him an IOU of $50, then your and Sallys debt clear, and Sally is left with my debt.
There is a cost to Sally trusting me if I do not pay her back, making trust-lines an ideal anti sybil system for Swarm Redistribution.
In EthRipple, written by Ivica Aracic who chose to use the same name I conceptualized a year earlier,
using the ripple function for my transaction to you,
function ripple(address[] chain,
Asset[] assetFlow,
uint amount);
ripple([Me, Sally, You], [USD, USD], 100)
Would also draw a dividend pathway from me to you.
dividendPathway {
address from;
uint amount;
uint timeStamp;
bool isOpen;
}
drawPathways([Me, Sally, You]), [USD, USD], 100)
This draws a pathway between me and Sally, and one between Sally and you. The pathways remain closed until the credit has cleared.
If I do not pay off my debt to Sally, then my pathway will remain closed, while Sally gets a pathway to You.
mapping(address => dividendPathway[]) dividendPathways;
for(uint i = 1; i < chain.length; i++) {
dividendPathways[chain[i]]].push(from: chain[i-1],
amount: amount,
timeStamp: now,
isOpen: false
)};
Debt has to be cleared to close the pathways, further improving trust-lines as an anti-sybil system.
This works with the traditional banking system as well. If I have $100 and send those to you, that creates a pathway between me and the bank, and a pathway between it and you.
Then once my debt to the bank has cleared, that pathway is opened. This rewards me for paying back the bank, as part of the credit clearance.
Swarm Redistribution
The dividend pathways are used to tax IOUs, and redistribute them.
The swarm redistribution iterates through the pathways, and builds up a swarmTree[]. It then redistributes the taxed amount, taxCollected, onto every human in that swarmTree[], who all get a tiny bit of the tax.
When a person makes a transaction of 100 with the Store, then a small amount of tax is sent through the pathways You, Bank and Me.
function iterateThroughSwarm(address _node, uint _timeStamp, uint _taxCollected) {}
That tax is then shared on all the humans in that swarm,
function doSwarm(address _leaf, uint256 _taxCollected) {
uint256 share = _taxCollected / humans.length;
for (uint i = 0; i < humans.length; i++) {
balanceOf[humans[i]] += share;
accounts[humans[i]].assets[EUR].ious[_leaf].amountOwed = share;
totalBasicIncome[humans[i]] += share;
inHumans[humans[i]] = false;
/* Notifiy anyone listening that this swarm took place */
Swarm(_leaf, humans[i], share);
}
delete humans;
}
The pathways are also used up slightly,
if (dividendPathways[_node][i].amount - _taxCollected > 0) {
dividendPathways[_node][i].amount -= _taxCollected;
}
else removePathway(_node, i);
Dividend pathways could be seen as the glue which holds an IOU network together, adding trust and acting as a social cohesion.