wrdhom
v0.5.4
Published
The internet has become increasingly manipulated by obscure and biased systems. Users don’t know why they see the content they see, and because of this, users can’t make conscious decisions about what settings to choose, or about how to behave in a platfo
Downloads
47
Maintainers
Readme
WrdHom: the auditable social-media platform
The internet has become increasingly manipulated by obscure and biased systems. Users don’t know why they see the content they see, and because of this, users can’t make conscious decisions about what settings to choose, or about how to behave in a platform, to personalize the content they see according to their true interests. As opposed to watching the content the owners of a platform want to amplify, while censoring other content.
Another issue is that users don’t know how moderation works, so moderation systems can hide their unfairness and arbitrarities behind a black box, and never improve or be accountable.
On top of this, users don’t own their accounts, so these can get shut down, by those obscure and arbitrary moderation systems, which can be very damaging, since it can disrupt a person’s support network; make people lose valuable data and connections; and decrease freedom of speech and the ability of people to coordinate in a fair and neutral environment.
All of this is very detrimental for our collective intelligence and creativity, and prevents us from making better decisions as a society, and from living better lives as free people.
We also would like to have more open and reliable APIs that behave more like protocols, so users and developers don’t need to worry about changes in the ownership of a platform, arbitrary business decisions, etc. Providing more guarantees to users and developers, and creating a more composable digital landscape.
We could and should try to improve legacy web2 platforms through better legislation, auditing, and accountability, but this is very challenging, because:
Even if they open source their code, there’s no way to guarantee that the code they release matches the code running on their servers, or to verify to what extend humans intervene arbitrarily.
Access to their APIs and data is expensive and restrictive.
They can find ways to trick audits.
The cost of permanently monitoring these platforms is prohibitive.
The WrdHom project aims to provide an alternative by building an open, auditable, and accountable platform by default. Guided by the following principles:
Users sign messages to authenticate their actions on the platform. This way users own their digital identity, since they own the keys to their accounts.
These signed messages are the input to zkPrograms that verify signatures, order actions on the platform, and generate proofs to update the state of the platform by following the established rules encoded in the zkPrograms. Then the associated smart-contracts verify that the proofs are valid and timestamp the moment of their inclusion.
The state of the platform is composed of on-chain and off-chain state. Our on-chain state lives in the Mina blockchain, and can be seen as the root of the whole state of our platform. This state is updated through the proofs generated by our zkPrograms, and can be used to verify that the off-chain state is valid.
The off-chain state lives in open and decentralized storage platforms like Filecoin. Data should be stored publicly and redundantly, so users have the guarantee that their data and the platform will remain available.
When users get content from the platform, the server responds with the content and the Merkle Map witnesses associated with each piece of content, so the client uses this to automatically calculate the roots for the state of the platform. The client also fetches the on-chain roots, and compares them with the calculated roots to make sure that the server response is valid according to our settings, and behaves as expected.
Mina also makes it possible to implement native zkApp-specific rollups, so we don’t have to make an on-chain transaction every time a user does something in the platform, which would be slow and expensive. Instead, we merge the proofs that we create to update the on-chain state, into a single proof that can be submitted to the network (e.g. The server receives 1,000 post requests, so it generates 1,000 proofs that then are merged, and the server uses the resulting proof to update the on-chain state for 1,000 posts in a single transaction). These proofs can also be generated in parallel, allowing the platform to scale.
So far four zkPrograms and four smart-contracts have been implemented to handle the root state of Posts, Reactions, Comments, and Reposts; as well as the server that serves the auditable content and creates the proofs based on the actions of users; and the client that automatically audits these responses and provides a graphic user interface for users to interact with the platform.
Testing and Deploying smart-contracts and zkPrograms
Clone
git clone [email protected]:chrlyz/wrdhom_contracts.git
Install
npm install
Config
Before building, running tests or deploying the project, set some parameters in the config.json
of the project, and generate keys for the fee-payer
and the PostsContract
. To do this start by installing the zkApp-CLI:
npm install -g zkapp-cli
Then:
zk config
And go through the prompted instructions:
Set the name to:
posts
.Set the Mina GraphQL API URL to:
https://api.minascan.io/node/devnet/v1/graphql
Set transaction fee to:
0.1
Create a new
fee-payer
key or use one that you already have (just use keys that hold testnet tokens, don’t expose keys holding real tokens that have value, be careful with how you manage your keys).Make sure the
fee-payer
key has funds to make transactions (thezkApp-CLI
will point you to a faucet to request testnet tokens in case you need to).
Build
npm run build
Run tests
npm run test -- -t 'PostsContract and Posts ZkProgram functionality'
Deploy
To deploy the PostsContract
on the Berkeley testnet:
node build/src/posts/PostsDeploy.js
Similarly you can test and deploy the smart-contracts and zkPrograms for Reactions, Comments, and Reposts.