scieee Science in your language
[en] (orig)

Sustainable open access publishing using Blockchain, Interledger and Web Monetization

Abstract

One of the main problems the academic community faces is the high prices of publishing and accessing academic papers. Authors and reviewers usually work for free or even pay for their work to be published, while the revenue generated goes to the big publishers. This project is centered around studying the technologies that would be best suited for the creation of a system or platform for donations to journals and researchers. Various centralized and decentralized technologies have been studied. Regarding centralized technologies, PayPal has been the main focus, and regarding decentralized technologies, Blockchain, Interledger and Web Monetization have been studied. Their advantages and limitations have been analyzed, as well as their different integration possibilities. These technologies have been used to implement a system that allows donations by different centralized and decentralized means. The donations can be sent between any two centralized or decentralized currencies. The system’s main feature is a donation button that can be integrated in any journal’s web page. JavaScript and React were used for the front-end implementation. This connects with the underlying subsystems that manage the different types of payments. To test the possibilities of the decentralized technologies, a new ERC20 token was implemented and integrated in the system. It was concluded that centralized technologies are easier to use for implementation, better documented and more intuitive for the user. However, PayPal, for example, imposes certain barriers and limitations that block the developers’ work. Decentralized technologies, on the other hand, are newer, so they have less documentation and are a bit more cumbersome to use. But they have proven to be way more flexible and adaptable and easier to integrate with. So, despite their limitations, they have potential to become an important part of online donations and payments in the future.

Read accessible full text

Sustainable open access publishing using Blockchain, Interledger and Web Monetization

Author: Pérez Tirador, Elena
Year: 2021
Source: https://docta.ucm.es/bitstreams/ecec562e-24ab-4cca-9cbe-27c8a14e8e15/download
Sus ainable Open Access Publishing using
Blockchain, In e ledge and Web Mone iza ion
Publicación de acceso abie o sos enible
median e Blockchain, In e ledge y
mone ización web
By
Elena Pé ez Ti ado
Depa men o de Ingenie ía del So wa e e In eligencia A i icial
Uni e sidad Complu ense de Mad id
T abajo Fin de G ado del Doble G ado en Ingenie ía
In o má ica y Ma emá icas, Facul ad de In o má ica,
Uni e sidad Complu ense de Mad id.
2020/2021
Di ec o s:
An onio A. Sánchez Ruiz-G anados
Ámba Teno io F onés
iii
Abs ac
One o he main p oblems he academic communi y aces is he high p ices o
publishing and accessing academic pape s. Au ho s and e iewe s usually wo k o
ee o e en pay o hei wo k o be published, while he e enue gene a ed goes o
he big publishe s.
This p ojec is cen e ed a ound s udying he echnologies ha would be bes sui ed
o he c ea ion o a sys em o pla o m o dona ions o jou nals and esea che s.
Va ious cen alized and decen alized echnologies ha e been s udied. Rega ding
cen alized echnologies, PayPal has been he main ocus, and ega ding decen al-
ized echnologies, Blockchain,In e ledge and Web Mone iza ion ha e been
s udied. Thei ad an ages and limi a ions ha e been analyzed, as well as hei di e -
en in eg a ion possibili ies.
These echnologies ha e been used o implemen a sys em ha allows dona ions by
di e en cen alized and decen alized means. The dona ions can be sen be ween
any wo cen alized o decen alized cu encies. The sys em’s main ea u e is a
dona ion bu on ha can be in eg a ed in any jou nal’s web page. Ja aSc ip and
Reac we e used o he on -end implemen a ion. This connec s wi h he unde lying
subsys ems ha manage he di e en ypes o paymen s. To es he possibili ies o
he decen alized echnologies, a new ERC20 oken was implemen ed and in eg a ed
in he sys em.
I was concluded ha cen alized echnologies a e easie o use o implemen a ion,
be e documen ed and mo e in ui i e o he use . Howe e , PayPal, o example,
imposes ce ain ba ie s and limi a ions ha block he de elope s’ wo k. Decen al-
ized echnologies, on he o he hand, a e newe , so hey ha e less documen a ion and
a e a bi mo e cumbe some o use. Bu hey ha e p o en o be way mo e lexible
and adap able and easie o in eg a e wi h. So, despi e hei limi a ions, hey ha e
po en ial o become an impo an pa o online dona ions and paymen s in he
u u e.
Keywo ds: Academic communi y, Blockchain, decen aliza ion, dona ions, In e ledge ,
PayPal, online paymen s, Web Mone iza ion
Resumen
Uno de los p incipales p oblemas que a on a la comunidad académica son los al os
p ecios pa a publica a ículos y accede a ellos. Habi ualmen e los au o es y e iso es
abajan g a is, o incluso ienen que paga pa a pode publica su abajo, mien as
que son los g andes edi o es quienes eciben los bene icios gene ados.
Es e p oyec o se cen a en el es udio de ecnologías que puedan esul a adecuadas
pa a la c eación de un sis ema o pla a o ma pa a donaciones a e is as académicas
e in es igado es. Se han es udiado di e sas ecnologías cen alizadas y descen al-
izadas. En e las cen alizadas, PayPal ha sido la p incipal, y en e las descen-
alizadas, se han es udiado Blockchain,In e ledge yWeb Mone iza ion. Se
han analizado sus en ajas y limi aciones, así como sus di e en es posibilidades de
in eg ación.
Es as ecnologías han sido u ilizadas pa a implemen a un sis ema que pe mi e ealiza
donaciones po ías cen alizadas y descen alizadas. Las donaciones pueden
ealiza se en e cualesquie a dos di isas di e en es, ya sean cen alizadas o descen-
alizadas. El elemen o p incipal del sis ema es un bo ón de donación que puede
in eg a se en la página web de cualquie e is a. Pa a la implemen ación del on -end
se u iliza on Ja aSc ip y Reac . Es o se conec a con el subsis ema subyacen e que
se enca ga de los di e en es ipos de pagos. Pa a p oba las posibilidades de es as
ecnologías descen alizadas, se ha implemen ado un nue o oken ERC20 y se ha
in eg ado en el sis ema.
Se comp obó que las ecnologías cen alizadas son más áciles de usa en imple-
men ación, es án mejo documen adas y son más in ui i as pa a el usua io. Sin
emba go, PayPal, po ejemplo, impone cie as ba e as y limi aciones que pueden
bloquea el abajo de los desa ollado es. Las ecnologías descen alizadas, po
con a, son más nue as, po lo que disponen de menos documen ación y son algo más
engo osas de u iliza . No obs an e, han demos ado se más lexibles, adap ables e
in eg ables. De modo que, a pesa de sus limi aciones, iene el po encial de con e i se
en una pa e impo an e de los sis emas de pagos ydonaciones en el u u o.
Keywo ds: Blockchain, comunidad académica, descen alización, donaciones, In-
e ledge , PayPal, pagos online, Web Mone iza ion

ii
Acknowledgemen s
A e a long while, his p ojec is coming o an end. This yea has undoub edly been
one o he wei des up o his day o e e yone. The e o e, I would like o hank
e e yone ha made his p ojec possible, despi e he wei d condi ions we all a e in.
So hanks o:
•An onio Sánchez and Ámba Teno io, o di ec ing and supe ising his p ojec .
•G an o he Web and he In e ledge Founda ion o inancing i .
•The Qua z OA eam, o making he Qua z p ojec a eali y.
•My amily, o all he in aluable suppo .
•My iends, o helping me keep my sani y in his di icul yea .
Thank you e y much.
ix
Con en s
Abs ac iii
Resumen
Acknowledgemen s ii
1 In oduc ion 1
1.1 Objec i es .................................. 2
1.2 Planning ................................... 2
1.3 S uc u e o his documen ......................... 3
1.4 Sou ce code ................................. 3
2 Web dona ions and pla o ms 5
2.1 In oduc ion ................................. 5
2.2 Analysis and ca ego ies ........................... 5
2.2.1 Ca ego ies .............................. 6
2.2.2 Analysis and sco e ......................... 6
2.3 Wikipedia .................................. 6
2.4 PayPal .................................... 7
2.4.1 API ................................. 7
2.4.2 Ma ke places and pla o ms .................... 8
2.5 Cen alized dona ion pla o ms ...................... 8
2.5.1 Ko- i ................................. 9
2.5.2 Fla ................................ 10
2.5.3 Plaudi ............................... 11
2.6 Decen alized dona ion pla o ms ..................... 12
2.6.1 Gi e h ................................ 12
2.6.2 Helpe bi .............................. 13
2.6.3 Gi eT ack .............................. 14
2.7 Conclusions ................................. 15
3 Technologies o a dis ibu ed dona ion pla o m 17
3.1 Blockchain .................................. 17
3.1.1 Blockchain ............................. 17
Basic concep s ........................... 17
3.2 E he eum and ERC20 okens ....................... 18
3.2.1 E he eum .............................. 18
3.2.2 ERC20 okens ............................ 18
3.3 In e ledge P o ocol ............................ 18
3.3.1 De ini ions ............................. 19
3.4 Web Mone iza ion ............................. 19
3.5 Some walle s and applica ions ....................... 20

x ii
Lis o Abb e ia ions
API Applica ion P og amming In e ace
CTA Call ToAc ion
ERC E he eum Reques o Commen s
GDPR Gene al Da a P o ec ion Regula ion
HTML Hype Tex Ma kup Language
IDE In eg a ed De elopmen En i onmen
ILP In e Ledge P o ocol
IPFS In e Plane a y File Sys em
JSON Ja aSc ip Objec No a ion
MVP Minimum Viable P oduc
ORCID Open Resea che and Con ibu o ID
QTZ Qua z Token
REST Rep esen a ional S a e T ans e
URL Uni o m Resou ce Loca o
WM Web Mone iza ion
xix
To my amily
1
Chap e 1
In oduc ion
Scien i ic p oduc ion is a e y demanding and dedica ed job, as well as an immensely
necessa y one. Bu his kind o wo k, in mos cases, is no paid o compensa ed in any
way [38]. Mos au ho s, edi o s and e iewe s wo k o ee (o almos o ee), and
a he same ime ha e o pay huge amoun s o money o access he scien i ic con en s
published in mos jou nals [3,51].
The main eason o his is ha academic and scien i ic publishing is p ima ily con-
olled by a educed g oup o big publishe s (such as Else ie , Sp inge Na u e o
Wiley) [33]. Al hough he majo i y o he wo k in ol ed in his complex p ocess is
ca ied ou by he academics, aking he ole o au ho s, e iewe s, edi o s, e c. mos
o he bene i s gene a ed by his ma ke go o hese big publishe s [32].
These bene i s o en come om he high p ices esea che s need o pay o access he
con en [5]. The e is an op ion o he au ho s o publish hei a icles in Open Access,
so whoe e wan s o access he con en can do i o ee, o i is open. Howe e , in
exchange o his, esea che s ha e o pay e y expensi e p ices [60].
I is no uncommon ha , o hese easons, academics eel us a ed, since hey can
eel like hei wo k is no p ope ly ecognised and compensa ed. And also o some,
publishing in Open Access is no an op ion, because hey can no a o d he high
p ices [23].
The p oblem wi h he academic publishing ises om he cen aliza ion o i s mo e
powe ul ac o s ( he big publishe s). Fo his eason, i is in e es ing o s udy decen-
alized solu ions o y and ackle hese kind o p oblems. None heless, i is known
ha hese echnologies a e s ill no e y accessible o mos people because o hei
some imes cumbe some usabili y [1], so i is also necessa y o combine hese decen-
alized echnologies wi h some cen alized solu ions o make adap a ion easie .
Ano he ma e ha is also wo h explo ing is he ewa ds o he academic communi y
[40]. These ewa ds could ma e ialize in di e en o ms, whe he hey be mone a y
o no [65]. Fo hese eason i is also in e es ing o explo e he possibili ies ha
c yp ocu encies o okens b ing o his con ex .
In his con ex , se e al ini ia i es o help imp o e he si ua ion o he academic com-
muni y begin o appea [18]. One such ini ia i es is Decen alized Science1[57,55],
a p ojec aiming o p o ide an open communi y o e iewe s, open pee e iews and
a epu a ion ne wo k, p o iding ewa ds o he pee e iewing wo k. As a na u al
con inua ion o Decen alized Science, and hanks o he unding ecei ed om G an
1h ps://decen alized.science/

