I can do a little HTML and I can mess around a littble bit in existing code I take from others. I am just starting to learn and had only about 2 lessons so far. With a lot of trial and error, I can make a simple website, but that's about it. I still have a long long way to go in mastering the art of programming. But I am taking baby steps towards this goal. Inspired by the BitDB 2.0 from Unwriter (https://www.yours.org/content/introducing-bitdb-20-e8c17c845939) I just started working on a idea, but needless to say for now I am way over my head.
Anyway I started playing around with an idea to see how far I could take it. The idea is to host a simple HTML website on the bitcoin cash blockchain that easily could be viewed in a browser. In such a way that even my own mother is able to view it as if it was just an ordinairy website. Is there a use case? Does this even need blockchain? Well imagine if someone could publish sensitive information without the need for organisation’s such as WikiLeaks, readable as a ordinairy website for anyone in the world. This way anyone could publish information anonymous without endangering themselfs or any middleman. People like Julian Assange are hard to find nowadays, and I do not expect that there are many people who dare to take on such a role in the future. Freedom of expression, freedom of information, free journalism and a secure way to publish information for whistleblowers. This is the use case.
To see how far I could take this idea I made a very simple website in HTML and I included a snake game in JavaScript just to see if it would work. Lean and mean. This is how the site would look like.
Yes it is just snake but I renamed it Bitcoin Cash Hoarder, because it sound way cooler, and made it green and orange. I used https://www.cryptograffiti.info to upload the code to the blockchain. This is easy as pie. The best way to explain what happens is that just like with https://memo.cash, you make a OpReturn transaction where text is inserted, but since my text does not fit into a single transaction, it creates many transactions a bit similar to https://www.scale.cash (the stress test tool) and it inserts small pieces of text with each transaction until it is finished. Here you can see my transaction on a bitcoin cash explorer: https://explorer.bitcoin.com/bch/tx/fa69fb53bb45cd9df375f93f6cca52d044e4505eda5ce1b9504ae2c6a999ae27 The HTML code is now stored on the blockchain. Step 1 is easy, anyone could do this. But how can I extract this information from the blockchain and display it as a website. I hoped bitdb could help me with this problem. If you go to the bitdb explorer (https://bitdb.network/explorer) anyone should be able to extract the HTML code form the blockchain. This is the promise. As instructed on the bitdb website I used some standard code available and included the correct bitcoin cash address. This is the code I used for the query:
{ "v": 2, "q": { "find": { "in.e.a": "qqfse6sldawf742ydclj2n2uwgy7pxnd4ctlnph68a" }, "limit": 10 } }
When you paste this code in the bitdb explorer and run the query you are able to find my HTML code. Just look at “out” & “s2” and follow every box below. There it is.
But this is not even near being a website. Whatever I tried, I was not able to make the HTML more readable, let alone, display it in a browser. Just to say it again, I am a noob and lacking such skills. I did look into GitHub to see if the code of sites like memo and matter could help me out but I couldn’t make enough sense of it to replicate such a activity. I should actually should start with lesson 3 and 4 of my HTML course because I am stuck. Step 2 is a lot harder for me.
But not giving up yet and looking for a workaround. I went back to cryptograffiti.info to see if I could extract my code from the blockchain here. As you can see on this website it shows many text messages. Your text could become hard to find over time as new messages are posted. I also looked on GitHub for the code of cryptograffiti and after reading some instruction, I figured out a simple hack. Just put a # behind the URL and include the transaction ID of the original message. When you do this the website will only display your message. In my case that would be https://www.cryptograffiti.info/#fa69fb53bb45cd9df375f93f6cca52d044e4505eda5ce1b9504ae2c6a999ae27
Ok, there is my HTML code again and readable for the human eye. Still not a website but this is something. Now what? In a perfect world I would be able to find a piece of code online that would enable me to grab the message from this website and display's my HTML text as a website. I tried but I could not find any. It probably does exist but I did not find it.
Al that I can do for now to make my HTML code visable as website is to copy paste it in a document and store it as HTML file on my computer. If you open the file in a browser it does show the website as intented. As I made the code myself I know I can trust it. But this might not be the case for others. The safer way is to use a HTML test site. This way it is less likely you would accidently install some virus on your computer. Check out http://www.play-hookey.com/htmltest/ or https://www.w3schools.com/html/tryit.asp?filename=tryhtml_intro. Just copy past the code from www.cryptograffiti.info, place it into a html test side and there is my website for you all to see. It works, and even my Bitcoin Cash Hoarder game works.
But this is still far too difficult for my mother to do. Soo……. who has the skills to help me with some code that enables me to skip some steps in this proces to make it noob proof. It should be possible for shure because www.cryptograffiti.info or BitDB is able to extract such info from the blockchain and any online HTML tester is able to display it as a website. The underlying code should be available to make this work. Myself I just lack the skills.
 

$6.00
0.0¢

Reviews
1 of 1 reviewers say it's worth paying for

0 of 1 reviewers say it's not worth paying for
Comments
  earned 25.0¢
I actually went ahead and wrote a simple web app that successfully renders this.
Basically what was needed was:
  1. Make a query to bitdb
  2. Parse the response with JS to construct the full HTML
  3. Overwrite the current page with the generated HTML

You can check it out here: https://unwriter.github.io/cryptograffitiweb/#qqfse6sldawf742ydclj2n2uwgy7pxnd4ctlnph68a (Note, the JavaScript files are not loading because it's referencing a relative path to whichever site you got it from, which is why it's only showing the static content. But it should work if you copy and paste the full JS and CSS inline into the HTML)
25.0¢
   6mo ago
25.0¢
  earned 0.0¢
0.0¢
   6mo ago
  earned 0.0¢
Cool!
0.0¢
   6mo ago
  earned 0.0¢
I think this is really cool and it's opening my eyes to the potential power of BCH. One question, I went to the site @unwriter linked to but didn't see that you could actually play snake. I believe you mentioned the game works. Am I missing something or is the game not working yet. Thanks for putting this together I hope you continue working on it.
0.0¢
   6mo ago
  earned 25.0¢
@cain Tanks! There are still issues with properly loading the javascript which contains the game. So we do need improvements for this to work smoothly. When you go to the website https://bch.gg/bitcoincashhoarder and you click the hyperlink to bitcoin-bch.info, it will give you a 404. If you then return to the previous page the javascript seems to start working, and you can play the game. Use the arrows on your keyboard. I also saw that they made some improvements on the cryptografiiti website so that it can display the htlm site directly but they dislabled the javascript due to security concerns. But they inlcuded a downloadbutton so you can open the file in a regulair browser and the game seems to start working than also. https://cryptograffiti.info/#128971 Just consider this website as a proof of concept that demonstrates it is already possible today to host websites on the blockchain and imagine what this tech could enable. The current bugs can be fixed by creating better html or improving the code of the tool. So it is just a matter of time. More info to be found in the follow op story. https://www.yours.org/content/follow-up--hosting-a-website-on-the-bitcoin-cash-blockchain---instruct-02b1f1867d45
25.0¢
   6mo ago
25.0¢