Pub is the archive of the Internet. Ethereum powers Pub, and Pub powers Grafiti, a Dapp hosted at https://grafiti.online. Grafiti is also hosted by Swarm and the Ethereum Name Service at http://grafiti.eth.show.
Pub is the cheapest censorship-resistant publication platform available. There are no profiteers, including yourself and the developers. All published content is freely available to everyone for the duration of the Ethereum Network. Pub is immutable. Pub is forever.
Pub source code is available in pub.sol and also on Etherscan. The code is easy to understand and only 63 lines. You should never interact with a contract you do not understand.
Grafiti is a website facilitating browsing and submission. Metamask is an add-on for Chrome, Firefox, Opera, and Edge that allows them to interface with Ethereum.
Install Mist from Github. Mist is an open-source Dapp browser specialized for Ethereum. To sync faster, enable the "Sync with Light client" option.
In Mist, go to Contracts > Watch Contract.
Pub is currently located at 0x2a0f713aA953442EacA9EA47083f656170e67BA4
.
The ABI is:
[{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"allByAuthor","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"all","outputs":[{"name":"source","type":"address"},{"name":"timestamp","type":"uint256"},{"name":"title","type":"string"},{"name":"body","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"}],"name":"sign","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_title","type":"string"},{"name":"_body","type":"bytes"}],"name":"publishBytes","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"size","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_author","type":"address"}],"name":"publicationCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"authors","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_title","type":"string"},{"name":"_body","type":"string"}],"name":"publish","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]
Optionally, verify the published contract matches the bytes generated from solc --bin pub.sol
.
The output bytes will never change because the compiler version is specified.
Etherscan.io does this automatically, but be cautious trusting third parties with this responsibility.
Generate a key for the Ethereum Network. Mist and Metamask will prompt you to do this. In Pub as in Ethereum, your private key is your identity. Please follow all of the best practices to protect your private key. Your publications will be indexed with your public key. If you intend to remain anonymous, you may consider generating a new key for every publication.
Ether is required to pay the cost of every node in the Ethereum Network permanently hosting your content. The easiest and most common way to obtain ether is through a currency exchange. The more bytes in your publication, the more ether you will need.
Be sure to provide enough gas. Gas cost is calculable, but not yet automatically calculated. The recommended gas is 166367 + 348 per byte. Verify there is no cheaper format for your content. Verify there are no errors in your content. You will not be able to edit or update your publication.
If you do not wish to remain anonymous, you may sign your work. Beware this will de-anonymize all your other activity with this key.
If you have geth setup, do:
var pub = eth.contract([{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"allByAuthor","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"all","outputs":[{"name":"source","type":"address"},{"name":"timestamp","type":"uint256"},{"name":"title","type":"string"},{"name":"body","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"}],"name":"sign","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_title","type":"string"},{"name":"_body","type":"bytes"}],"name":"publishBytes","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"size","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_author","type":"address"}],"name":"publicationCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"authors","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_title","type":"string"},{"name":"_body","type":"string"}],"name":"publish","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]).at('0x2a0f713aA953442EacA9EA47083f656170e67BA4')
title="Your Title"
body="Your Content"
personal.unlockAccount(eth.accounts[0])
pub.publish.sendTransaction(title, body, {from:eth.accounts[0], gas:(166367+348*(title.length+body.length))})
You pay by the byte. Use the cheapest format possible. Usually that will be .svg or .webp for images. Be brief.
Have foresight.
DO NOT break the laws of your country.
Please open pull requests on github.
Optimizations that reduce the cost of publication are welcome. Future publication contracts can be linked on allpubs.eth.
Augmentations to the feature set, such as comments, tagging, and tipping, are best implemented as standalone contracts that reference the Pub. New contracts can be integrated into any front end, including Grafiti. Please refer to the Grafiti Roadmap.