Browse Source

add README.md

master
nitowa 7 months ago
commit
b230212896
1 changed files with 45 additions and 0 deletions
  1. 45
    0
      README.md

+ 45
- 0
README.md View File

@@ -0,0 +1,45 @@
1
+## Beginning
2
+
3
+The story of this project begins with the appearance of [indImm](https://ndm-inf.github.io/ndm/main) in 2019. This tool allows users to upload files to the Ripple blockchain and then to view or download them via a web interface. The project stirred quite some [controversy](https://cryptocoindaddy.com/indimm-lets-you-upload-any-file-to-ripple-blockchain/) and was subsequently abandoned soon after.
4
+
5
+indImm fascinated me with its creative use of the blockchain, but disappointed with its slow speed, making it effectively useless as file storage. For illustration compare the time it takes to download a [2.5KB file](https://ndm-inf.github.io/ndm/viewFile/5C997A591A335A20CE7FCC5228946DA6364CFADFF86EB0A2AAA6A93DEB58B809-49108230) vs a [1MB file](https://ndm-inf.github.io/ndm/viewFile/1C3C9071FB02DAF7563A887BDBB6938B269913975362BB2A75AE853093923A16-49105849).
6
+
7
+## xrpIO and making things fast
8
+
9
+Mostly out of curiosity I set out to replicate and improve what indImm started. The corresponding library, [xrpIO](https://www.npmjs.com/package/xrpio), is today available as [open source](https://gitea.nitowa.xyz/npm-packages/xrpio) project under the MIT license.
10
+
11
+The watercooler pitch for xrpIO is quite simple: Since XRP transactions allow for up to 1kB of arbitrary data to be attached via a memo field, I can effectively write 1kB chunks of data to the Ripple blockchain by sending myself minimum-denominated payments. While the downloads in indImm evidently showed linear speed (hinting at a list-like implementation), xrpIO stores the hash-pointers as tree, increasing the speed by several magnitues.
12
+
13
+![xrpIO treewrite](https://i.imgur.com/G2HofSE.gif)
14
+
15
+## From I/O to application building
16
+
17
+My choice of TypeScript as programming language had the fortunate sideeffect of allowing xrpIO to be embedded into websites. The next idea was that I could encode a state change (i.e. function call), write the information with xrpIO and have the website update its state on the fly, based on the ordered application of these calls. Initial prototypes were successfully able to implement this idea, and this allowed me to use the Ripple blockchain as a quasi-database containing state changes. 
18
+
19
+Naturally, the next step was to standardize the protocol in order to reduce the implementation complexity. The resulting [open source](https://gitea.nitowa.xyz/nitowa/RJSVM) (MIT) [library](https://www.npmjs.com/package/rjsvm) was named RJSVM, the Ripple-JavaScript-Virtual-Machine.
20
+
21
+![RJSVM](https://i.imgur.com/Wpqp4yX.jpg)
22
+
23
+## Ripple as webserver
24
+
25
+Building and deploying such a RJSVM powered website with a client-based rendering framework brought me very close to what indImm is. The eureka moment came when I realized that websites are really nothing more than strings too, so they themselves can be written and read with xrpIO. This would mean that the frontend, application logic and state(-transitions) are all persistently stored on-chain, which although not exactly replicating smart contracts, becomes awfully close to being one. 
26
+
27
+An lot of engineering with [webpack](https://www.npmjs.com/package/webpack) later a functional prototype was created, and the very first fully blockchain-sourced website went live. You can view it under [caisar.github.io](https://caisar.github.io).
28
+
29
+<img src="https://i.imgur.com/7xH7oVX.jpg" alt="httXrp shoutbox" style="width:50%;height:50%"/>
30
+
31
+## Next steps
32
+
33
+The above proof of concept has one obvious weakness: browsers don't natively speak xrpIO, so a gateway webpage is necessary to download the application. This is what [caisar.github.io](https://caisar.github.io) is. While those gateway pages are able to be shipped with a minimal size [(about 1kB)](https://github.com/caisar/caisar.github.io) the technology still requires a webserver to serve these files statically. Obviously, the next step is to reinvent the browser, but instead of HTTP it speaks xrpIO.
34
+
35
+A prototype is available here: [The Tür browser](https://gitea.nitowa.xyz/nitowa/tur-browser/src/branch/master). 
36
+
37
+<img src="https://i.imgur.com/s1iuQme.png" alt="httXrp shoutbox" style="width:50%;height:50%"/>
38
+
39
+As the name heavily implies, the project is somewhat inspired by Tor. While Tor allows traffic to be masked completely, the hidden services themselves are a undeniable weakpoint, that once compromised allow an attacker to turn them into honeypots. Tür on the other hand makes very little effort to mask traffic (it is readable via the blockchanin by anyone) but the "server" is replicated on each Ripple (history)node, making it effectively uncensorable/impossible to capture without breaking the promises the blockchain itself makes (i.e. immutability of persisted transactions).
40
+
41
+The tür browser is undeniably still in an early prototypal stage. Next features would include
42
+
43
+- Key management: Right now any demonstrative RJSVM application just generates testnet wallets on launch. A mainnet-ready implementation would store wallet keys in the browser and safely expose I/O via a shared secure interface seperating webpages from the browser.
44
+- State storage: For now application state has to be recalculated on every application start. In the future there should be a way to checkpoint RJSVM state on disk to speed up loading time
45
+- The Tür name service (TNS): Hashes as resource identifiers are a workable solution, but they suffer from the same issue that IP addresses do in the internet. People can't remember them. Baking a nameservice RJSVM into the browser would be a natural improvement.

Loading…
Cancel
Save