2Chap e 1. In oduc ion
Fo The Web2, he Qua z OA3p ojec is bo n, aiming o c ea e a communi y o aca-
demics and jou nals ha enables dona ions in a dis ibu ed way. By b inging hese
addi ional sou ces o capi al, hey s i e o make Open Access ai e , mo e sus ainable
and independen [34].
This TFG is pa o he Qua z OA p ojec , in collabo a ion wi h he ISIA depa men
o he Facul ad de In o má ica a UCM 4.
1.1 Objec i es
The goal o his p ojec is o c ea e a sys em ( he Qua z sys em) o acili a e dona-
ions o jou nals and au ho s, in o de o ewa d hei wo k. Speci ically, he p ojec
is cen e ed in explo ing wha cen alized and decen alized echnologies can be used
o his pu pose, and ind ou hei s eng hs and weaknesses, while using hem o
c ea e he sys em.
In he case o decen alized echnologies, he In e ledge P o ocol [56] will be s udied,
explo ing i s applicabili y and limi a ions in o de o in oduce i in o he sys em.
In e ledge p o es o be in e es ing, as i is a new echnology ha allows in e commu-
nica ion among ledge s (bo h cen alized and decen alized). This means exchanges
be ween any wo coins o paymen sys ems a e possible. In pa icula , his p ojec
will explo e how new paymen sys ems can be in eg a ed in o his sys em o enable
di e en kinds o paymen s.
The concep o mic odona ions will also be explo ed, as a way o allow use s isi ing
websi es o pay based on he ime hey spend in hem.
In e ms o de elopmen , he goal is o c ea e a dona ion bu on ha can be in eg a ed
in he web page o a jou nal, allowing he isi o s o pe o m dona ions in di e en
ways:
•Via a cen alized paymen sys em, such as PayPal.
•Via a decen alized paymen sys em, using any cu ency. In pa icula , a speci ic
coin c ea ed o dona ions o jou nals.
•Via mic odona ions, using a b owse ex ension.
1.2 Planning
The de elopmen o his p ojec ook place be ween Sep embe 2020 and May 2021.
This documen was w i en in he ollowing mon hs.
The i s ou mon hs o he p ojec we e cen e ed in s udying he p oblem, analyzing
he possible solu ion and de eloping he i s cen alized solu ion. This is, a bu on
allowing cen alized dona ions.
The nex ou mon hs o he p ojec we e cen e ed in explo ing he decen alized
possibili ies, essen ially In e ledge and Web Mone iza ion (bo h will be explained in
de ail in he nex chap e s o his documen ), and de eloping he decen alized solu-
ion. This is, adding he bu on he possibili y o pe o m dona ions ia In e ledge
and in eg a ing wi h Web Mone iza ion so ha he use can send mic opaymen s
while isi ing he jou nal’s websi e.
2h ps://www.g an o heweb.o g/
3h ps://qua z. o/
4h ps://www.ucm.es/disia
1.3. S uc u e o his documen 3
The es o he ime was dedica ed o polish he applica ion and w i e his documen .
In e ms o me hodology, sc um [8] was applied, implemen ing wo-week sp in s. E e y
o he Thu sday, a mee ing was held wi h he di ec o s o he p ojec o e iew he
wo k o he p e ious wo weeks and decide he s eps o be aken in he nex sp in .
Fo he inal phase o polishing and w i ing he documen , he sp in s we e changed
o one-week sp in s.
1.3 S uc u e o his documen
This documen explains he de elopmen p ocess o he app, along wi h ini ial con-
side a ions and inal esul s.
Chap e 2in oduces he cu en con ex in which he p ojec is de eloped. I explains
he impo ance o dona ions o open so wa e p ojec s, men ioning Wikipedia as a well
known example. I also in oduces PayPal as a echnology o online paymen s and
gi es a ious examples o dona ion pla o ms, bo h using cen alized and decen alized
cu encies.
Chap e 3explo es he echnologies ha enable he c ea ion o a dis ibu ed dona-
ion pla o m. I in oduces he In e ledge P o ocol and Web Mone iza ion as wo
new echnologies ha can be used o his pu pose. I also gi es some examples o
applica ions using hese echnologies.
Chap e 4gi es an o e iew o he implemen ed sys em om he use ’s pe spec i e,
explaining he ac o s ha will in e ac wi h i and he main unc ionali ies i p o ides.
The wo k low is explained in de ail, illus a ed by sc eensho s o he sys em.
Chap e 5explains he implemen a ion o he cen alized pa o he sys em. I i s
gi es some implemen a ion de ails abou PayPal and i s API and hen shows and
explains he a chi ec u e o he sys em, as well as i s low o in e ac ions ( h ough
sequence diag ams).
Chap e 6explains he implemen a ion o he decen alized pa o he sys em. I i s
gi es implemen a ion de ails abou In e ledge and he a chi ec u e o an In e ledge
ne wo k. Secondly, i does he same o Web Mone iza ion. I hen explains he
in eg a ion o new coins in his a chi ec u e and inally desc ibes he a chi ec u e,
implemen a ions de ails and low o in e ac ions o he implemen ed sys em.
Chap e 7analyzes he conclusions ha can be ex ac ed om he p ojec , ega ding
i s ini ial objec i es, and hen p oposes he nex s eps ha can be aken o u he
de elop and imp o e he sys em and he p ojec .
1.4 Sou ce code
The p ojec has been de eloped using Ja aSc ip , HTML, CSS and Solidi y. The
sou ce code o he p ojec , along wi h some deploymen ins uc ions can be ound in
he ollowing Gi Hub eposi o y:
h ps://gi hub.com/ElenaPT/TFG_In _2021
The p ojec is licensed unde a GNU Gene al Public License 3.0.
5
Chap e 2
Web dona ions and pla o ms
This chap e s udies how web dona ions a e wo king nowadays. Fi s , an in oduc ion
is gi en illus a ing he impo ance o dona ions in open sou ce p ojec s, and why hey
a e so necessa y. Then, Wikipedia is in oduced as an example o a well known p ojec
ha is inanced using dona ions. A e ha , PayPal is b ie ly desc ibed as a ool o
enabling dona ions and paymen s h ough he web, since i is he mos commonly used
echnology o his pu pose. Las ly, some dona ion pla o ms and simila p ojec s a e
lis ed and analyzed in e ms o hei usabili y.
2.1 In oduc ion
Nowadays, open sou ce p ojec s a e e y common and se e as a basis o bo h open
and non open sou ce so wa e de elopmen [54]. Howe e , mos o he ime he wo k
in open sou ce is no well ecognized, and inancing his so o p ojec s can be chal-
lenging [11]. Al hough mul iple unding models exis in he con ex o open sou ce
c ea ion, dona ions h ough pla o ms such as PayPal o Pa eon a e one o he mos
common p ac ices [45].
Open so wa e de elopmen is usually a olun a y wo k, and he e a e di e en opin-
ions on whe he o no o accep mone a y ewa ds [58]. Pa icipa ing in he de-
elopmen o open sou ce so wa e can s a om bo h an in insic mo i a ion ( he
de elopmen i sel is mo i a ing, o i is in e es ing o challenging) o an ex insic
mo i a ion (academic ewo ds all in his ca ego y) [29].
The impo ance o dona ions elies on hei olun a y na u e, o an obliga ion o
coe cion o inance he de elope s would de y he philosophy behind open so wa e
i sel [52].
F om he pe spec i e o he dono , he will o dona e can come om di e en easons.
I could jus be an al uis ic decision, bu some o he ac o s can be in play, such as
p i a e gains de i ed om he so wa e being de eloped in he end, o some kind o
ecogni ion o p es ige [31].
We hink Open Access publica ion is no ha di e en om Open Sou ce de elopmen
in hese aspec s, so his same easoning can be applied [64].
2.2 Analysis and ca ego ies
The ollowing sec ions o his chap e will s udy exis ing applica ions and echnologies
ha a e simila o he one being de eloped (unde he name o Qua z o Qua zOA).
12 Chap e 2. Web dona ions and pla o ms
Figu e 2.3: A e i ied p ojec ’s p o ile page in Gi e h
2.6 Decen alized dona ion pla o ms
This sec ion cen e s on he analysis o sys ems designed o allow he use o make
dona ions using c yp ocu encies and blockchain. Namely: Gi e h,Helpe bi and
Gi e ack.
2.6.1 Gi e h
Gi e h [21] is a pla o m ha allows he use o make dona ions o social good p ojec s
wi hou commissions o o he seconda y cha ges, by using he blockchain echnology.
They desc ibe hemsel es as a “Decen alized Al uis ic Communi y”.
The websi e ha bo s a collec ion o pages, one o each p ojec inside he communi y.
Inside each page, he e is in o ma ion abou he p ojec and hei goals, a sec ion o
upda es and a summa y o he dona ions, showing he o al amoun dona ed o he
p ojec and a lis o he dono s o de ed om mos ecen o leas ecen . A p ojec ’s
page can be seen in Figu e 2.3.
As o now, he dona ions can only be done using c yp ocu encies (DAI, YAY, UNI
o ETH). A paymen by c edi ca d is being implemen ed, bu is no wo king ye .
Rega ding he ca ego ies de ined in Sec ion 2.2.1, he ollowing can be concluded:
•Accessibili y: (5/5) Inside he websi e, he dona ion bu on can be easily
ound in he home page. The e is a “P ojec s” page ha is easy o ind in he
op menu. F om he e he dona ion bu on o each p ojec is also easy o ind
and clea o use. The login bu on and he one o c ea ing a p ojec a e also
e y isible in he home page.
•In e es : (4/5) The websi e is a ac i e and uses inspi ing illus a ions and
language. The “P ojec s” page makes i in e es ing o disco e new p ojec s.
The ac ha all he p ojec s ea u ed a e o social good helps he use iden i y
wi h he alues.
I expec s he use o be in e es ed in c yp ocu encies and hei use ( he
dona ions can only be made using c yp ocu encies).
•Usabili y: (2/5) The dona ion bu on is big and clea . Howe e , he ac ha
he dona ions can only be pe o med using c yp ocu encies makes he p ocess
a li le cumbe some, especially o people no e y amilia ized wi h he ield.
The p ocess o logging-in and c ea ing a p ojec seems o no be wo king
well.

