Navigating Politeia Data¶
For the purpose of this guide we’ll be using this previous proposal as an example. To see data associated with this proposal, click the on the
See on GitHub link on the proposal’s page. You can also look up a proposal directly in the decred-proposals/mainnet repo using the proposal’s unique hash number. For our example proposal, the hash is:
Below is a screenshot of the root directory of the decred-proposals/mainnet repo.
Folders marked with
* contain proposal data. Folders and files marked with
A contain anchoring data. Anchoring data relates to the anchoring of Politeia data to the Decred blockchain through dcrtime, which facilitates Politeia’s transparent censorship functionality. This guide will not describe those files in detail, as they are not likely to be of interest for analysis.
Within each proposal folder there are sequentially numbered sub-folders, one for each version of the proposal. The first folder (‘/1’) corresponds to the initial version of the proposal submitted to Politeia. If a proposal author updates their proposal (typically in response to community feedback), the updated version and it’s associated data are put into folder (‘/2’), and so on.
Below shows the contents of our example proposal’s folder. As we can see, there are two versions of the proposal.
If we click on the latest version (‘/2’), we can see all the relevant data for this version.
Below is a table with descriptions of the files and folders found in each proposal version folder.
|/payload||Folder containing an
|/plugins/decred||Folder containing the
|00.metadata.txt||Data about the proposal submission:
|02.metadata.txt||Data about admin approval for display:
|13.metadata.txt:||Data about proposal owner authorizing the start of voting. Where proposal owner has authorized and then rescinded authorization this will appear in multiple commits:
|14.metadata.txt||Data about admin authorizing the start of voting. Includes specification of the vote: duration (2016 blocks):
|15.metadata.txt||Data about voting period:
|recordmetadata.json||Metadata about the record.|
Voting and comment data¶
A git commit is made every hour for each active proposal to update the
comments.journal file. If voting has started on a proposal, the same commit will also be used to update its
ballot.journal file. The hourly commits are stopped once the voting has been completed and all votes have been recorded in git. Commits are made every hour because making a git commit is expensive performance-wise and making a commit for every vote and comment would not be practical. Additionally, grouping votes in hourly commits helps protect the privacy of ticketholders.
Data on votes cast by ticket holders on a given proposal is stored in the
ballot.journal file in the
/plugins/decred folder. The commit history for this file can be consulted to see which hour votes were cast in. The table below describes the parameters recorded for each vote.
|token||The proposal being voted on|
|ticket||The ticket which is voting|
|votebit||Whether the vote was Yes (2) or No (1)|
Data on comments is stored in the
comments.journal file in the
/plugins/decred folder. The table below describes the parameters recorded for each comment.
|action||The action taken by the commenter. If a comment is added,
|token||The proposal being commented on.|
|parentid||The id of the parent comment, or ‘0’ if a top-level comment.|
|commentid||The identifier (id) for the comment|
|timestamp||A unix timestamp specifying time comment was submitted|
|publickey||The public key of the Politeia user who made the comment|
|censored||The censorship status. If the comment has been censored,
In the datasets presented here, users are identified by their public keys. On proposals.decred.org, users are identified by their username (chosen when they created their public/private key pair).
Currently, to associate a public key with a username, you need to go through proposals.decred.org. To look up the public key for a user, click on their username anywhere on the site. This will take you to the user’s profile, which has a URL like this: https://proposals.decred.org/user/350a4b6c-5cdd-4d87-822a-4900dc3a930c
The final part of this URL is the Universally Unique ID (UUID) for the account. This can be input into a public API exposed by the Politeia website, which will takes the UUID as an input and outputs user profile data, including the public key. For example, if you paste the above example UUID into a browser,
https://proposals.decred.org/api/v1/user/350a4b6c-5cdd-4d87-822a-4900dc3a930c, it will return all publicly-available data for that user, including their public key: