resilience.me
  • Home
  • FAQ
  • On Indiegogo
  • News
    • Resilience protocol
    • Epiphany, march 11 2015
    • resilience-smart-wallet, June 26 2015
  • #DApp
  • Memes
  • Learn
    • How to Hack Resilience
    • My Resilience
    • My pitch in the Ethereum forum
    • A sample scenario
    • Introduction to my system
  • Story
    • Note on Profit
    • My pitch to BitNation
    • Letter: Mimetic Networks & Ecosystems of Ideas
    • My interview with CoinDesk
    • My brother explains my system
    • A brief story of Basicincome.co
    • Letter: The Singularity and P2P-Dividends
  • Videos
  • Code
    • Client >
      • resilience_me.js
      • declare_tax.js
    • Server >
      • server.js
      • swarm_redistribution.js
  • Theory
    • SKETCH: RESILIENCE protocol
    • Whitepaper: Transaction Tax
    • Whitepaper: Technologically Enhanced Basic Income
    • Introduction: The Incentive Layer
    • Basicincome.co - A Peer-to-peer Basic Income Network
    • Whitepaper: Decentralised TaxRate Governance
    • Basicincome.co - Incentive-Based Decentralized Safety Nets
  • Graph
  • Twitter
  • Client

Aug 10 2014
swarm-redistribution.js

https://github.com/resilience-me/resilience.me/blob/master/Code/swarm_redistribution.js

Example of how the swarm-redistribution script will work. This example uses the Ripple API to compute an accounts swarm (a tree-like-map of transaction patterns). This is just an example.

The resilience.me-server script will use an algorithm similar to Ripple APIs account_balance,
but it will return dividend pathways instead:

[{account: ""},{ currency: "", amount: "", taxRate: ""},{currency: "", amount: "", taxRate: ""}...]
[{account: ""},{ currency: "", amount: "", taxRate: ""},{currency: "", amount: "", taxRate: ""}...]
[{account: ""},{ currency: "", amount: "", taxRate: ""},{currency: "", amount: "", taxRate: ""}...]

resilience.me-server stores a sum of an accounts financial history with another account.
as that account receives dividends, those dividends are subtracted from the sum

for example, {account: XXX} with {currency: USD, amount: 10,000 taxRate: 0.02}
receives 20 USD in dividend. their dividend pathway is then 9980 USD.
this is a measure of citizenship, but on a peer-to-peer level

the script will then loop back recursively. 

the following example-script shows part of the logic.


To test:
install npm
download swarm_redistribution.js

install ripple-lib and run the script:
$ npm install ripple-lib
$ node swarm_redistribution.js


Example output:
SWARM_USD_rfCFLzNJYvvnoGHWQYACmJpTgkLUaugLEw



Picture