2.6. Decen alized dona ion pla o ms 13
Figu e 2.4: Helpe bi main page
•Dialogue: (4/5) The exchange o in o ma ion be ween he page and he use
is agile.
•E ec i eness: (3/5) The pla o m is no e y popula ye , al hough i has
a decen numbe o use s. I has a limi ed niche, because i equi es p io
knowledge and usage o he echnology. Howe e , inside i s niche i is he mos
popula echnology o dona ions.
2.6.2 Helpe bi
Helpe bi [53] is a pla o ms ha allows he use o make dona ions o cha i ies using
c yp ocu encies, so he cha i ies can ecei e he money in a sa e way.
The websi e ha bo s a collec ion o pages, one o each cha i y inside he communi y.
In he page, he cha i y can display in o ma ion abou wha hey do and some ela ed
media, such as pho os o ideos, ha can illus a e hei labo . The page also shows
he income goal o he o ganiza ion and he quan i y ha has al eady been dona ed.
The e is a subsec ion whe e a lis o he dono s is displayed. The main page o he
websi e can be seen in Figu e 2.4.
The dona ions can be done using di e en c yp ocu encies, ia Me amask3[37] o
om he Helpe bi accoun o he use .
Rega ding he ca ego ies de ined in Sec ion 2.2.1, he ollowing can be concluded:
•Accessibili y: (5/5) The main page o he websi e shows he di e en cha i ies
ha a e egis e ed in he communi y and can ecei e dona ions. The bu on o
dona ing o a cha i y is e y clea and easy o ind. The login bu on is also
easy o ind in he op menu.
•In e es : (4/5) The in e ace is no he mos a ac i e one, bu i is su icien ly
clea . The main page showing he o ganiza ions by ca ego ies (la es p ojec s,
ending p ojec s...) makes i easy o disco e he collec i es.
The ac ha he page is o dona ing o cha i ies makes i easy o he use
o iden i y wi h he alues, which a e clea and ela able.
3Me amask is a b owse ex ension o managing c yp o walle s and ope a ing wi h c yp ocu en-
cies.
14 Chap e 2. Web dona ions and pla o ms
Figu e 2.5: P o ile page o a p ojec in Gi eT ack. The p ojec has
al eady eached i s miles one.
•Usabili y: (3/5) The dona ion bu on is e y clea and i s ands ou . The
dona ions can be done using c yp ocu encies o h ough he accoun c ea ed in
he websi e.
•Dialogue: (3/5) The exchange o in o ma ion be ween he page and he use
is agile, al hough a bi sca ce in some si ua ions.
•E ec i eness: (2/5) The e is a decen numbe o cha i ies inside he commu-
ni y, bu i does no seem like he ini ia i e is e y well known. Mos o he
cha i ies a e qui e a om hei income goals. Also, i seems ha he webpage
will close because he company unning i could no sus ain i sel economically.
So appa en ly hings did no wo k ou well.
Appa en ly he p ojec will disappea by he end o may 2021, and he page explains
how he cha i ies can do o wi hd aw hei unds.
2.6.3 Gi eT ack
Gi eT ack [22] is a pla o m ha allows he use o make dona ions o non-p o i
o ganiza ions and NGOs using he blockchain echnology o p o ide eal- ime acking
o he unds. The p ojec is de eloped by he Bi Gi e Founda ion [4].
The websi e ha bo s a collec ion o pages, one o each nonp o i o ganiza ion inside
he communi y. In he page, he o ganiza ion can display an o e iew o hei p ojec
and goals. The page also shows he und miles ones o he o ganiza ion and he
quan i y ha has al eady been dona ed. An o ganiza ion’s page can be seen in igu e
2.5.
The dona ions can be done using di e en c yp ocu encies o using a c edi ca d.
Rega ding he ca ego ies de ined in Sec ion 2.2.1, he ollowing can be concluded:
•Accessibili y: (5/5) Inside he websi e, in he home page, he bu on “Explo e
p ojec s” is he main call o ac ion and can also be ound in he op menu. The
dona ion bu on inside each p ojec is also e y easy o ind and s ands ou .
The login and sign up bu ons a e also isible and accessible in he op igh .
•In e es : (5/5) The page is e y clean and a ac i e and uses inspi ing lan-
guage. The “Explo e” page makes i in e es ing o disco e he di e en ini ia-
i es.
2.7. Conclusions 15
The ac ha he p ojec s a e nonp o i and NGOs makes i easy o he
use o iden i y wi h he alues.
•Usabili y: (5/5) The dona ion bu on is e y clea and he ba showing how
much money is le o each he miles one encou ages he use o dona e.
The paymen can be done using Bi coin, c edi ca d o ia Uphold [59],
which suppo s a lo o di e en cu encies. The a ie y o op ions makes i
qui e easy o dona e. The use is equi ed o ha e an accoun in Gi eT ack in
o de o dona e. C ea ing an accoun is easy.
The p ocess o c ea ing a p ojec is s aigh o wa d. I equi es go e nmen
app o al, because i is mean o ecognized o ganiza ions.
•Dialogue: (5/5) The exchange o in o ma ion be ween he page and he use
is agile.
•E ec i eness: (4/5) The e is a decen amoun o o ganiza ions and a good
pe cen age o hem a e eaching hei miles ones.
2.7 Conclusions
Each o he pla o ms ha we e s udied in his Chap e we e analyzed ollowing he
ca ego ies desc ibed in Sec ion 2.2.1. Du ing his analysis, o each o he ca ego ies
in each o he applica ions, a subjec i e nume ic sco e was gi en. The sco e anges
om 0 o 5, whe e 0 means ha (acco ding o a subjec i e c i e ia) he ca ego y is
no ul illed a all by he applica ion and a 5 means i is pe ec ly ul illed.
Fo ce ain ca ego ies, se e al applica ions may co e hem, o an ex en . Howe e ,
he sco e o a ce ain ca ego y o a ce ain applica ion will be lowe i he e a e
o he s ha ul ill said ca ego y mo e success ully.
These nume ic sco es se e as a quan i a i e measu e o how adequa e each pla o m
is, in e ms o i s in e ac ion wi h he use . I is use ul o he de elopmen o he
Qua z pla o m, since i se es as a guide o which p ac ices gi e he bes esul s, in
o de o make he use expe ience mo e pleasan .
Table 2.1 shows he sco es o each ca ego y in each one o he analyzed pla o ms.
Table 2.1: Compa ison o he di e en pla o ms s udied
Wikipedia is also included in he able, al hough i is no a dona ion pla o m. In i s
case, he analysis is made ega ding only Wikipedia’s unc ionali y o dona ions.
A i s glance, his analysis may gi e he imp ession ha he e al eady exis a lo o
al e na i es o he Qua z sys em. Howe e , his is no he case. None o he s udied
applica ions co e he in ended scope o one o se e al easons.
Pla o ms such as Ko- i, Fla , Gi e h o Gi eT ack a e well buil and usable and
al eady ha e a decen base o use s. Howe e , hey a e all in ended o di e en
16 Chap e 2. Web dona ions and pla o ms
a ge s. Ko- i and Fla a e a ge ed o a is s and c ea o s, Gi e h is a ge ed o
social good p ojec s and Gi eT ack is a ge ed o NGOs and non p o i o ganiza ions.
Fu he mo e, Ko- i and Fla only o e cen alized solu ions o he paymen s, while
Gi e h only o e s decen alized ones.
Plaudi ’s a ge , on he o he hand, is he academic communi y. None heless, i is
no ocused on dona ions bu on ecogni ion and endo semen s. Mo eo e , i is qui e
cumbe some and no easy o use.
Helpe bi does no only ha e a di e en a ge , bu is also closed o he ime being.
Qua z p oposes a solu ion ha has no been co e ed ye by any o hese pla o ms.
I o e s a dona ion pla o m o use s o dona e o academic jou nals and a icles.
Fo he paymen s, i allows bo h cen alized and decen alized paymen s.
F om he analysis i is clea ha o e ing only decen alized op ions o he paymen s
makes he applica ions less usable and e ec i e. Mos use s a e no amilia wi h
his new echnologies. Fo his eason, o e ing also cen alized op ions seems like he
op imal choice.
The analysis has also showed ha i is essen ial o he dona ion bu on o be easy
o ind and i should s and ou . I is also impo an ha he in e ac ions wi h he
use a e clea and he exchange o in o ma ion is agile. An a ac i e design is also
impo an . All hese ideas will be aken in o conside a ion when designing he sys em.
17
Chap e 3
Technologies o a dis ibu ed
dona ion pla o m
The p e ious chap e , Chap e 2, was cen e ed on he dona ion pla o ms and appli-
ca ions ha popula e he ma ke , an how hey a e s uc u ed, whe eas his chap e
explo es some decen alized echnologies ha can be used o c ea e a new kind o
decen alized dona ion pla o m.
3.1 Blockchain
Mos decen alized echnologies and sys ems ely on he blockchain echnology as a
basis. The e o e, gi ing a b ie in oduc ion o blockchain is key o gi ing con ex o
he es o echnologies his chap e will explain.
3.1.1 Blockchain
Blockchain is a decen alized echnology based on a da a s uc u e wi h he same
name. The da a s uc u e, as he name i sel indica es, is a chain o blocks [42].
The sys em was i s in oduced wi h he c ea ion o Bi coin [39]. I se ed as a basis
o he c ea ion o an elec onic paymen based on c yp og aphic p oo , so ha wo
pa ies o en i ies would be able o send money o each o he wi hou ha ing o us
a cen al en i y. The sys em is p o en o be secu e as long as he majo i y o he
nodes in ol ed in he sys em a e independen and hones , so hey con ol mo e CPU
powe han any hypo he ical g oup o a acke s o dishones pa icipan s.
Basic concep s
A ansac ion is de ined as an exchange o money be ween wo pa icipan s. This is,
a sende , a ecei e and a quan i y.
Ablock is a se o ansac ions. I is connec ed o he p e ious block and o he nex
one, hus o ming a chain. A new block is added o he chain once enough ansac ions
ha e happened.
The block also con ains a imes amp and a link o he p e ious block (o pa en ), in
he o m o a hash o said block. I also con ains a andom numbe , called nonce.
This numbe is impo an o he calcula ions o he block’s hash when he nex block
is added o he chain.
The blockchain ep esen s a comple e egis e o ledge o he ull his o y o ansac-
ions in he sys em, since o e e y new g oup o ansac ions, a block is added o he

