Public Annotation Network (PAN) is an open source censorship-resistant web annotation service. Our goal is to create a browser extension, which makes it as easy as possible for users to annotate content on any web page as well as read annotations published by other users without the risk of being subject to censorship. Currently, our MVP is available for Chrome-based browsers and is only compatible with Twitter. With both Metamask and PANinstalled, a PAN icon will be displayed on the right-hand side when browsing a Tweet. When the icon is clicked, a user can read existing annotations for the content displayed in their browser, as well as compose an annotation themselves and publish it through the PAN publisher service. This annotation will then be propagated through Ethereum and IPFS to other users, who will be able to see it, e.g. when accessing a tweet themselves.
How It's Made
Overall, we have three components: the PAN browser extension, the PAN publisher service, and the PAN subgraph. Our browser extension allows users to annotate a tweet on twitter.com. The PAN browser extension is the primary medium through which users interact with the Public Annotation Network. By using the extension, users can retrieve published annotations that are already on the network or submit their own annotations in relation to specific webpages. In the current prototype, the extension connects to the publisher service API to fetch annotation data, however in the future direct interaction with Ethereum and IPFS will be given as an option. When publishing an annotation, a user signs their annotation with their Ethereum private key and publishes annotations through the publisher, which - alongside the extension - validates the annotation’s integrity, and publishes it in our Ethereum smart contract registry through the PAN subgraph (powered by TheGraph), as well as pins the content on IPFS using TheGraph and Piñata. Annotation data is stored on IPFS. For better compatibility with other services, we adopt the W3C's Web Annotation Data Model. There are two ways to submit annotations. Users can either publish annotations directly to our network or submit via a publisher, which will then publish annotations in batches on behalf of the users. At last, an Ethreum smart contract registry is used to store references to each annotation and its annotator, ensuring that annotation data is immutable. The publisher is an optional quality of life component. Its primary objective is to make publishing annotations cheaper by batching multiple operations into a single Ethereum transaction. The more Ethereum transactions are batched together, the cheaper the act of publishing becomes. To provide further utility, the publisher service exposes a REST API that allows for easy querying of existing annotations and optimizing query performance by caching annotations in the registry. Apart from that, we also built the PAN subgraph. PAN Subgraph is an optional component of the architecture, mainly used to reduce query times. For every transaction, which stores a batch id on-chain, it indexes all annotations of the batch from IPFS and stores an additional reference (e.g. the tweet id and username) for the annotation. To obtain for example all annotations for a user or a tweet the extension (or the publisher) submits a GraphQL query to the subgraph containing the username or the tweet id.