18 Chap e 3. Technologies o a dis ibu ed dona ion pla o m
end o he chain. By c yp og aphic means, blocks can be alida ed as u h ul pa o
he chain.
The immu abili y o he blocks is gua an eed by he hashes. I any da a wi hin he
block (any in o ma ion abou any o he ansac ions) is modi ied, he hash o his
new modi ied block will be comple ely di e en o he p e ious one.
3.2 E he eum and ERC20 okens
3.2.1 E he eum
E he eum [7] is a decen alized blockchain, and one o he main ne wo ks as o o-
day. As bi coin o o he sys ems, i includes a coin, and mechanisms o pe o ming
ansac ions and paymen s. Bu he main in e es o he E he eum blockchain is he
ac ha i can un code, in he o m o so called sma con ac s .
Asma con ac is a piece o code ha can be execu ed in he E he eum blockchain,
au onomously. The language in which sma con ac s a e w i en in is Solidi y [7].
The ad an age o sma con ac s is ha , since hey un o e a blockchain, he us in
he con ac elies in i sel , a he ha in a hi d pa y ha wa an ies he compliance
o he con ac [43]. Fo his eason, i is comple ely impa ial and e e ybody can
us i will be execu ed. Wha e e ules a e w i en in he con ac will be execu ed
and complied wi hou a doub .
3.2.2 ERC20 okens
An ERC20 [15] oken is a sma con ac unning o e he E he eum blockchain
con aining code o he de ini ion o a oken o coin. This includes ope a ions such
as c ea ing an ini ial amoun o okens, sending money be ween accoun s o checking
he balance o an accoun .
ERC20 is he s anda d ha de e mines he unc ions and e en s his so o con ac s
should implemen .
The goal behind he c ea ion o he ERC20 okens is he s anda diza ion and compa -
ibili y among okens in he E he eum ne wo k, in o de o acili a e in e ope abili y
and c ea e a iche ecosys em.
OpenZeppelin [44] is a s anda d o building secu e blockchain applica ions. They
p o ide a lib a y o secu e de elopmen and deploymen o sma con ac s.
Among he con ac s con ained in his lib a y, he e a e con ac s o he deploymen
o ERC20 and ERC721 okens.
3.3 In e ledge P o ocol
The In e ledge P o ocol (o ILP, o sho ) can be used in o de o implemen a sys em
ha p o ides bo h he dono and he ecei e he eedom o choose hei p e e ed
cu ency o c yp ocu ency, wi hou ha ing o wo y abou how he ansac ions will
be pe o med.
3.4. Web Mone iza ion 19
3.3.1 De ini ions
In e ledge [56] is a p o ocol o sending and ecei ing paymen s be ween sys ems ha
main ain a egis e o inancial ansac ions. Being a p o ocol means i is a se o ules
ha a e publicly accessible.
Be o e unde s anding he idea behind In e ledge , i is necessa y o in oduce wo
main concep s:
•Ledge : An a chi e o book s o ing economic ansac ions, columns o c edi
and debi , ini ial and inal balance o an accoun . In o he wo ds, an accoun
book.
•Decen alized Ledge Technology: Digi ized and decen alized ledge . This
is, decen alized da abase managed by se e al pa icipan s, wi hou a cen al
au ho i y o e i ica ion.
So, in his sense, In e ledge can be unde s ood as a echnology o in e connec ing
di e en decen alized ledge s. Bu his is a simpli ica ion.
In e ledge can be de ined as a sys em ha allows communica ion among di e en
paymen sys ems, in o de o pe o m a ansac ion o a ce ain alue. The sys ems
communica ed by his p o ocol can (bu do no need o) be decen alized ledge s.
Ideally, any wo paymen sys ems (o ledge s), cen alized o decen alized, can be
connec ed ia In e ledge .
In a mo e echnical sense, In e ledge is an open p o ocol sui e o he shipmen o
paymen s among di e en ledge s [27]. In analogy o in e ne ou e s, he connec o s
ou e money packages h ough independen paymen ne wo ks. Since he a chi ec u e
and he p o ocol a e open, in e ope abili y is allowed o any sys em.
The ac o s ha pa icipa e in he sys em a e [26]:
•Sende : The ac o ha sends he money.
•Recei e : The ac o ha ecei es he money.
•Connec o : In case he sende and he ecei e a e no using he same paying
sys em, hey need in e media ies o connec hem. So his is he ole o he
connec o s: hey o wa d money h ough he ne wo k om he sende all he
way o he ecei e . They may cha ge ees o he wo k. I is expec ed ha
he di e en connec o s in he ne wo k compe e among hemsel es in e ms o
eloci y, eliabili y, co e age and p ice.
Any o hese pa icipan s o he In e ledge ne wo k is called a node.
The a chi ec u e o he In e ledge ne wo k and how hese nodes wo k oge he is
u he explained in chap e 6.
3.4 Web Mone iza ion
Web Mone iza ion [61] is an API ha allows websi es o eques paymen s in small
quan i ies ia he b owse and he Web Mone iza ion p o ide .
AWeb Mone iza ion p o ide o Web Mone iza ion sende is a digi al en i y ha
can issue paymen s in behal o a use and, in pa icula , send mic opaymen s o Web
Mone iza ion ecei e s [63] h ough ILP. In a simila way, a Web Mone iza ion ecei e
is a digi al en i y ha can accep paymen s pe o med ia In e ledge in behal o a
use and, in pa icula , ecei e mic opaymen s h ough Web Mone iza ion.
20 Chap e 3. Technologies o a dis ibu ed dona ion pla o m
The Web Mone iza ion ecei e p o ides he use wi h a so called paymen poin e ,
which is a URL assigned o a ce ain In e ledge accoun . This URL is unique and,
he e o e, se es as an iden i ie o he accoun .
The idea behind Web Mone iza ion is o he use unning a websi e o embed i s
paymen poin e in he websi e i sel . As long as he use s isi ing he si e ha e an
applica ion ha allows hem o send he mic opaymen s (such as Coil - see Sec ion
3.5.3), hey will s a sending li le amoun s o money o he paymen poin e de ined
in he sou ce code o he page.
The concep o mic opaymen s is simple: small amoun s o money sen e e y ce ain
ime. This is, o e e y uni o ime (e.g. e e y hou o e e y hi y minu es), a small
amoun o money (e.g. a cen , wo cen s) is sen om he use isi ing he page o
he paymen poin e egis e ed in he code.
3.5 Some walle s and applica ions
In o de o send o ecei e paymen s using ILP o Web Mone iza ion i is necessa y o
use an ILP walle . In he case o Web Mone iza ion, some walle p o ide s can wo k
as WM sende s o ecei e s.
This sec ion desc ibes h ee applica ions ha hos ILP walle s: Ra iki.money,Uphold
and Coil.
Bo h Ra iki.Money and Uphold can be used as s andalone walle s and as Web Mone-
iza ion ecei e s. In u n, Coil wo ks as a Web Mone iza ion p o ide .
3.5.1 Ra iki.money
Ra iki.money [47,25] is an example In e ledge walle p o o ype de eloped by In-
e ledge hemsel es. I allows he use o ha e an accoun wi h eal money o es
money using a es ne , and send and ecei e money.
I is no a dona ion ool. Simila ly o Uphold (3.5.2), Ra iki p o ides he use wi h
a paymen poin e ha can be used o ecei e dona ions ( o example, he dona ions
issued by Coil (3.5.3)).
I is no a eal inished p oduc , bu a p o o ype o es ing and expe imen ing. The
eposi o y i sel indica es he p ojec mus no be used in p oduc ion.
3.5.2 Uphold
Uphold [59] is a web exchange o buying and selling digi al coins and c yp ocu encies.
I allows he use o ha e an accoun wi h any ype o coin and use i o issue and
ecei e paymen s, as well as o buying and selling coins.
I is no a dona ion ool. Bu i a use wan s o ecei e mic opaymen s, o example,
he ones ha Coil issues, hey mus ha e a paymen poin e o ecei e hem. A
paymen poin e is he add ess o a walle wi hin a node o an ILP ne wo k [10].
Uphold p o ides he use wi h a paymen poin e , so hey can ecei e he dona ions.
3.5.3 Coil
Coil [9] is a b owse ex ension and ool o mic opaymen s eaming o web pages and
c ea o s.
3.6. O he echnologies 21
A use can pay a subsc ip ion ee and download he ex ension. Wi h he ex ension
ins alled and ac i e, e e y ime he use isi s a si e ha is webmone ized (i.e. sup-
po s Web Mone iza ion) [61], Coil s a s sending small amoun s o money depending
on he ime he use expends in said page. In pa icula , Coil pays $0.36 o e e y
hou a use expends on a page. The mic opaymen s a e sen oughly e e y second o
each isi ing membe .
The main in e es o his ini ia i e is he ac ha i is cu ency-agnos ic. This means
he use ha makes he dona ions can be using any ype o cu ency - being i any
physical cu ency o a c yp ocu ency. The ecei e o he dona ions can also ecei e
hem in whiche e cu ency hey decide. Bo h cu encies do no ha e o be he same,
no ela ed wha soe e .
Coil is buil o e Web Mone iza ion, which is he echnology ha manages he mic o-
paymen s. I wo ks as a Web Mone iza ion P o ide .
3.6 O he echnologies
The e a e o he echnologies ha ha e been used du ing he de elopmen o he
p ojec . The echnologies explained in his Sec ion a e no he co e o he p ojec ,
bu ha e been necessa y o he implemen a ion none heless.
3.6.1 Docke
Docke [12] is an open sou ce so wa e p ojec ha p o ides a sys em o so wa e con-
aine s, in which he de elope s can deploy se e al applica ions o i ualize ne wo ks
and sys ems.
In he con ex o his p ojec , Docke is used o simula e a simple In e ledge ne wo k.
This ne wo k is explained in de ail in Chap e 6(see 6.2.2).
Docke con aine s a e used o simula e an E he eum es ne and h ee di e en In-
e eldge nodes, and hen hey a e in e connec ed o simula e he whole h ee-node
ILP ne wo k.
3.6.2 Node.js
Node.js [41] is a Ja aSc ip un ime en i onmen designed o c ea e scalable ne wo k
applica ions. I is open sou ce and c oss-pla o m. I is o ien ed o asynch onous
e en s and i is used o w i e sc ip s o he se e side in a clien -se e web applica-
ion.
In he con ex o he p ojec , Node.js is used o implemen he se e s o which he
clien connec s in o de o ask o he mone a y ansac ions o be made.
3.6.3 Reac (ja aSc ip )
Reac [48] is a Ja aSc ip amewo k designed o help c ea ing use in e aces. I
acili a es he inclusion o HTML code wi hin he Ja aSc ip code, and i p o ides
some o he ad an ages, such as lambda exp essions.
In he con ex o he p ojec , i was used o implemen he use in e ace and he
clien o he applica ion.
28 Chap e 4. Sys em o e iew
Figu e 4.3: Qua z bu on in eg a ed in a jou nal’s web page
By in e ac ing wi h he bu on, he applica ion opens a new dialogue, whe e he use
can selec he amoun o money o dona e and decide he way in which hey wan o
pe o m he paymen (Figu e 4.4):
•Paypal
•Debi o c edi ca d
•In e ledge
The i s wo op ions open a PayPal popup window, whe e he use can pe o m he
paymen .
The hi d op ion opens a dialog asking he use o w i e in hei c eden ials o he
In e ledge accoun (see Figu e 4.5). Fo he p oo o concep pu pose o his p ojec ,
all he ope a ions a e pe o med o e p ede ined accoun s in a es ne wo k, so o
now his is s ill a placeholde dialog.
I he paymen is pe o med co ec ly, he applica ion shows a dialogue con i ming
e e y hing wo ked p ope ly and gi ing he use he op ion o isi he Qua z websi e6
and join he communi y. I he e is any e o du ing he p ocess, he applica ion shows
a dialogue s a ing he e has been an e o (Figu e 4.6).
The e is also he Web Mone iza ion paymen s, ha a e mic opaymen s sen o he
jou nal o each ime uni a eade expends in he page. This p ocess is a li le
di e en , so i will be explained in he nex sec ion (Sec ion 4.5.2).
4.5.2 Dono : Indi ec dona ion (mic opaymen s)
One o he ways he dono can dona e o he jou nal is ia mic odona inos.
In he case o he jou nal, he p ocess o in eg a ing he sys em in o hei web page is
he same ha was al eady explained in Sec ion 4.5.3. When he bu on is in eg a ed
in he page, i makes he p ope changes so ha he websi e becomes webmone ized
and can s a ecei ing mic odona ions.
In he case o he dono , he p ocess is di e en o he one explained in he p e ious
sec ion.
6h ps://qua z. o/

4.5. Dona ions 29
Figu e 4.4: Paymen dialogue
Fi s , i is equi ed ha he use has a Coil accoun (see 4.3.2). Then, hey ha e
o download he Coil b owse ex ension. This ex ension is he one ha allows he
use o send mic odona ions o he webs hey isi . In he Coil accoun , hey ha e
o selec a con igu e a membe ship. This is, a mon hly ee ha is payed o Coil and
hen edis ibu ed among he webmone ized websi es he use isi s.
Once he membe ship is con igu ed and he ex ension is downloaded, he dono jus
has o log in o Coil and hen, whene e hey isi a webmone ized websi e - he
jou nal’s websi e, in his ins ance - he ex ension will indica e ha i is sending money
and he mic opaymen s will be pe o med. Coil will pay $0.36 o each hou he dono
expends in he jou nal’s websi e.
Figu e 4.7 shows he b owse ex ension be o e logging in and a e logging in, when
isi ing a websi e ha is webmone ized. Figu e 4.8 shows he ex ension in con ex , in
a websi e ha has Web Mone iza ion enabled.
4.5.3 Jou nals
The use case o he jou nals is he same o bo h implici and explici dona ions.
30 Chap e 4. Sys em o e iew
Figu e 4.5: In e ledge paymen sc een
The use ep esen ing he jou nal could be a jou nal edi o o he pe son in cha ge o
he jou nal’s web page. Thei goal is o in eg a e he sys em in hei page and s a
ecei ing dona ions.
In o de o in eg a e he ull sys em, hey need o ha e one o mo e accoun s in he
a ious echnologies used (al hough i hey p e e o use only one o hem, he code
can be easily adjus ed). This means he jou nal needs o ha e a PayPal accoun , and
use his accoun o egis e in he Qua z PayPal pla o m. This is needed o he
PayPal and c edi ca d paymen s. The jou nal also has o c ea e an accoun in an
In e ledge node, ha could be he Qua z In e ledge node. This way hey ob ain a
paymen poin e , ha is used as an add ess o send hem he money.
Once all he accoun s a e c ea ed, he bu on can be in eg a ed in he web page7, as
shown in Figu e 4.3.
When he dona ions a e made by use s isi ing he websi e and in e ac ing wi h he
bu ons, he jou nal ecei e he money in he co esponding accoun . The money sen
ia he PayPal bu ons (PayPal, So o , and c edi and debi ca d) is ecei ed in he
Jou nal’s PayPal accoun . The balance can be checked in hei PayPal p o ile. The
paymen s ecei ed ia In e ledge a e ecei ed in he jou nal’s In e ledge walle . This
walle could be in any node p o iding paymen poin e s.
7The bu on is implemen ed in Reac (Ja aSc ip , HTML) and i can be in eg a ed by inse ing
he bu on’s code in he code o he websi e.
4.5. Dona ions 31
(a) Success dialogue (b) E o dialogue
Figu e 4.6: Success and e o dialogues
(a) Coil ex ension be o e logging in. (b) Coil ex ension while isi ing a webmone-
ized si e.
Figu e 4.7: Success and e o dialogues
32 Chap e 4. Sys em o e iew
Figu e 4.8: Using he Coil ex ension in a webmone ized websi e.
33
Chap e 5
Cen alized Implemen a ion
In his chap e , de ails abou he cen alized implemen a ion o he sys em a e gi en.
Fi s , he co e concep s o a PayPal applica ion a e in oduced, as well as he di -
e en unc ionali ies, componen s and APIs. Then, he a chi ec u e o he sys em is
explained, ollowed by a de ailed desc ip ion o he implemen a ion.
The cen alized implemen a ion is ela i ely simple, since all he managemen o he
ansac ions is delega ed o PayPal, who p o ides a high-le el API. Fo his eason,
he implemen a ion o he cen alized subsys em consis s mainly in he in eg a ion
wi h said API.
5.1 In oduc ion
Chap e 4in oduced he Qua z ecosys em, in e ms o i s ex e nal s uc u e and
how he use in e ac s wi h he di e en unc ionali ies.
This chap e will s udy he cen alized pa o said ecosys em, by explaining how i
is implemen ed.
The main componen o his subsys em is he dona ion bu on, and he unde lying
paymen sys em uses PayPal’s in as uc u e o send he paymen s. The use can
choose o make he paymen s using a PayPal accoun o by c edi ca d, bu he
di e ences be ween bo h channels a e made anspa en o bo h he use and he
de elope hanks o he simplici y o PayPal’s API.
Fo his eason, in o de o explain how his subsys em is implemen ed, i is help ul
o unde s and he echnology ha is used o he implemen a ion. This is he PayPal
REST API o ma ke places and pla o ms. The implemen a ion o he cen alized
dona ions consis s in an in eg a ion o Qua z’s UI wi h he unc ionali ies PayPal
p o ides.
5.2 PayPal
Fo he c ea ion o he i s e sion o he sys em, a cen alized app oach was aken
and PayPal was used o allow paymen s and dona ions in a cen alized way. PayPal
was chosen o i s in e ope abili y and he unc ionali ies i p o ides o he c ea ion
o ma ke places and pla o ms.
In b ie , a pla o m can onboa d a se o selle s o be pa o he ma ke place and hen
i can manage how he money is o wa ded o said selle s.

34 Chap e 5. Cen alized Implemen a ion
PayPal o e s a REST API o pe o m he di e en ope a ions o he de elopmen .
The REST API eques s a e execu ed combining an HTTP me hod, such as GET,
POST, PUT, PATCH o DELETE, he URL o he API se ice, he URI o he
esou ce o be upda ed, dele ed o que ied and op ional HTTP heade s. PayPal
p o ides he de elope wi h c eden ials o make he API calls, and he au ho iza ion
is pe o med using he OAu h 2.0 p o ocol. These c eden ials consis o a clien -id
and a sec e .
5.2.1 Concep s
The e a e a ew concep s ha will be used h oughou his chap e and a e pa ic-
ula o he PayPal API ha has been used o he de elopmen o he cen alized
subsys em. Some o hose concep s a e he ollowing:
•Pla o m/ma ke place. A s uc u e used o o ganizing a g oup o endo s
(in his case, he jou nals) so ha he paymen s made by he buye s (in his
case, he dono s) can be easily managed. I will be explained in mo e de ail in
Sec ion 5.2.2.
•Clien -id and sec e key. These a e c eden ials ha iden i y a pa icula
PayPal App. A use wi h a PayPal de elope accoun can c ea e apps ha
p o ide hem wi h c eden ials o access he REST API o bo h es ing and
li e ansac ions [35]. The clien -id is he iden i ie and he sec e key is he
passwo d. These c eden ials a y o each app and a e also di e en o li e and
sandbox apps.
•Access oken. I is an iden i ie o key ha au ho izes he use o use he
PayPal REST API se e [20]. I can be ob ained by using he clien -id and he
sec e key.
•A ibu ion-id. This key iden i ies he use as a PayPal pa ne . PayPal
pa ne s a e de elope s ha a e allowed by PayPal o use all he unc ionali ies
he PayPal REST API p o ides. This a ibu ion-id is ecei ed di ec ly om
PayPal and has o be used as an iden i ie e e y ime a call o he API is made
[2].
5.2.2 Pla o ms and ma ke places
PayPal o e s an API o ma ke places and pla o ms.
A pla o m, as p e iously explained in Sec ion 2.4.2, ac s as an in e media e en i y
be ween he dono and he jou nal. A jou nal ha wan s o pa icipa e in a pla o m
should, i s , ha e a PayPal business accoun .
Nex , by making calls o he PayPal API, using he Au ho iza ion oken and he
A ibu ion ID, i is possible o gene a e an onboa ding link, which is speci ic o he
pla o m. Onboa ding is he p ocess by which a jou nal, in his ins ance, in eg a es
in o a pla o m, so he pla o m can manage paymen s dono s send o he jou nal. By
using said link, any jou nal can onboa d.
Figu e 5.1 shows a simpli ied diag am o he s uc u e o a pla o m.
5.3 A chi ec u e
The a chi ec u e o he sys em has se e al laye s (as illus a ed in Figu e 5.2). The
use in e ace is common o bo h he cen alized and decen alized pa o he sys em,
5.3. A chi ec u e 35
Figu e 5.1: Qua z Pla o m
and hen each o he subsys ems has i s own lowe laye s, in bo h cases based on a
se e -clien model.
In his sec ion, he cen alized pa will be analyzed.
As he Figu e shows, he mos ex e nal laye is he UI (use in e ace). I is he
laye ha allows he communica ion be ween he use and he applica ion. This laye
was implemen ed using Reac JS and ollowing he di ec i es o ma e ial design. In
pa icula , he lib a y ma e ial-ui o Reac was used.
This laye connec s wi h he clien s o bo h he cen alized and he decen alized
subsys ems. In he case o he cen alized sys em, he clien ecei es he da a inpu s
ha he use en e s ia he UI and makes he POST eques s o he se e . The clien
is also implemen ed using Reac JS.
The se e makes calls o he PayPal API using he in o ma ion ecei ed om he
clien . The code o he se e is implemen ed using he Exp ess amewo k [13] o
Ja aSc ip and i uns on Node.js.
The eby, hese unde lying clien and se e laye s ollow a heo e ical s uc u e, in-
s ead o a physical one. In pa icula , hey ollow he clien -se e a chi ec u al pa -
e n [49]. As such, he Cen alized Sys em Clien Con olle wo ks as an in e media e
laye be ween he Clien UI and he Se e , by pa sing he da a ecei ed om he
UI and o wa ding he subsequen pe i ions o he se e . The Se e , on he o he
hand, manages he pe i ions and makes he necessa y calls o he co esponding API
(PayPal API, in his ins ance).
I is impo an o no e ha , o his is a heo e ical s uc u e, bo h he clien and he
se e can be unning in he same machine. The codes o bo h laye s un indepen-
den ly, bu he e is no need o hem o exis in sepa a e machines. This is he case
in he cu en deploymen whe e, o he sake o acili a ing es ing, bo h s uc u es
a e unning in he same machine. Howe e , he cu en implemen a ion also allows
o deploymen in di e en machines. This sepa a ion would be ideal, since some o
36 Chap e 5. Cen alized Implemen a ion
Figu e 5.2: A chi ec u e o he sys em. Highligh ed he cen alized
pa .
he da a being managed by he applica ion is sensi i e in o ma ion, and i is sa e o
p ocess such da a in an independen se e .
I is also impo an o no e ha he Clien Con olle and Se e o he cen alized
implemen a ion a e di e en om he ones o he decen alized implemen a ion. The
sou ce code is di e en and independen , and hey bo h un and wo k wi hou any
dependence om one ano he .
The PayPal API is he access laye h ough which he PayPal unc ionali ies a e
accessed. The PayPal sys em is he deepes laye o he sys em, and i is he one in
cha ge o managing he shipmen o he money.
Wi h his gene al knowledge o he a chi ec u e, i is now possible o explain in de ail
he sequence o calls among he di e en laye s o he sys em.
5.3.1 Sequence diag am
The PayPal dona ion bu on gene a ed o he selle s wo ks ollowing a se e -clien
s uc u e.
The se e lis ens o pe i ions ega ding he o de s and makes he API eques s. The
clien eads and manages he op ions o he use ’s o de (in his case, a dona ion) and
o wa ds he necessa y in o ma ion o he se e o pe o m he calls.
Figu e 5.3 shows a sequence diag am illus a ing he low o a ansac ion h ough
he PayPal dona ion bu on. This applies o bo h paymen s using a PayPal accoun
o a c edi ca d. The low o a paymen would be as ollows:
•The use se s he quan i y hey wan o dona e and p ess he “Pay” bu on.
•The clien sends a c ea e-o de pe i ion con aining he quan i y o be dona ed.
•The se e lis ens o he pe i ion and makes a call o he PayPal API. The access
oken and a ibu ion ID o he pla o m a e sen wi h he call, o au hen ica e
he pla o m and assu e i has he necessa y pe missions.
5.4. Conclusions 37
Use UI Clien Se e PayPal
API
Inse (amoun )
P ess(PAY)
Pay
c ea e-o de (amoun )
o de (access oken, a ib. ID)
Ok (JSON)
Ok
cap u e-o de o de (o de ID, access
oken, a ib. ID)
Success
Success
P in success sc een
Show success sc een
Figu e 5.3: Sequence diag am o he PayPal dona ion bu on
•Th ough he API, PayPal does he co esponding ope a ions o c ea e he o -
de , and e u ns a JSON con aining ei he an e o , i he e is any, o some
in o ma ion abou he ope a ion.
•The clien ecei es he esponse and p in s in he p omp he e o o he da a
ecei ed. Among his da a, he e is an o de ID, iden i ying he o de jus
c ea ed.
•I he e is no e o , he clien sends a cap u e-o de pe i ion.
•The se e lis ens o he pe i ion and makes a call o he PayPal API. The access
oken and a ibu ion ID o he pla o m a e sen wi h he call, along wi h he
o de ID, ha iden i ies he o de .
•Th ough he API, PayPal does he co esponding ope a ions o pe o m he
o de and e u ns whe he he e is an e o o i has been a success.
•The se e e u ns a s a e o success i e e y hing wo ked p ope ly o one o
e o i some hing wen w ong.
•The clien ecei es he esponse and ixes he sys em’s s a e o ei he success o
e o , so he on -end knows which sc een o show he use .
•The on -end p in s he co esponding sc een: a success sc een i e e y hing
wo ked p ope ly and an e o sc een i some hing wen w ong.
5.4 Conclusions
The implemen a ion o a cen alized solu ion was he i s app oach o he p ojec .
I is an in e es ing app oach, since cen alized paymen s a e mos common nowadays
in he con ex o online dona ions and paymen s in gene al. Fo his eason, hey do
no pose a big challenge o he use s o o e come, since hey a e al eady used o his
kind o sys ems (unlike newe o mo e inno a i e paymen sys ems, whe e adap a ion
could be ha de ).
Ano he eason o his app oach o be aken i s was he ac ha he e is plen y
o in o ma ion, documen a ion and suppo o he de elopmen o sys ems ha use
hese echnologies (such as PayPal), o hey a e e y popula and ha e a big use and
44 Chap e 6. Decen alized Implemen a ion
Figu e 6.5: Web Mone iza ion scheme
The websi e speci ies in a me a ag in i s h ml code ha i will allow Web Mone iza ion
paymen s and he paymen poin e ha will ecei e said paymen s. This paymen
poin e poin s o he web’s walle , which is p o ided by a Web Mone iza ion ecei e .
This ecei e is an en i y ha can ecei e In e ledge paymen s in behal o he use .
In his pa icula case, he In e ledge paymen s a e sen using Web Mone iza ion.
This ecei e is connec ed o he ILP ne wo k, so i is capable o ecei ing paymen s
sen by any o he en i y in he ne wo k.
On he o he side o he ansac ion is he use ha isi s he page. The use does
so om a ce ain b owse ha has a b owse ex ension ins alled which allows o send
Web Mone iza ion paymen s. This b owse ex ension in connec ed o he use ’s walle ,
which is p o ided by a Web Mone izai on sende o p o ide . This sende is an en i y
ha can send In e ledge paymen s in behal o he use . In his pa icula case, he
In e ledge paymen s a e sen using Web Mone iza ion.
As he ecei e , his sende is also connec ed o he ILP ne wo k, so i is capable o
sending paymen s o any o he en i y in he ne wo k.
When he use en e s a websi e ha is webmone ized, he b owse , h ough he
b owse ex ension, iden i ies he me a ag ha indica es ha he websi e can ecei e
Web Mone iza ion paymen s and eads he paymen poin e o which he paymen s
need o be sen . The ex ension uses his in o ma ion o make he WM sende issue a
paymen o ha paymen poin e .
6.3.1 Flow
This p ocess o sending Web Mone iza ion paymen s can be be e unde s ood by
s udying he low o he p ocess s ep by s ep. Figu e 6.6 shows a sequence diag am o

6.4. QTZ: An ERC20 oken 45
Figu e 6.6: Sequence diag am o a paymen using Web Mone iza-
ion[62]
a paymen sen using Web Mone iza ion.
I is assumed ha he websi e has Web Mone iza ion enabled. The low o he
paymen is as ollows [62]:
•The b owse pa ses he code o he web page looking o he me a ag and, i i
exis s, o he paymen poin e o whe e he money needs o be sen .
•The b owse calcula es he app op ia e amoun o send o he websi e pe uni
o ime.
•In o de o keep he anonymi y o he use isi ing he websi e, he b owse
gene a es a unique session ID o ha speci ic session.
•To also keep he isi ed si es anonymous, he b owse also ge s a unique des i-
na ion add ess o he websi e’s paymen poin e , as well as a sha ed sec e o
he session.
•Op ionally, a paymen eceip e i ie can gene a e eceip o he ope a ion.
•While he websi e is s ill in ocus, he b owse begins sending paymen s o he
websi e (a he a e calcula ed a he beginning).
•The Web Mone iza ion p o ide sends he money o he ecei e ia In e ledge .
•Op ionally, he ecei e can gene a e a eceip and send i o he p o ide .
•The Web Mone iza ion p o ide no i ies he websi e he paymen was sen suc-
cess ully.
•The b owse sends an e en o he websi e, indica ing he paymen was success-
ul.
•Op ionally, he web page can send he eceip o he eceip e i ie o con i m
he paymen .
6.4 QTZ: An ERC20 oken
In e ledge can p o ide connec ions o pe o m paymen s om any cu ency o pay-
men sys em o any o he one in exis ence, as long as hey a e co ec ly connec ed
o he ne wo k. In his con ex , an ERC20 Qua z oken was implemen ed (ERC20
46 Chap e 6. Decen alized Implemen a ion
okens a e de ined in a p e ious chap e , in Sec ion 3.2.2. The ad an ages and uses
o he Qua z Token a e also explained in a p e ious chap e , in Sec ion 4.1.5).
In o de o be able o ei he make dona ions using he oken so ha he ecei e
ecei es ano he cu ency o ice- e sa, he oken has o be made compa ible wi h
he In e ledge ne wo k. Fo he scope o his p ojec , es s we e made in a simple
In e ledge ne wo k, he one desc ibed in Sec ion 6.2.2.
Since his new Qua z coin (QTZ) is an ERC20 oken, and ERC20 is a oken s anda d,
he p ocess he e desc ibed o including QTZ in an In e ledge ne wo k can be i ially
adap ed o any o he ERC20 oken.
Also, being QTZ an ERC20 oken, i is deployed o e an E he eum ne wo k. Fo his
eason, i is possible o adap he scheme desc ibed in Sec ion 6.2.2 o i his new
coin. E he eum se lemen engines can be used o se le be ween nodes using QTZ.
The i s s ep o in eg a ing he oken is c ea ing and deploying he con ac s o he
oken i sel . The code has been adap ed om he OpenZeppelin con ac s [44]. In he
con igu a ion o he con ac s i is necessa y o ix he hos o he IP o he E he eum
ne wo k whe e he oken should be deployed. In he case o hese es s, an E he eum
es ne . Then, he con ac s a e compiled and deployed o he ne wo k. Once his is
done, he oken will exis wi hin he E he eum ne wo k, being he e o e possible o
pe o m ansac ions using i wi hin said ne wo k.
The nex s ep is con igu ing he E he eum se lemen engines, so hey a e able o se le
using he co ec oken. This is achie ed by se ing he oken add ess o he se lemen
engine o he one o he oken jus deployed. This is, indica ing he se lemen engine
ha , om all o he okens ha may exis in he E he eum ne wo k, QTZ is he one
ha i has o use o he se lemen s.
In o de o QTZ o be exchanged o o he cu encies o okens, he exchange a es
ha e o be ixed. In he example ne wo k used in Sec ion 6.2.2, he connec o ha
exchanged ETH o XRP (and ice- e sa) consul ed he exchange a es om he
exchange pla o m Coinbase2. This is no ex ensible o he new oken, o none o
hese exchange pla o ms know i s alue. Howe e , he a es can be se manually o
he In e ledge ne wo k using he In e ledge API. In he es ne wo k o he p ojec ,
only QTZ and XRP a e used, so only hose wo a es ha e o be ixed.
When c ea ing he accoun s inside he In e ledge nodes, he asse each accoun uses
mus be se . In his case, Alice will be using QTZ ins ead o ETH, as she was using
in he p e ious es ne wo k.
Finally, he paymen s can be pe o med. To pe o m a paymen om Alice (in QTZ)
o Cha lie (in XRP), i is only necessa y o indica e he quan i y, Cha lie’s paymen
poin e and Alice’s passwo d.
The p ecise p ocess used o c ea ing a oken, deploying i and in eg a ing i wi h he
ILP ne wo k is explained in de ail in Appendix A. I con ains all he commands and
s eps necessa y o ec ea e he ne wo k and he exchange.
6.5 Implemen a ion de ails
Now ha he decen alized echnologies (In e ledge and Web Mone iza ion) ha e
been p ope ly explained, he implemen a ion i sel can be desc ibed in de ail.
2h ps://www.coinbase.com/es/
6.5. Implemen a ion de ails 47
Figu e 6.7: A chi ec u e o he sys em. Highligh ed in g een is he
decen alized pa .
This sec ion will explain he a chi ec u e o he decen alized sys em o he Qua z
applica ion, i s low and some o he implemen a ion de ails ha a e key o unde -
s anding he ull implemen a ion.
6.5.1 A chi ec u e
The In e ledge a chi ec u e (see 6.2.2) is a co e pa o he p ojec , o he applica ion
is buil o e i and in eg a ed wi h i . None heless, he applica ion has mo e laye s,
in o de o allow a simple in e ac ion be ween he use and he unde lying sys em.
Figu e 6.7 shows he di e en laye o he sys em. Highligh ed in g een a e he ones
co esponding o he decen alized subsys em. As explained in Sec ion 5.3, he use
in e ace is common o bo h he cen alized and he decen alized pa o he sys em,
and each o he subsys ems has i s own lowe laye s, in bo h cases based on a se e -
clien model.
In his sec ion, he decen alized pa will be analyzed.
As he igu e shows, he mos ex e nal laye is he UI (use in e ace), which is is he
laye ha manages he in e ac ion be ween he use and he applica ion. I is he
exac same laye ha was used in he cen alized case, and i is implemen ed using
Reac JS and ma e ial-ui.
This laye connec s wi h he clien s o bo h he cen alized and he decen alized
subsys ems. In he case o he decen alized subsys em, he clien ecei es he da a
inpu s ha he use en e s ia he UI and makes a GET eques o he se e , indi-
ca ing he necessa y da a o he ansac ion. This code is also implemen ed using
Reac JS.
The se e makes calls o he In e ledge API by sending POST eques s, using he
in o ma ion ecei ed o m he clien . The code o he se e is implemen ed using
Ja aSc ip and i uns on Node.js.
48 Chap e 6. Decen alized Implemen a ion
Figu e 6.8: O e iew o he decen alized subsys em.
The In e ledge API is he access laye h ough which he unc ionali ies o he ILP
ne wo k a e accessed. The In e ledge sys em is he deepes laye o he sys em, and
i is he one in cha ge o managing he shipmen o he money, as well as he balance
checks and o he ope a ions.
6.5.2 Implemen a ion
In he con ex o he p ojec , a es ne wo k was deployed o implemen his a chi-
ec u e. The es ne wo k (which is a a ia ion o he one desc ibed in sec ion 6.2.2)
simula es a small bu comple e In e ledge ne wo k wi h a node ha ansac s using
he QTZ oken.
Figu e 6.8 shows an o e iew o he en i e decen alized subsys em, including he es
ne wo k.
To simula e his es ne wo k locally, Docke (see Sec ion 3.6.1) was used. Docke can
be used o c ea e a ne wo k locally by simula ing se e al in e connec ed machines.
Each machine will un a di e en se ice o applica ion, hus c ea ing a simula ed
In e ledge ne wo k ha can be un locally.
The de ailed p ocess and code o c ea ing such ne wo k is explained in de ail in
Appendix A. The appendix shows he p ocess in a low-le el manne . Now his sec ion
will elabo a e on he p ocess a a high le el.
Fi s , a docke ne wo k is c ea ed. I will be e e ed as local-ilp om now on.
Then, se e al docke con aine s a e deployed, each one se ing a di e en pu pose. A
docke con aine con ains Redis, which is a da abase o he se lemen engines and
6.5. Implemen a ion de ails 49
he nodes, ha will la e be deployed. This da abase can be accessed by he se ices
deployed in he es o he con aine s.
Ano he docke con ains an E he eum es ne , ha in his ins ance is ini ia ed wi h
a p ede ined seed, so ha he public and p i a e keys o he accoun s a e he same
e e y ime he ne wo k is edeployed. This is no necessa y, bu i simpli ies he
implemen a ion and es ing p ocess.
Then, he QTZ oken is implemen ed and deployed in his E he eum ne wo k ha
has been c ea ed in a docke con aine . This way, he oken can be accessed om he
di e en nodes ha a e connec ed o his ne wo k. I is impo an o ake in o accoun
ha he oken’s con ac has a ce ain add ess associa ed o i once i is deployed in
he ne wo k. This add ess will be impo an la e , when he nodes ha use he coin
a e c ea ed.
The nex s ep is deploying he nodes and hei co esponding se lemen engines. As
explained in p e ious sec ions, se lemen engines a e en i ies ha allow wo in e -
connec ed nodes o se le wi h one ano he , his is, make an i e ocable exchange o
unds be ween he wo.
Th ee nodes a e c ea ed. This ex will e e o he nodes wi h he same names ha
we e used o he deploymen shown in Appendix A: Alice, Bob and Cha lie. These
names a e used o simplici y, and ep esen he nodes as desc ibed in Figu e 6.2 3.
Fi s , Alice’s node is c ea ed. Alice’s node only ope a es wi h QTZ. The e o e, wo
docke con aine s ha e o be deployed: one o he node i sel and one o he E he eum
se lemen engine ( o he QTZ oken uns o e an E he eum ne wo k).
In o de o deploy he E he eum se lemen engine, i is necessa y o ell he docke
con aine o wo k inside he local-ilp ne wo k. Inside he con aine , he se ice co e-
sponding o he E he eum se lemen engine is deployed and some impo an pa am-
e e s a e passed o he se ice, such as:
•The URL o he E he eum es ne .
•The add ess o he QTZ oken.
•The URL o he co esponding node (indica ing he po o which he se le-
men engine will connec o). In his case, he URL o Alice’s node and he
co esponding po .
•The numbe o decimal posi ions he oken is ep esen ed wi h.
Among o he s.
Then, Alice’s node is deployed. In his case, he con aine uns a se ice mean o
ilp nodes, and se e al pa ame e s a e passed o he se ice, such as:
•The ILP add ess o he node.
•A passwo d o he node.
•The po h ough which i connec s wi h he se lemen engine.
Among o he s.
The p ocedu e o Bob’s and Cha lie’s nodes is simila . In he case o Cha lie’s node,
i is a node ha only ope a es wi h XRP (Ripple), so he se lemen engine ha has
o be ini ia ed is an XRP se leme engine (i is di e en han he E he eum one).
3When compa ed wi h Figu e 6.8,Alice co esponds o Qua z node;Bob co esponds o Connec-
o node and Cha lie co esponds o Recei e node.

50 Chap e 6. Decen alized Implemen a ion
Bob’s node, on he o he hand, is a connec o ha ope a es wi h bo h QTZ and XRP,
so i has o be able o se le wi h bo h cu encies. The e o e, wo se lemen engines
ha e o be deployed o Bob: one o E he eum and one o XRP. No e ha he
se lemen engines depend on he ne wo k, no he cu ency. Fo his eason, he e is
no an speci ic QTZ se lemen engine, bu an E he eum one.
Cha lie’s and Bob’s nodes a e hen c ea ed in a simila way Alice’s node was.
Fo all his nodes and se lemen engines, i is impo an o speci y a ixed ip, ha
has o be di e en o each one o hem. I is also impo an o indica e, o e e y one
o hem, ha he docke ne wo k hey wo k in is local-ilp.
Finally, he di e en accoun s a e c ea ed wi hin he nodes. These accoun s a e he
ones ha allow he nodes o communica e wi h one ano he , send he packe s and,
e en ually, make he economic exchanges.
Alice will be he node ha issues he paymen , Cha lie he one ha ecei es i and
Bob will ac as a connec o be ween he wo o make he cu ency exchange. This
way, i is necessa y o c ea e in Alice’s and Bob’s nodes he espec i e sende and
ecei e accoun s. This way, an Alice accoun will be c ea ed in Alice’s node and a
Cha lie accoun will be c ea ed in Cha lies node.
Now, in o de o a node o be able o communica e wi h ano he one, i has o ha e
an accoun inside he node i wan s o communica e wi h. This accoun s is no a usual
accoun o s o ing unds, bu i s goal is o allow communica ion be ween he nodes.
This way, a Bob accoun is c ea ed in Alice’s node; an Alice and a Cha lie accoun
a e c ea ed in Bob’s node and a Bob accoun is c ea ed in Cha lie’s node. This is,
in addi ion o he Alice accoun in Alice’s node and he Cha lie accoun in Cha lie’s
node.
Wi h his gene al knowledge o he a chi ec u e, i is now possible o explain in de ail
he sequence o calls among he di e en laye s o he sys em.
6.5.3 Flow
The applica ion ollows a simple clien -se e s uc u e: The clien eads and manages
he op ions o he use ’s dona ion and sends he se e he necessa y in o ma ion o
ope a e. The se e lis ens o pe i ions ega ding he paymen s and pe o ms he API
calls.
I wo ks in a simila way o wha was buil o he PayPal paymen s, bu ins ead o
calling PayPal o pe o m he paymen s, he ILP p ocess is called in i s place.
Figu e 6.9 con ains a sequence diag am illus a ing he a chi ec u e. The low o a
paymen would be as ollows:
•The use se s he quan i y hey wan o dona e and p ess he “Pay” bu on.
•The use is hen asked o au hen ica e using i s In e ledge c eden ials ( hese
being accoun and passwo d). And he e is also an op ion o choose he node
in which he use has he accoun . Fo he pu pose o he p ojec , use s a e
supposed o ha e an accoun in Qua z’s node.
•The clien sends a pe i ion o a paymen , con aining he use , he ecei e ’s
paymen poin e and he amoun as pa ame e s and he passwo d as a heade .
The passwo d is sen as a heade ins ead o a pa ame e o secu i y easons.
6.5. Implemen a ion de ails 51
Use UI Clien Se e API In e ledge
Inse (amoun )
P ess(PAY)
Show au hen ica ion o m
Inse (c eden ials)
P ess(OK)
Pay
Pay(poin e , acc, amoun )
POST(Paymen ) Send amoun om
sende o ecei e
Ful illed
OK
S a us 200
P in success sc een
Show success sc een
Figu e 6.9: Sequence diag am o he In e ledge paymen bu on
•The se e lis ens o he pe i ion and makes a call - in he o m o a POST
pe i ion - o he In e ledge ’s API. The pa ame e s and heade s ecei ed om
he clien a e used o his call.
•In case o an e o , he se e e u ns he heade s and he ype o e o s, and
p in s hem in he command-line.
•In case o success, i e u ns a s a us code o 200, which means e e y hing wo ked
co ec ly.
•The clien ecei es he esponse and ixes he sys em s a e o success o e o .
This way, he on -end (o UI) can show he co esponding sc een: e o o
success sc een.
6.5.4 Web Mone iza ion
The sys em also in eg a es wi h Web Mone iza ion. The a chi ec u e o Web Mone-
iza ion paymen s is explained in de ail in Sec ion 6.3.
This in eg a ion is done in wo pa s:
Fi s o all, when he Qua z bu on is included in he web page o a jou nal, i
au oma ically modi ies he code o he head o he websi e o include he me a ag.
This way, i enables Web Mone iza ion paymen s in he websi e.
Mo eo e , he e is a second laye o he in eg a ion, in e ms o he In e ledge ne -
wo k. The way his wo ks is ha he Qua z node in he ILP ne wo k can se e as a
Web Mone iza ion ecei e o a Web Mone iza ion p o ide .
Fo example, by speci ying in he me a ag o he websi e a paymen poin e p o ided
by he Qua z node - his is, a paymen poin e o an accoun ha exis s wi hin he
Qua z node -, he websi e, in his case he jou nal, can ecei e mic opaymen s in
QTZ.
53
Chap e 7
Conclusions and Fu u e Wo k
Rega ding all he p e ious wo k explained in p io chap e s, conclusions a e gi en and
some sugges ions a e laid ou o be ca ied ou in he u u e.
7.1 Conclusions
This p ojec was aimed o explo ing how dona ions o jou nals and au ho s can be
implemen ed in a p ac ical way, and how decen aliza ion can be applied o he ask.
In pa icula , explo ing he In e ledge P o ocol as a echnology o achie e hese goals.
The angible ou come o his p ojec has been a unc ioning web app ha p o ides
unc ionali y o sending dona ions by di e en means. As exposed in he Objec i es
(see 1.1), hese means a e:
•Via a cen alized paymen sys em (PayPal was used).
•Via a decen alized paymen sys em, using any cu ency, including a speci ic
coin c ea ed o dona ions o jou nals (In e ledge was used).
•Via mic odona ions, using a b owse ex ension (Web Mone iza ion was used)
In his sense, he de elopmen goals we e achie ed.
A mo e in angible ou come, ye a main one, has been he s udy o di e en echnologies
and he design o an a chi ec u e o in eg a ing bo h cen alized and decen alized
paymen sys ems in a single applica ion. Bo h app oaches ha e ad an ages and d aw-
backs, bu one in e es ing esul o his wo k is ha i is possible o implemen a ully
decen alized solu ion ha allows o use di e en ypes o cu encies and okens.
The nex subsec ions will p o ide de ail abou all hese aspec s.
7.1.1 Func ionali y and in eg a ion
F om a p ac ical poin o iew, he goal o he p ojec was de eloping an applica ions
ha p o ides he unc ionali ies p e iously desc ibed, by in eg a ing wi h he di e en
used echnologies.
A a unc ional le el, a bu on has been de eloped. This bu on can in eg a e wi hin
he web pages o he jou nals and p o ides hem wi h he h ee main unc ionali ies:
•Wi h ega d o he cen alized paymen s, a bu on is p esen ed ha allows he
use o make paymen s ia PayPal, using a PayPal accoun o a c edi ca d.
•Wi h ega d o he decen alized paymen s, a bu on is p esen ed ha allows
he use o make paymen s ia In e ledge using he use ’s In e ledge walle .
60 Appendix A. Run a local ILP es ne using he Qua z oken
docke un -d
--name e he eum- es ne
--ne wo k local-ilp
--ip 192.168.128.2
u lesui e/ganache-cli
-m "abs ac acuum mammal awkwa d pudding scene penal y
pu chase dinne depa e oke puzzle"
-i 1
A.2.3 C ea e he oken
The code o he Qua z oken is a ailable inside he eposi o y o he TFG. I you
download he code om he eposi o y, his sec ion is no needed, and you should skip
o he nex one, sec ion A.2.4.
I you ha e no downloaded he eposi o y, hen ollow he ins uc ions in his sec ion
o c ea e he con ac s o he oken.
The oken mus be deployed in he local e he eum es ne ( ha is unning inside he
con aine e he eum- es ne ).
In he command line, do he ollowing:
mkdi my oken && cd my oken
npm ini -y
npm i --sa e-de @openzeppelin/con ac s
npm i u le -g
npx u le ini
The u le-con ig.js ile mus be modi ied adding a new ne wo k inside ne wo ks.
This new ne wo k will be called docke and will be as ollows:
module.expo s = {
ne wo ks: {
docke : {
hos : "192.168.128.2",
po : 8545,
ne wo k_id: "*" // Ma ch any ne wo k id
}
}
};
Whe e hos is he ip o he E he eum ne wo k ha we a e using (in his case, he
es ne e he eum- es ne ).
C ea e a new con ac inhe i ing om ERC20 and implemen ing he new oken.
Once ha is done, w i e a sc ip o he deploymen o he con ac and add i o he
/mig a ions olde (in his ins ance, his will be o deploying he Qua z oken).
In his deploymen sc ip , he necessa y pa ame e s o ini ialize he con ac mus be

A.2. P ocess 61
p o ided (in his case, he amoun o okens ha will be min ed when he con ac is
deployed).
In u le-con ig.js, change he compile e sion o 0.6.12. Keep an eye in
he Solidi y e sions. The sou ce iles cu en ly wo k o Solidi y e sions >=0.6.0
<0.8.0, bu his could possibly change.
A.2.4 Deploy he oken
I he code o he oken was downloaded om he Gi Hub eposi o y, i is necessa y
o i s do an npm ins all. I he code was gene a ed as explained in he p e ious
sec ion, i is no necessa y o do so.
Then, in bo h cases, p oceed by compiling he con ac s:
u le compile
Then, mig a e he con ac s o he docke ne wo k:
u le mig a e --ne wo k docke
Copy he con ac add ess ha has been gene a ed. This will be la e used when
ini ializing he docke s o he e he eum nodes.
Open he T u le console in he docke ne wo k:
u le console --ne wo k docke
Now ha he con ac has been deployed, i can be accessed and in e ac ed wi h by
assigning he con ac ins ance o a a iable.
le qua z = awai ERC20Qua z.deployed()
This ope a ion can only be pe o med by he issue o he con ac . Fo anybody else
wi h access o he ne wo k o ha e an ins ance o he con ac o in e ac wi h, hey
mus be p o ided he add ess o he con ac , so hey can do:
le qua z = awai ERC20Qua z.a (<con ac add ess
in quo es>)
The con ac add ess can be consul ed by doing:
qua z.add ess
To check he accoun s exis ing wi hin he blockchain ( o make a ansac ion o one o
hem o consul hei balance) hey can be consul ed om he T u le console:
accoun s
I he ini ializa ion o he con ac wo ked co ec ly, he i s o he accoun s, which
co esponds o he issue (and will be la e assigned o Alice) should ha e all he
okens ha ha e been min ed in he ini ializa ion.
le balance = awai qua z.balanceO (<public add ess o he
i s accoun >)
balance. oNumbe ()
62 Appendix A. Run a local ILP es ne using he Qua z oken
oNumbe is necessa y so he in o ma ion is displayed in a na u al way.
A.2.5 S a he ILP nodes
Following he ILP u o ial, ini ialize he nodes. A couple conside a ions ha e o be
made:
•The oken_add ess is he add ess o he ERC20Qua z con ac .
•The ip’s o he nodes a e ixed, based on he ip o he local e he eum es ne
( his ini ial ip can be checked om he console o he docke whe e he ne wo k
is unning). In his case, he ip o he ne wo k was se manually.
•The asse scale is ixed o 9.
•The exchange a e is p o ided by he API, so he pa ame e exchange_ a e.p o ide
is dele ed.
docke un -d
--name alice-e h
--ne wo k local-ilp
-e "RUST_LOG=in e ledge = ace"
--ip 192.168.128.3
in e ledge s/ilp-se lemen -e he eum
--p i a e_key 380eb0 3d505 087e438eca80bc4d 9a7
aa24 868e69 c0440261a0 c0567dc
--con i ma ions 0
--poll_ equency 1000
--e he eum_u l h p://e he eum- es ne :8545
-- oken_add ess 0x770bC1820890415bB14a3B8 992c19caA74906aD
--connec o _u l h p://alice-node:7771
-- edis_u l edis:// edis:6379/0
--asse _scale 9
--se lemen _api_bind_add ess 0.0.0.0:3000
docke un -d
--name alice-node
--ne wo k local-ilp
-e "RUST_LOG=in e ledge = ace"
--ip 192.168.128.4
in e ledge s/ilp-node
--ilp_add ess example.alice
--sec e _seed 8852500887504328225458511465394229
327394647958135038836332350604
--admin_au h_ oken hi_alice
-- edis_u l edis:// edis:6379/1
--h p_bind_add ess 0.0.0.0:7770
--se lemen _api_bind_add ess 0.0.0.0:7771
docke un -d
--name bob-e h
--ne wo k local-ilp
-e "RUST_LOG=in e ledge = ace"
--ip 192.168.128.5
A.2. P ocess 63
in e ledge s/ilp-se lemen -e he eum
--p i a e_key cc96601bc52293b53c4736a12a 9130ab 3
47669b3813 9ec4ca d 6991b087e
--con i ma ions 0
--poll_ equency 1000
--e he eum_u l h p://e he eum- es ne :8545
-- oken_add ess 0x770bC1820890415bB14a3B8 992c19caA74906aD
--connec o _u l h p://bob-node:7771
-- edis_u l edis:// edis:6379/2
--asse _scale 9
--se lemen _api_bind_add ess 0.0.0.0:3000
docke un -d
--name bob-x p
--ne wo k local-ilp
-e "DEBUG=se lemen *"
-e "CONNECTOR_URL=h p://bob-node:7771"
-e "REDIS_URI= edis:// edis:6379/3"
-e "ENGINE_PORT=3001"
--ip 192.168.128.6
in e ledge js/se lemen -x p
docke un -d
--name bob-node
--ne wo k local-ilp
-e "RUST_LOG=in e ledge = ace"
--ip 192.168.128.7
in e ledge s/ilp-node
--ilp_add ess example.bob
--sec e _seed 16049667259821399005552084586370228
75563691455429373719368053354
--admin_au h_ oken hi_bob
-- edis_u l edis:// edis:6379/4
--h p_bind_add ess 0.0.0.0:7770
--se lemen _api_bind_add ess 0.0.0.0:7771
docke un -d
--name cha lie-x p
--ne wo k local-ilp
-e "DEBUG=se lemen *"
-e "CONNECTOR_URL=h p://cha lie-node:7771"
-e "REDIS_URI= edis:// edis:6379/5"
-e "ENGINE_PORT=3000"
--ip 192.168.128.8
in e ledge js/se lemen -x p
docke un -d
--name cha lie-node
--ne wo k local-ilp
-e "RUST_LOG=in e ledge = ace"
64 Appendix A. Run a local ILP es ne using he Qua z oken
--ip 192.168.128.9
in e ledge s/ilp-node
--sec e _seed 12323621311221399005552084586370228
75563691455429373719368053354
--admin_au h_ oken hi_cha lie
-- edis_u l edis:// edis:6379/6
--h p_bind_add ess 0.0.0.0:7770
--se lemen _api_bind_add ess 0.0.0.0:7771
Nex , change he exchange a es o he new coin using he API:
cu l -X PUT "h p://192.168.128.4:7770/ a es"
-H "Au ho iza ion: Bea e hi_alice"
-H "accep : applica ion/json"
-H "Con en -Type: applica ion/json"
-d "{ "QTZ ":1.00, "XRP ":0.000283}"
cu l -X PUT "h p://192.168.128.7:7770/ a es"
-H "Au ho iza ion: Bea e hi_bob"
-H "accep : applica ion/json"
-H "Con en -Type: applica ion/json"
-d "{ "QTZ ":1.00, "XRP ":0.000283}"
cu l -X PUT "h p://192.168.128.9:7770/ a es"
-H "Au ho iza ion: Bea e hi_cha lie"
-H "accep : applica ion/json"
-H "Con en -Type: applica ion/json"
-d "{ "QTZ ":1.00, "XRP ":0.000283}"
A e ha , c ea e he accoun s. Also he e, a couple conside a ions ha e o be aken:
•In he Alice and Bob accoun s ha used ETH in he example, he asse code is
now QTZ.
•The asse -scale is now 0.
alias alice-cli="docke un -- m
--ne wo k local-ilp in e ledge s/ilp-cli
--node h p://alice-node:7770"
alias bob-cli="docke un -- m
--ne wo k local-ilp in e ledge s/ilp-cli
--node h p://bob-node:7770"
alias cha lie-cli="docke un -- m
--ne wo k local-ilp in e ledge s/ilp-cli
--node h p://cha lie-node:7770"
alice-cli accoun s c ea e alice
--au h hi_alice
--ilp-add ess example.alice
--asse -code QTZ
--asse -scale 9
--ilp-o e -h p-incoming- oken alice_passwo d
alice-cli accoun s c ea e bob
--au h hi_alice
A.2. P ocess 65
--ilp-add ess example.bob
--asse -code QTZ
--asse -scale 9
--se lemen -engine-u l h p://alice-e h:3000
--ilp-o e -h p-incoming- oken bob_passwo d
--ilp-o e -h p-ou going- oken alice_passwo d
--ilp-o e -h p-u l h p://bob-node:7770/accoun s/
alice/ilp
--se le- h eshold 100000
--se le- o 0
-- ou ing- ela ion Pee
bob-cli accoun s c ea e alice
--au h hi_bob
--ilp-add ess example.alice
--asse -code QTZ
--asse -scale 9
--max-packe -amoun 100000
--se lemen -engine-u l h p://bob-e h:3000
--ilp-o e -h p-incoming- oken alice_passwo d
--ilp-o e -h p-ou going- oken bob_passwo d
--ilp-o e -h p-u l h p://alice-node:7770/accoun s/
bob/ilp
--min-balance -150000
-- ou ing- ela ion Pee
bob-cli accoun s c ea e cha lie
--au h hi_bob
--asse -code XRP
--asse -scale 6
--se lemen -engine-u l h p://bob-x p:3001
--ilp-o e -h p-incoming- oken cha lie_passwo d
--ilp-o e -h p-ou going- oken bob_o he _passwo d
--ilp-o e -h p-u l h p://cha lie-node:7770/accoun s/
bob/ilp
--se le- h eshold 10000
--se le- o -1000000
-- ou ing- ela ion Child
cha lie-cli accoun s c ea e bob
--au h hi_cha lie
--ilp-add ess example.bob
--asse -code XRP
--asse -scale 6
--se lemen -engine-u l h p://cha lie-x p:3000
--ilp-o e -h p-incoming- oken bob_o he _passwo d
--ilp-o e -h p-ou going- oken cha lie_passwo d
--ilp-o e -h p-u l h p://bob-node:7770/accoun s/
cha lie/ilp
--min-balance -50000
-- ou ing- ela ion Pa en

66 Appendix A. Run a local ILP es ne using he Qua z oken
cha lie-cli accoun s c ea e cha lie
--au h hi_cha lie
--asse -code XRP
--asse -scale 6
--ilp-o e -h p-incoming- oken cha lie_passwo d
A.2.6 Pe o m he paymen
Send a ce ain amoun o okens om Alice o Cha lie (in his example, 20):
alice-cli pay alice
--au h alice_passwo d
--amoun 20
-- o h p://cha lie-node:7770/accoun s/cha lie/spsp
A.2.7 Dele e he nodes and s a o e
Only dele ing he nodes, bu keeping he ne wo k
Dele e he accoun s:
alice-cli accoun s dele e alice --au h hi_alice
alice-cli accoun s dele e bob --au h hi_alice
bob-cli accoun s dele e alice --au h hi_bob
bob-cli accoun s dele e cha lie --au h hi_bob
cha lie-cli accoun s dele e bob --au h hi_cha lie
cha lie-cli accoun s dele e cha lie --au h hi_cha lie
Remo e he docke s:
docke s op alice-node bob-node cha lie-node alice-e h
bob-e h bob-x p cha lie-x p
docke m alice-node bob-node cha lie-node alice-e h
bob-e h bob-x p cha lie-x p
Remo e e e y hing
Some imes emo ing he nodes bu keeping he ne wo k esul s in some issues when
dele ing he accoun s. When his happens, he bes op ion is o emo e e e y hing
and s a he p ocess om sc a ch.
docke s op edis e he eum- es ne alice-node bob-node
cha lie-node alice-e h bob-e h bob-x p
cha lie-x p
docke m edis e he eum- es ne alice-node bob-node
cha lie-node alice-e h bob-e h bob-x p
cha lie-x p
docke ne wo k m local-ilp
67
Appendix B
Pe o m ansac ions using he
se e
B.1 In oduc ion
This appendix con ains he de ailed s eps o pe o ming ansac ions h ough an ILP
ne wo k using a se e o handle he shipmen pe i ions.
The se e 1accep s pe i ions o send a ce ain amoun o Qua z om a gi en accoun
o ano he . I is assumed ha all he accoun s ha send he money a e in he same
hos .
B.2 P ocess
B.2.1 Se up he en i onmen
To s a using he se e , he e has o be an ILP ne wo k unning. The sende and
he ecei e accoun s ha e o exis wi hing said ne wo k.
As a es , he local ILP docke ne wo k ha was deployed in he p e ious appendix
(see Appendix A) will be used.
I is assumed ha he eade has al eady downloaded he code o he se e om he
eposi o y.
B.2.2 Con igu e he se e
Copy he ile se e Con ig.json.example in o a new ile se e Con ig.json
and change he hos and he po whe e he accoun s ha send he money a e going
o be.
As p e iously explained, i is assumed ha he se e will be managing ansac ions
coming om accoun s in a pa icula hos , al hough he ecei e s could be anywhe e.
Fo he es wi h he docke ne wo k, he hos name and po a e:
{
"hos name": "192.168.128.4",
"po ": 7770
}
1The code o he se e can be ound in he Gi Hub eposi o y o he p ojec :
h ps://gi hub.com/ElenaPT/TFG_In _2021/ ee/incoming_b anch/s c/ oken/ILP_se e
68 Appendix B. Pe o m ansac ions using he se e
B.2.3 Run he se e
Be o e unning he se e , he ILP ne wo k has o be up and unning. Appendix ??
con ains ins uc ions o deploying a local ne wo k o es ing using docke .
Once ha is managed, simply do:
cd ILP_se e
node ansac ion_se e .js
B.2.4 Pe o m a ansac ion
The se e expec s he sende , he ecei e and he amoun o Qua z o be sen as
pa ame e s. I also needs he au ho iza ion- oken o he sende , and expec s i as a
heade .
Taking his in o accoun , o pe o m he ansac ion do a cu l pe i ion as ollows:
cu l "h p://localhos :8080/? om=<sende -accoun >
& o=< ecei e -paymen -poin e >&amoun =<amoun >"
-H "Au ho iza ion: Bea e <sende -au h- oken>"
Fo ins ance, o send 20 QTZ om Alice o Cha lie in he docke ne wo k, he pe i ion
would be:
cu l "h p://localhos :8080/? om=alice
& o=h p://cha lie-node:7770/accoun s/cha lie/spsp
&amoun =20" -H "Au ho iza ion: Bea e alice_passwo d"
69
Bibliog aphy
[1] Abdulla Alshamsi and P o . Pe e And as. “Use pe cep ion o Bi coin usabili y
and secu i y ac oss no ice use s”. In: In e na ional Jou nal o Human-Compu e
S udies 126 (June 1, 2019), pp. 94–110. issn: 1071-5819. doi:10 . 1016 /
j.ijhcs.2019.02.004.u l:h ps://www.sciencedi ec .com/
science/a icle/pii/S1071581918301459 ( isi ed on 09/04/2021).
[2] API eques s.u l:h ps : / / de elope . paypal . com / docs / api /
e e ence/api- eques s/ ( isi ed on 08/08/2021).
[3] Ca l T. Be gs om and Theodo e C. Be gs om. “The cos s and bene i s o li-
b a y si e licenses o academic jou nals”. In: P oceedings o he Na ional Academy
o Sciences 101.3 (Jan. 20, 2004). Publishe : Na ional Academy o Sciences Sec-
ion: Social Sciences, pp. 897–902. issn: 0027-8424, 1091-6490. doi:10.1073/
pnas.0305628101.u l:h ps://www.pnas.o g/con en /101/3/
897 ( isi ed on 09/02/2021).
[4] Bi Gi e Founda ion - 1s Bi coin and Blockchain Nonp o i . Bi Gi e Founda ion.
u l:h ps://www.bi gi e ounda ion.o g/ ( isi ed on 05/06/2021).
[5] Bo-Ch is e Bjö k. “Why Is Access o he Schola ly Jou nal Li e a u e So Ex-
pensi e?” In: po al: Lib a ies and he Academy 21.2 (2021). Publishe : Johns
Hopkins Uni e si y P ess, pp. 177–192. issn: 1530-7131. doi:10.1353/pla.
2021.0010.u l:h ps://muse.jhu.edu/a icle/787862 ( isi ed on
09/04/2021).
[6] Blockchain In as uc u e o Scien i ic Resea ch. Bloxbe g. u l:h ps://
bloxbe g.o g/ ( isi ed on 08/30/2021).
[7] Vi alik Bu e in. E he eum Whi epape . e he eum.o g. 2013. u l:h ps://
e he eum.o g ( isi ed on 05/30/2021).
[8] H. F ank Ce one. “Unde s anding agile p ojec managemen me hods using
Sc um”. In: OCLC Sys ems & Se ices: In e na ional digi al lib a y pe spec i es
27.1 (Jan. 1, 2011). Publishe : Eme ald G oup Publishing Limi ed, pp. 18–22.
issn: 1065-075X. doi:10 . 1108 / 10650751111106528.u l:h ps : / /
doi.o g/10.1108/10650751111106528 ( isi ed on 05/22/2021).
[9] Coil - A new way o enjoy con en .u l:h ps://coil.com/ ( isi ed on
04/29/2021).
[10] Digi al Walle and Paymen Poin e s.u l:h ps://webmone iza ion.
o g/docs/ilp-walle s ( isi ed on 05/31/2021).
[11] Nadia Eghbal. “Roads and B idges: The Unseen Labo Behind Ou Digi al
In as uc u e”. In: Technical Repo . Fo d Founda ion (2016), p. 143. u l:
h ps:/ / www . o d ounda ion . o g / wo k / lea ning / esea ch -
epo s/ oads- and- b idges- he- unseen- labo - behind- ou -
digi al-in as uc u e/.
[12] Empowe ing App De elopmen o De elope s | Docke .u l:h ps://www.
docke .com/ ( isi ed on 05/31/2021).
[13] Exp ess - In aes uc u a de aplicaciones web Node.js.u l:h ps://exp essjs.
com/es/ ( isi ed on 08/29/2021).