paper.tex 108 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365
  1. % This is samplepaper.tex, a sample chapter demonstrating the
  2. % LLNCS macro package for Springer Computer Science proceedings;
  3. % Version 2.20 of 2017/10/04
  4. %
  5. %1
  6. %\documentclass[runningheads]{llncs}
  7. %2
  8. \documentclass{article}
  9. \usepackage[utf8]{inputenc}
  10. % line spacing: https://www.overleaf.com/learn/latex/Paragraph_formatting#Line_spacing
  11. \renewcommand{\baselinestretch}{1.3}
  12. \usepackage{amsmath} % <== cases
  13. \usepackage{geometry}
  14. \geometry{margin=1in}
  15. \usepackage{tcolorbox}
  16. %
  17. \usepackage{graphicx}
  18. \usepackage{nth}
  19. \usepackage{amsfonts}
  20. % or
  21. \usepackage{amssymb}
  22. \usepackage{sansmath}
  23. \usepackage{xcolor}
  24. \usepackage{xspace}
  25. \usepackage{algorithm}
  26. \usepackage{algpseudocode}
  27. \usepackage{verbatim} % <== \comment command
  28. \usepackage{url} % <== url{} in bib file
  29. \usepackage{booktabs} % Beautiful tables
  30. \usepackage{draftwatermark} % <== https://codeyarns.com/2010/05/05/how-to-add-draft-watermark-in-latex/
  31. \SetWatermarkScale{4}
  32. \SetWatermarkLightness{0.95}
  33. \graphicspath{ {./assets/images/} }
  34. % Used for displaying a sample figure. If possible, figure files should
  35. % be included in EPS format.
  36. %
  37. % If you use the hyperref package, please uncomment the following line
  38. % to display URLs in blue roman font according to Springer's eBook style:
  39. % \renewcommand\UrlFont{\color{blue}\rmfamily}
  40. %% From https://github.com/amaloz/crypto-latex/blob/master/crypto.sty
  41. % Generate
  42. \newcommand{\gen}{{\ensuremath{\mathsf{gen}}}\xspace}
  43. \newcommand{\Gen}{{\ensuremath{\mathsf{Gen}}}\xspace}
  44. \newcommand{\KeyGen}{{\ensuremath{\mathsf{KeyGen}}}\xspace}
  45. % Encrypt
  46. \newcommand{\enc}{{\ensuremath{\mathsf{enc}}}\xspace}
  47. \newcommand{\Enc}{{\ensuremath{\mathsf{Enc}}}\xspace}
  48. \newcommand{\Encrypt}{{\ensuremath{\mathsf{Encrypt}}}\xspace}
  49. % Decrypt
  50. \newcommand{\dec}{{\ensuremath{\mathsf{dec}}}\xspace}
  51. \newcommand{\Dec}{{\ensuremath{\mathsf{Dec}}}\xspace}
  52. \newcommand{\Decrypt}{{\ensuremath{\mathsf{Decrypt}}}\xspace}
  53. % Signatures
  54. \newcommand{\Sign}{{\ensuremath{\mathsf{Sign}}}\xspace}
  55. \newcommand{\Verify}{{\ensuremath{\mathsf{Verify}}}\xspace}
  56. \newcommand{\eucma}{\textsf{EU-CMA}\xspace}
  57. \newcommand{\Sigforge}[3]{\ensuremath{\mathsf{Sig\text{-}forge}_{#2,#3}^{\mathsf{\scriptstyle{#1}}}}\xspace}
  58. % Commitments
  59. \newcommand{\Com}{{\ensuremath{\mathsf{Com}}}\xspace}
  60. \newcommand{\Open}{{\ensuremath{\mathsf{Open}}}\xspace}
  61. \newcommand{\Combind}[3]{\ensuremath{\mathsf{Com\text{-}bind}_{#2,#3}^{\mathsf{\scriptstyle{#1}}}}\xspace}
  62. \newcommand{\Comhide}[3]{\ensuremath{\mathsf{Com\text{-}hide}_{#2,#3}^{\mathsf{\scriptstyle{#1}}}}\xspace}
  63. % Zero-knowledge
  64. \newcommand{\Prv}{{\ensuremath{\mathsf{Prv}}}\xspace}
  65. \newcommand{\Ver}{{\ensuremath{\mathsf{Ver}}}\xspace}
  66. % Public key
  67. \newcommand{\pk}{{\ensuremath{\mathsf{pk}}}\xspace}
  68. \newcommand{\PK}{{\ensuremath{\textsc{pk}}}\xspace}
  69. % Private key
  70. \newcommand{\sk}{{\ensuremath{\mathsf{sk}}}\xspace}
  71. \newcommand{\SK}{{\ensuremath{\textsc{sk}}}\xspace}
  72. % Verification key
  73. \newcommand{\vk}{{\ensuremath{\mathsf{vk}}}\xspace}
  74. % Commitment key
  75. \newcommand{\ck}{{\ensuremath{\mathsf{ck}}}\xspace}
  76. % CRS stuff
  77. \newcommand{\crs}{{\ensuremath{\mathsf{crs}}}\xspace}
  78. \newcommand{\CRSGen}{{\ensuremath{\mathsf{CRSGen}}}\xspace}
  79. % Other
  80. \newcommand{\PrivK}{{\ensuremath{\mathsf{PrivK}}}\xspace}
  81. \newcommand{\PubK}{{\ensuremath{\mathsf{PubK}}}\xspace}
  82. \newcommand{\com}{\ensuremath{\mathsf{com}}\xspace}
  83. \newcommand{\proc}{{\ensuremath{\mathbf{procedure}}}\xspace}
  84. \newcommand{\negl}{\ensuremath{\mathsf{negl}}\xspace}
  85. \newcommand{\aux}{{\ensuremath{\mathsf{aux}}}\xspace}
  86. \newcommand{\Eval}{{\ensuremath{\mathsf{Eval}}}\xspace}
  87. \newcommand{\Samp}{{\ensuremath{\mathsf{Samp}}}\xspace}
  88. \newcommand{\PrvInd}{{\ensuremath{\mathrm{PrvInd}}}\xspace}
  89. \newcommand{\PrvSim}{{\ensuremath{\mathrm{PrvSim}}}\xspace}
  90. \newcommand{\Setup}{\ensuremath{\mathsf{Setup}}\xspace}
  91. \newcommand{\PRF}{\ensuremath{\text{PRF}}\xspace}
  92. \newcommand{\PRG}{\ensuremath{\text{PRG}}\xspace}
  93. \newcommand{\PRP}{\ensuremath{\text{PRP}}\xspace}
  94. % Security parameters
  95. \newcommand{\secpar}{\secparam}
  96. \newcommand{\csp}{\secpar}
  97. \newcommand{\ssecparam}{\ensuremath{\rho}\xspace}
  98. \newcommand{\ssecpar}{\ssecparam}
  99. \newcommand{\ssp}{\ssecpar}
  100. \newcommand{\boolsec}{\ensuremath{\bool^\secparam}\xspace}
  101. \newcommand{\onesec}{\ensuremath{1^\secparam}\xspace}
  102. \newcommand{\blocktext}[1]{{\ensuremath{\mathsf{#1}}}\xspace}
  103. % Defined new concept box environment
  104. % https://www.overleaf.com/learn/latex/Environments#Defining_a_new_environment
  105. \newenvironment{concept_box}[1]
  106. {
  107. \begin{tcolorbox}
  108. {\large \textbf{#1} }
  109. }
  110. {
  111. \end{tcolorbox}
  112. }
  113. \begin{document}
  114. %
  115. \title{
  116. \textbf{
  117. Joystream: A Protocol for User Governed Content Platforms
  118. }
  119. }
  120. %
  121. %\titlerunning{Abbreviated paper title}
  122. % If the paper title is too long for the running head, you can set
  123. % an abbreviated paper title here
  124. %
  125. \author{Jsgenesis}
  126. \date{\today \\ DRAFT Version 0.1}
  127. \maketitle % typeset the header of the contribution
  128. %
  129. \begin{abstract}
  130. The Joystream protocol attempts to formalize a content platform that is governed and operated by the platform users. The centerpiece of the protocol is the shared platform state, implemented on top of a blockchain consensus system, which coordinates and provides incentives to all stakeholders. Almost every aspect of a content platform is endogenous to the protocol, including
  131. \begin{itemize}
  132. \item[(a)] {governance}
  133. \item[(b)] {membership system, with screening and policing}
  134. \item[(c)] {storage and distribution}
  135. \item[(d)] {curated content directory}
  136. \item[(e)] {content search, browsing, and recommendations}
  137. \item[(f)] {software development finance and coordination}
  138. \item[(g)] {content production financing}
  139. \item[(h)] {advertising auctions and placement}
  140. \item[(i)] {communication: messaging and message boards}
  141. \end{itemize}
  142. and every subsystem is fully accountable to, and directed by, the users, as represented by the governance system. Capturing such a broad range of systems in the protocol is \textit{the} distinguishing characteristic of this proposal. It is motivated by the thesis that a high level of platform accountability can be achieved by empowering two user capabilities.
  143. First, the ability to voice discontent and subsequently implement changes based on such voices, which relies on an immutable history of actions, reliable information sharing, and binding execution of policy changes.
  144. Second, the ability to exit the platform at a low cost and create an alternative when the platform decay has gone too far. This relies on having the entire platform state available for wholesale replication, which is not possible if critical parts of the platform state are exogenous to the protocol.
  145. \end{abstract}
  146. %TODO;
  147. % Add glossary?
  148. % https://no.overleaf.com/learn/latex/Glossariess
  149. \tableofcontents
  150. \section{Preface}
  151. This document aims to give a high level overview of the design approach for of a new protocol for content platforms. This is an evolving document meant as a basis for an iterative review, technical specification and testing, and revised versions will be developed on the basis of that process. Multiple aspects of the protocol are still subject to active research, and any part of the current design may be amended or entirely abandoned as a result of subsequent considerations. Lastly, the descriptive resolution varies substantially across the proposal as a result of different parts at radically different levels of maturity.
  152. \section{Introduction}
  153. \subsection{Motivation}
  154. Due to a mixture of conspiring factors, such as platform externalities, economies of scale and, jurisdictional arbitrage, dominant contemporary Internet platforms have become some of the least accountable organizations today. The traditionally constraining institutions of market competition, regulation and litigation simultaneously appear to be unable to push back against their market power. The social cost of this equilibrium is multifaceted, leading to lower innovation, platform rents, and more broadly to the fact that platform policy is only incidentally, not primarily, guided by the objectives of the largest platform stakeholder: \textit{users}. Users should be broadly understood as anyone who is participating on a platform in any capacity.
  155. \subsection{Joystream}
  156. The Joystream protocol is an attempt at formalizing the structure and function of a content platform, where user accountability is a key objective and organizing principle. This accountability is generated by technically codifying two well-known complementary responses to organizational decline \cite{hirschman1970exit}.
  157. \begin{itemize}
  158. \item[-] \textbf{Voice}
  159. Users have effective means of sharing information, coordinating, and reaching decisions about key collective action problems, namely how to allocate and regulate the use of any shared platform asset.
  160. \item[-] \textbf{Exit}
  161. Users have effective means of creating new platform instances that can preserve the entire platform history and state. This ability to fully replicate the technical, administrative, and economic state of a platform has two positive effects on accountability: first, it empowers the voice of users through the threat of a low cost exist; and second, it supports the emergence of a diversity of platforms when the underlying interests of stakeholders are irreconcilably incompatible or where the organizational decline as gone sufficiently far.
  162. \end{itemize}
  163. In order to build in the capacity for such responses, the Joystream protocol is built as follows. The shared platform state lives on an open blockchain consensus system. As a result, it has a public state and history that is fully auditable and immutable. The protocol also has secure direct and broadcast communication capabilities integrated within a platform identity system. This means that it is very cheap for any participant to securely inspect the system and make irrefutable positive claims as part of subsequent public deliberation, learning, debating, or agitating. The identity system along with an immutable history of public actions and communications generates the incentive to invest in community standing and act with a long time horizon. Further, there is a governance mechanism that allows low cost coordination around the use and regulation of shared assets and the amendment of the protocol. Importantly this mechanism self executes and thus provides reliable and a counterparty-free implementation of governance decisions. All these properties work in hand to support \textit{voice} as response.
  164. The protocol itself is open and implemented in open source reference software. It has an open shared state and data accessible for all. This makes the copying step of creating an alternative instantiation trivial and thus supports \textit{exit} as response.
  165. \section{Notes}
  166. Occasionally, there may be reference to data types in various schemes or concept definitions, assume the C++ type system.
  167. When identifier fields are used in definitions, assume that they are unique and created by auto-incrementation in the context of some set of existing instances.
  168. Constant values are displayed with a capitalized snake case as follows: {\tiny FOO\_BAR}. These are values that cannot be changed through governance and require a hard fork or consensus upgrade. In some occasions, the symbol {\tiny C} is used to denote some constant that is specific to the context.
  169. \section{Blockchain}
  170. The Joystream protocol is stateful, and the infrastructure for the secure distribution and updating of this state is a blockchain system.
  171. A given instantiation of the Joystream protocol runs on its own single-purpose blockchain infrastructure, which only processes transactions related to this instantiation. In the rest of the document, this blockchain will be treated as a silent transaction ordering mechanism; however, in the following section, it will briefly describe the assumptions on the blockchain infrastructure in the protocol design. Here, and in the rest of the document, the \textit{platform or platform state} will refer to the state upon which transactions operate. In Bitcoin, for example, this would be the UTXO set and be distinctive from the state of the underlying blockchain infrastructure itself, namely the actual chain of blocks designated by the chain selection rule.
  172. \subsection{Consensus}
  173. The blockchain has a consensus algorithm in the classical BFT algorithm family that is adapted to use Proof-of-Stake-based voting power for a dynamic validator\footnote{We will refer to a block producing actor as a \textit{validator}, and anyone simply fully validating the chain a \textit{full validator}.} set. A designated platform token, described further in section \ref{sec:accounts_and_tokens}, is used by the validators to stake and is also the unit in which they are rewarded. There is a growing set of such consensus protocols \cite{tendermint, kiayias2017ouroboros, algorand}, and the following general properties of these systems are of importance to the protocol design.
  174. \begin{itemize}
  175. \item[-] \textbf{High throughput and low latency:} In benchmarks, these algorithms have been shown to support combinations of confirmation latency, transaction throughput, validator count, and geographic distribution, which are substantially more attractive than that found in typical production Nakamoto consensus chains \cite{cosmos}.
  176. % TODO: Add more here on _why_ that is, and what the tradeoff is.
  177. \item[-] \textbf{Light client friendly:} The overwhelming majority of end users will need to securely access the platform in computing environments with resource constraints, such as browsers and mobile devices. They should also be able to quickly start interacting with the platform, even if the last sign-on was a long time ago or may even be the first time. In addition, the Joystream protocol will have a large state and transaction history. These constraints make a light client protocol the only genuine interaction model for almost all users.
  178. In these algorithms, a light client only needs to track any potential changes in the validator set, which in practice changes quite infrequently, for example, due to the unbonding period induced delay and not in large increments. Once an up-to-date validator set is identified, the client can securely read any part of the platform state by authenticating merkle proofs from full nodes against state commitments found in the relevant block header.
  179. This is in contrast to Nakamoto consenus systems where all block headers starting at genesis\footnote{For reference, Ethereum has a chain of more than 7.1M blocks as of Jan. 22 2019.} must initially be downloaded, and one must keep up with new blocks as the system moves forward\footnote{For reference, Ethereum commits 5760 new blocks per day as of Jan. 22 2019.}. Headers are validated, and the chain selection rule is applied on a continuous basis. Even if feasible, this requires a long initial synchronization period whenever a client comes on line for the first time or at some point after a hiatus.
  180. % TODO: Add more here on _why_, explanation is scattered across the following in Tendermint ecosystem, but not well explained _at all_
  181. %
  182. % https://github.com/tendermint/tendermint/wiki/Light-client-syncing-of-validator-changes
  183. % https://github.com/cosmos/cosmos/blob/master/WHITEPAPER.md\#light-clients
  184. % https://blog.cosmos.network/light-clients-in-tendermint-consensus-1237cfbda104
  185. % https://tendermint.com/docs/spec/blockchain/blockchain.html\#block
  186. % https://github.com/tendermint/tendermint/blob/master/docs/spec/blockchain/state.md
  187. % apparently the code
  188. % https://github.com/tendermint/tendermint/blob/master/lite/dynamic_verifier.go
  189. \item[-] \textbf{Finality:} The finality of block commitment is the property that once two-thirds of the current validator set has signed off on a block, then that block will become, and remain, part of the chain permanently. This is in contrast to Nakamoto consenus systems where the heaviest chain selection rule can in principle fork off any block, albeit with exponentially declining probability in the block depth, from the chain. This property has a number of critical benefits
  190. \begin{itemize}
  191. \item \textit{Easy interoperability}
  192. In order for secure assertions about the state of the Joystream chain to be feasible on a different chain, this chain will effectively need to behave as a light client that can track the most up-to-date committed block on the Joystream chain. Finality ensures that tracking this becomes very easy, as there are no reorganization events that can occur. Such events open up the possibility of reverting the basis critical state changes executed on the remote chain prior to the reorganization, e.g. changes in asset ownership. Dealing with this is complex and will often involve introducing delays. Moreover, the light client friendliness discussed above also helps in reducing the information to be submitted to the remote chain light client.
  193. \item \textit{Safe launch and coexistence}
  194. Finality ensures that the incentive to attack a chain to perform a double spend through a reorganization goes away. This risk is particularly high in the early stage of the lifetime of a new blockchain, as the initial amount of work (or stake) on the system may be particularly low. Even beyond the launch, the amount of value securing the system will always fluctuate, in particular for nascent systems; thus, finality provides a valuable guarantee.
  195. \item \textit{Better usability}
  196. Finality makes it very easy to write applications that interact with the blockchain, as complex logic for gracefully dealing with reorganizations is entirely omitted. There is no need to introduce arbitrary security delay, which is also a benefit to end users.
  197. \end{itemize}
  198. \end{itemize}
  199. \subsection{Upgrading}
  200. It is possible to upgrade both the transaction validation rules and the current state of the chain through the transaction processing system itself. This can typically be enabled by storing the transaction validation rules in the state and then running them on top of some virtualization layer. This property is a requirement for the following:
  201. \begin{itemize}
  202. \item[-] \textbf{Genuine accountability:} Without a formalized mechanism for both measuring the preferences of stakeholders on collective action decisions and exercising those decisions, there will be an inevitable development of off-chain social conventions and authorities who will operate as stuarts and coordinators in such scenarios. Such actors are not accountable to platform stakeholders in any well defined or transparent way, which is undesirable in itself.
  203. \item[-] \textbf{Faster iteration:} For the protocol rules to quickly evolve, the process to coordinate around such changes must economize on critical ecosystem resources, such as attention, information processing, and legitimacy. Opaque off-chain upgrading processes risk becoming a perpetual source of conflict around questions of legitimacy. Moreover, the requirement for active upgrading of validator software and the non-committing signaling games that often surround such events are an additional practical friction. Instead, endogenous upgrading with an accompanying on-chain immutable record of deliberation and a history of such updates can offer an effective remedy against these difficulties.
  204. \item[-] \textbf{Developer fungibility:} In general, a complex system where any failure is catastrophic will require constraining the number of developers who can securely contribute to the improvement of the system. This constraint can in extreme cases support a market power in the hands of key developers, where they can end up becoming gate keepers for any change to be applied.
  205. In the context of upgrading blockchain systems, the reliance on off-chain upgrades to the consensus rules, the state transition function must incorporate the full history of rule sets from genesis to the most recent changes to validate all blocks. In practice, this ends up with a monotonically increasing complexity confronting developers wanting to comprehend and modify the system, which is problematic, as explained.
  206. \end{itemize}
  207. \subsection{Asynchronous Transaction Processing}
  208. \label{sec:asynchronous_transaction_processing}
  209. Certain types of transactions that may take a long time to process are occasionally required. Specifically, they may even require more time to process more than what is feasible when consuming all the the block times across multiple blocks. In some cases, it may be possible to accommodate such processing by the following approach, referred to as Asynchronous Transaction Processing (ATP). When the transaction is processed, and is valid, an appropriate subset of the blockchain state is locked in the sense that all other transaction types that mutate it are considered invalid. In order to implement this in an orderly fashion, where it is practical to reason about what transactions are impacted by a given subset, one should confine the approach to suitable transaction types. Now, during this locking period, which typically will last for a predefined number of blocks, the validator nodes are free to conduct the desired processing for the initial transaction outside the normal sequential validation of blocks, for example, on a separate processing unit. The locking prevents any race condition. Finally, when the time has expired, the finalized processing result is committed to the blockchain state at the end of the corresponding block, and the substate locking is no longer in effect.
  210. % TODO: Add figure showing chain of blocks, substate being locked, async prcoessing, and final commitment of result in state.
  211. \subsection{Fee Model}
  212. A standalone chain allows the freedom to implement a custom fee policy. Building on top of an existing chain would result in inheriting its existing fee model for on-chain capacity, which often is tied to generalized congestion control and financing security.
  213. \subsubsection{Models}
  214. There are two types of fee model modes available in the protocol.
  215. \begin{itemize}
  216. \item[-] \textbf{Transactional:} The normal transactional pay-per-use model can be found in a majority of currency-focused systems such as Bitcoin. This mode applies to basic operations such as moving fund.
  217. \item[-] \textbf{Block Range Action Quota (BRAQ):} An \textit{action} refers to a combination of an actor, role, and transaction type. This model prevents a given action from occurring more than a given number of times over a given number of blocks. Successfully issuing such transactions within the given limits does not involve marginal outlay for the given actor.
  218. \end{itemize}
  219. Given that BRAQ will cover the majority of transactions, security will primarily be financed through minting tokens, which also more closely matches the public goods nature of chain security. This dual model has a number of critical benefits for platform.
  220. First, it drastically reduces the transactions costs of onboarding new users who initially have no tokens and either face prohibitive costs in acquiring, storing, and using them or need to be persuaded about the value of the platform before being willing to incur such costs. Such users will instead face the option of being onboarded via a screening mechanism (see section \ref{sec:membership_curation}). After this, they will be able to immediately interact with the system, within constraints. Users may later earn or purchase tokens to escape quota limitations. Alternatively, the platform itself may simply eventually abandon the free policy once these costs have declined sufficiently as a result of general increase in maturity of the blockchain ecosystem.
  221. Second, this approach explicitly subjects the fee model to a dynamic governance process where all default limits and individual member quotas can be adjusted. This is an easy and possibly the only feasible long term mechanism for correcting the externalities associated with the long-term social cost of transaction processing and state utilization in public chains \cite{blockchain_resource_pricing}.
  222. \subsubsection{BRAQ} \label{sec:BRAQ}
  223. In the BRAQ model, two parameters are required for each action: the \textit{range length}, denoted by $R$, and the \textit{action quota}, denoted by $Q$; both are positive integers. A combined range length and transaction limit is known as a \textit{BRAQ quota}. This model prevents an action in a given block if there are already $L$ such actions in the current $R$ blocks prior. The system must maintain a sequence of positive integers $H=(h_1, \ldots, h_N)$, known as the \textit{event list}, for each action, initially set to an empty list. A combination of BRAQ quota and such a list is referred to as \textit{BRAQ instance}.
  224. An action should not be allowed in block height $h$ when
  225. $$ L \leq | \{ h_i \mid h_i \geq h-R\mbox{ for some } i=1,\ldots,N\} |$$ % check for off-by-one errors!
  226. otherwise it will proceed to normal validation. If the corresponding transaction is subsequently found to be accepted, then the new value for $H$ should be
  227. $$ (h, h_1, \ldots, h_{M}) $$
  228. where $M=N$ if $N < L$, otherwise $M = N - 1$. Hence, $H$ is a list of block heights for, up to, the last $N$ successful actions. The benefit of the event list is that it makes it easy for a light client to track the availability of a given action at any given time, as the entire BRAQ instance is securely available in the state. A full node could in principle track and enforce an instance without having the $H$ in the state.
  229. Lastly, when using this model, it is in some cases desirable to share the same quota across a range of instances. This is typically if you are dealing with a very large number of instances all of which have very similar actors. At the same time, it is also ideal to retain the flexibility to have explicitly custom quotas for specific actors based on policy or discretion. These two goals are accommodated by the concept of a \textit{BRAQ quota proxy}. This is either a normal quota or an identifier resolving a normal quota in some context-specific pool of quotas or simply a sentinel to use some other context specific quota.
  230. \subsection{Interoperability}
  231. Some of the assets that are of value to the platform will inevitably not live in the state of the same blockchain. This can, for example, be the state of a DNS mapping that lives on some other system, such as ENS \cite{ens} or Handshake \cite{handshake}. It may even be desirable to move certain assets from the Joystream blockchain, such as tokens, onto other blockchain systems. While proposals are being developed to support very general inter-blockchain transaction routinely, such as Cosmos \cite{cosmos} for tokens and Polkadot \cite{polkadot}, it is not clear when or if they will be fully deployed, and to what extent the Joystream blockchain will be able to benefit, or more simply whether the Joystream governance process will converge on such an integration.
  232. A direct and simple case-by-case integration will be possible by using the same standard technique in almost all secure blockchain integration proposals. For each blockchain that needs to be integrated with Joystream, deploy a light client instance on each side, for the opposite side, where there is a requirement to write to the state on the first. This obviously requires that the given side is expressive and economical enough to support such an on-chain light client. Take the example of wanting to subject an ENS mapping, on Ethereum, to the governance processes on the Joystream blockchain. This will only require deploying a Joystream light client contract on Ethereum, which also is set as the owner to the given mapping. Block headers committed to the Joystream blockchain will then have to be submitted to this light client, at the very least when there are changes in validator sets. A designated party from the Joystream side can be incentivised to regularly conduct this. This header history in the state of the contract will allow it to be securely convinced of the ENS-related signaling actions on the Joystream side through Merkle proofs, since these will be committed to in the corresponding headers\footnote{This could be in the event logging system, or individual transaction types being included in blocks.}. The contract can then in turn execute the corresponding on-chain contract call to put this signal into effect in ENS.
  233. % TODO: Add illustration
  234. % \begin{figure}[h]
  235. % \centering
  236. % \includegraphics[width=0.6\textwidth]{images/Placeholder.eps}
  237. % \caption{A nice figure showing a sequence of events involving interoperability with ENS from Joystream.}
  238. % \label{fig:mesh1}
  239. % \end{figure}
  240. \section{Accounts and Tokens} \label{sec:accounts_and_tokens}
  241. The platform has a standard for account-based (fungible) token ownership. There will be a primary token, called the \textit{native token}, which will be part of the initial state of the platform. This native token will, as will be described later, be used for value transfer, bonding, and governance activities.
  242. New tokens are minted continuously for a very wide range of purposes, all primarily to reward some actor for some behavior. This minting is perpetual, and how much is minted for what purpose is controlled by the platform governance process. New tokens are also burned by actors in scenarios where they need to contribute to the platform through the token; e.g. purchasing ad placements. There is no platform treasury that will otherwise absorb these tokens. As a result of these three separate exogenous dynamics - and the platform upgradeability functionality, there is no ex-ante certainty about the total supply of the token at different points in time in the future.
  243. The other tokens are related to the content finance market, described further in section \ref{sec:content_finance}. They are issued by publishing a \textit{token profile} into a registry called the \textit{token registry}. A token profile includes key information, such as a standard token symbol, issuer identifier, description, and also the ownership state itself known as the \textit{token balances}. The token balances simply maps a public key to a positive integer, and a single mapping represents the quantity of tokens under the control of whoever holds the private key corresponding to the public key. The registration of a key in the balances of a token is referred to an \textit{account}. Reuse of the same key pair across accounts for the same actor is an individual policy choice. Normal spending operations can be conducted from an account to any new or existing account on the same token by signing a message with a private key that matches the public key corresponding to the original account. The token registry is a mapping from a \textit{token identifier}, which is a unique positive integer, to the corresponding token profile. The native token has identifier $0$.
  244. Note that the following account model is distinct from the smart contract account model in general, where all transactions are tied to a given account, although such platforms also have an account-based token ownership model. Transactions are instead on Joystream, at least most of the time, tied to membership, which has been explained in further detail in section \ref{sec:member}.
  245. \section{Member} \label{sec:member}
  246. \subsection{Overview}
  247. % Move later?
  248. The membership concept is meant to unify all platform-level participation for the same actor in a way that is independent of token ownership in the account system. This means that all platform level actions are with reference to a particular membership. A given member may of course occupy a range of different roles through the same membership. Membership is conceptually a base role in itself. Having an integrated representation of the participation of a single actor is very valuable in supporting efficient communication and collaboration and supports pro-social investment in the actor's reputation. Separating this from token holdings is valuable, as it allows for some type of participation to be possible without tokens, for example, as a means for actors to earn their first tokens
  249. \subsection{Member, Profile and Registry} \label{sec:member_profile}
  250. A \textit{member} is an actor who is registered in the \textit{membership registry} and is defined as follows: \\
  251. \begin{concept_box}{Member}
  252. \begin{itemize}
  253. \item[-] \textbf{ID:} Unique integer identifier.
  254. \item[-] \textbf{Key:} Public key. This is the key used to authenticate transactions as a member. %, and also in the messaging system described in section \ref{sec:communications}.
  255. \item[-] \textbf{Handle:} String used as human readable identifier (UTF-8).
  256. \item[-] \textbf{Avatar:} Storage identifier for avatar image (see section \ref{sec:data_storage_and_distribution}).
  257. \item[-] \textbf{Description:} String of capped length (UTF-8).
  258. \item[-] \textbf{Added:} Date and time when the membership was first established .
  259. \item[-] \textbf{Entry:} If membership was established through screening (see section \ref{sec:membership_curation}), the this is set to ID of screening authority which created membership. If it was established through payment (see section \ref{sec:paid_membership}), then this is the paid term ID of the terms. Otherwise, its blank.
  260. \item[-] \textbf{BRAQs Instances:} Set of BRAQ instances for all base member actions (see section \ref{sec:BRAQ})
  261. \item[-] \textbf{Suspended:} Whether member is suspended.
  262. \item[-] \textbf{Subscription:} If at least one subscription has been entered, then this is the date and time of that event and the corresponding subscription term ID (see section \ref{sec:subscription}). Otherwise its blank.
  263. \end{itemize}
  264. \end{concept_box}
  265. The membership registry is simply a mapping that associates the identifier (ID) of a member with the corresponding profile. Lastly, there is also a set of BRAQ quotas, called the \textit{default membership quotas}, used for all base membership BRAQ instances with indirect proxy quotas.
  266. The suspension field only impacts a member's capacity to act through their base membership capacities; any action derived from other roles is unaffected. Also, a member may be suspended even if this field is not set (see section \ref{sec:suspension}).
  267. A membership may be established for free, as explained in section \ref{sec:membership_curation}, or it may be paid for a one time cost of burning a given amount of tokens. As a result of free entry, a given key may be associated with a membership but no account. The converse is also possible by definition. Once a membership has been established, it is permanent. For a given key, there may both a corresponding account and membership, or either one exclusively. While an actor may find it practical to identify with the same key in both capacities, the system cannot, and does not, enforce this.
  268. % TODO: There is basic stuff missing or broken here, like how to support someone paying at a later time, and also how to deal with platform terms changing, and requiring members to accept before moving forward.
  269. \subsection{Paid Membership} \label{sec:paid_membership}
  270. \textit{Paid membership terms} represent a set of conditions for a prospective membership, through payment, on the platform, and is defined as\\
  271. \begin{concept_box}{Paid Membership Terms}
  272. \begin{itemize}
  273. \item[-] \textbf{ID:} Unique integer identifier known as \textit{term ID}.
  274. \item[-] \textbf{Fee:} Quantity of native token that must be provably burned.
  275. \item[-] \textbf{Proxy Quota:} Initial quota for membership.
  276. \item[-] \textbf{Text:} String of capped length (UTF-8) describing the human readable conditions to be agreed upon.
  277. \end{itemize}
  278. \end{concept_box}
  279. The platform has a set of terms, called the \textit{active paid membership terms}, which are currently in place for anyone seeking paid membership. It is updated through a council proposal. Any new terms introduced by the council must have an ID greater than the prior active terms; the initially active terms have an ID of $0$. The full history of such terms that were once active is kept in a list known as the \textit{paid membership terms record}, which maps the term ID to the corresponding terms.
  280. A new actor may join as a member at any time through a request, which will burn the required fee from their account, so long as the platform is accepting members. This is gated by a platform variable referred to as the \textit{platform membership gate} and can be changed through a proposal.
  281. \subsection{Subscription} \label{sec:subscription}
  282. \textit{Subscription terms} represent a set of conditions for a prospective subscriber on the platform and are defined by the following:\\
  283. \begin{concept_box}{Subscription}
  284. \begin{itemize}
  285. \item[-] \textbf{ID:} Unique integer identifier.
  286. \item[-] \textbf{Fee:} Quantity of native token that must be provably burned.
  287. \item[-] \textbf{Duration:} Number of blocks for which the subscription is valid.
  288. \item[-] \textbf{Proxy Quota Delta:} Set of proxy quotas added to the base level quotas to expand quotas.
  289. \item[-] \textbf{Text:} String of capped length (UTF-8) describing the human readable conditions to be agreed upon.
  290. \end{itemize}
  291. \end{concept_box}
  292. A member with a subscription that is \textit{active}, that is, the current block height is lesser than the sum of the subscription entry time and duration is referred to as \textit{a subscriber} in this period.
  293. Similar to that of paid membership and terms, there is an analogues concept of active terms, terms record, and a gate.
  294. While members can establish subscriptions at any time, the time line is divided into \textit{subscription periods}. In each period, a cumulative count of the total amount of fees burned for subscriptions is maintained. At the end of each period, payouts to relevant parties such as publishers, for example, are based on these final tallies.
  295. \section{Roles, Staking and Slashing} \label{sec:roles_staking_and_slashing}
  296. A \textit{role} is a membership status having a fixed number of varieties, which gives access to a range of different rights and correspondingly confers a range of responsibilities. A given member may occupy multiple roles simultaneously.
  297. \begin{comment}
  298. \renewcommand{\arraystretch}{2.1} % set row height
  299. \begin{table}[!t]
  300. \begin{center}
  301. \resizebox{0.8\textwidth}{!}{\begin{minipage}{\textwidth}
  302. \begin{tabular}{lp{5cm}p{2cm}cp{3cm}}
  303. \toprule
  304. \bf Name &
  305. \bf Description &
  306. \bf Reward &
  307. \bf Staked &
  308. \bf Entry \\
  309. \midrule
  310. Validator &
  311. Participates in the consensus algorithm as a block producer and validator. Read more in section X. &
  312. 0 &
  313. Yes &
  314. 004\\
  315. Member &
  316. Participates in the consensus algorithm as a block producer and validator. Read more in section X. &
  317. 0 &
  318. Yes &
  319. 004\\
  320. Voter &
  321. Participates in the consensus algorithm as a block producer and validator. Read more in section X. &
  322. 0 &
  323. Yes &
  324. 004\\
  325. Counicil Member &
  326. Participates in the consensus algorithm as a block producer and validator. Read more in section X. &
  327. 0 &
  328. Yes &
  329. 004\\
  330. \bottomrule
  331. \end{tabular}
  332. \caption{Table of all roles on the platform.}
  333. \label{tbl:role_list}
  334. \end{minipage} }
  335. \end{center}
  336. \end{table}
  337. \end{comment}
  338. An actor may be required to lock up a certain amount of native tokens for some time under certain conditions, and this is referred to as
  339. \textit{staking}. Typically, this is in the context of participating in some role or performing some action. In some roles, it is possible to raise or lower the staked balance on an ongoing basis within context-specific limits. There will often be a time before a change in the staked amount of tokens is counted toward the actual total staked balance. For increases, this is known as \textit{bonding period} and for decreases \textit{unbonding period}. If a stake reduction leads to the actual staked balance dipping below the minimum required for a given role at that time, then a full stake balance reduction is automatically initiated, and no increases can be initiated until the unbonding period is over. Tokens that are in one of these two periods are referred to as \textit{in flight}. Tokens staked or in flight cannot be reused to stake in another context at the same time.
  340. Under certain scenarios, it may be possible for a member to lose all or a part of their stake; this is referred to as \textit{slashing}.
  341. \section{Rewards}
  342. All staking is \textit{rewarded} in tokens paid out directly to the member account and, if no account exists, then the membership key will be used to credit an account with the same key. These payouts will come at the end of some corresponding time interval and are comprised of two components. The first component, known as the \textit{compensation payoff}, is of the form $xr^{T}$, where $x$ is the staked quantity, $r$ is a global nominal per block interest rate, and $T$ is the number of blocks in the given period. If the staked quantity has varied over the period, then $x$ will represent the average time weighted quantity. The second component, referred to as the \textit{earned payoff}, is related to the particular activity or role that was undertaken in the given period. Hence, the total reward to a given stake in a given period may be written as
  343. $$ \frac{\sum_i x_i\Delta_i}{T}r^T + C$$
  344. where $x_i$ is the quantity staked in the $i$-th sub period, which itself lasted $\Delta_i$ blocks, and $C$ is the earned payoff.
  345. \section{Governance}
  346. \subsection{Council}
  347. \subsubsection{Terms}
  348. The governance process is divided into a sequence of periods known as \textit{terms}, and the first term is known as the \textit{bootstrap term}. Each term, with the exception of the bootstrap term, has a corresponding \textit{council}, which is a set of staked members responsible for voting over submitted \textit{proposals}. Proposals are bids to execute given operations on the platform state in order to serve some contemplated end.
  349. \subsubsection{Elections}
  350. The council for a given term is established through a \textit{council election}, where all members have the opportunity to place weighted backing behind prospective councilors who announce their bid for council membership and put up their own corresponding stake. The election is conducted toward the end of a term, and current council members are expected to carry out their responsibility of dispatching proposals throughout their term. The number of council positions in the next term is always set to a given number in the preceding term referred to as the \textit{council size}. This may be altered through a proposal. A new number goes into effect at the start of the next term.
  351. The election has four stages.
  352. \begin{itemize}
  353. \item[-] \textbf{Announcements stage:} Members get to announce their candidacy for the council. They need to put a minimal amount of stake to be able to do this, which is known as the \textit{council staking limit}. This limit may be altered through a proposal, and the new limit may come into effect at the start of the next term. When not in the bootstrap term, there may already be existing council members who are also welcome to announce for the next term, which denotes \textit{extending candidacy}. A council member may in this case reuse their existing stake, which is referred to as \textit{transferring council stake}. In this case, they may have to adjust their staking amount to satisfy a staking limit that may have been altered. There is an upper limit to the number of candidates that may be voted upon and is termed the \textit{council candidacy limit}. This limit may be altered through a proposal, and the new limit may come into effect at the start of the next term. If there are more candidates satisfying the staking limit than this limit, then candidates are ranked based on the staked amount. The set of candidates who actually end up being eligible after this constraint is applied and termed \textit{candidate pool}.
  354. \item[-] \textbf{Voting stage:} All members, including current and prospective council members, \textit{back} candidates for the next term. Backing refers to staking in support of the candidacy of a member in the candidate pool. Each backing is a sealed commitment to a particular candidate, where the seal is simply salted hashing the candidate identifier. A member may reuse tokens already staked behind an existing council member to a member of the candidate pool, which is referred to as \textit{transferring backing stake}.
  355. \item[-] \textbf{Reveal stage:} All members who backed candidates must submit their salts to \textit{reveal} the candidate in each of their backings. At the end of this period, all backings are tallied for all members in the pool, and all backings without a corresponding revelation are ignored. Regarding considering the council members during tallying, the candidate pool members are ranked in terms of the total amount of stakes across all revealed backings in their favour. All those outside the council size are discarded and, if the council size is not filled, then one can re-enter the announcement stage.
  356. \item[-] \textbf{Grace stage:} All stake introduced in the given term backing a losing candidate or not revealed, is immediately unstaked. This is done so that all new stake is able to exit the consequences of an unfavourable council. At the end of this period, a new term begins with a new council. This is also is the start of the unbonding period for all stake that does not continue in the next term.
  357. \end{itemize}
  358. % TODO: This is poorly written, can it be simplified?
  359. \subsubsection{Rewards}
  360. Voters do receive an earned payoff; however, council members receive a payoff proportional to the rate of participation in processing proposals, which is is of the form $p_{i}u^{\mathsf{CM}}$, where $p_i$ is the \textit{participation rate}, i.e., rate of non-abstention (and thus revealed) votes over all votes of the $i$-th council member, and $u^{\mathsf{CM}}$ is a base reward across all council members for the given period.
  361. \subsection{Proposals}
  362. \subsubsection{Types}
  363. At any given time, there exists a finite set of different proposal types. Each type is a value for each of the following properties that apply to all proposals of the given type.
  364. \begin{itemize}
  365. \item[-] \textbf{Quorum:} The percentage of the council participants who must vote affirmatively in order for the proposal to pass.
  366. \item[-] \textbf{Threshold:} The minimum percentage of quorum that must vote for a given alternative for it to pass.
  367. \item[-] \textbf{Constitutionality:} The number of council periods in a row that must confirm the proposal for it to pass.
  368. \end{itemize}
  369. A proposal type takes the form of one among three different types of propositions. The \textit{binary proposition} is a simple pass or reject, the \textit{multiple choice proposition} require selecting one among at least two different affirmative alternatives or rejection and, lastly, the \textit{ranked choice proposition} requires providing a total ranking of a finite set of alternatives or rejection.
  370. \subsubsection{Life cycle}
  371. A proposal, of a given type, is first created by a member referred to as the \textit{proposal sponsor}. The sponsor has to back the proposal with a given amount of stake. This amount may be altered through a proposal, and the new amount goes into effect at the start of the next term. Once a proposal has been created, the council members can start submitting sealed votes on the proposition in what is known as the \textit{voting stage}. The sealed vote can be one among
  372. \begin{itemize}
  373. \item[-] \textbf{Abstention:} Signals presence, but unwillingness to cast judgment on substance of vote.
  374. \item[-] \textbf{Reject:} Against proposal.
  375. \item[-] \textbf{Affirm:} Pass an alternative or a ranking for binary, multiple-choice, and ranked-choice propositions, respectively.
  376. \item[-] \textbf{Slash:} Against the proposal, and slash proposal stake.
  377. \end{itemize}
  378. This stage ends on the earliest of the following events
  379. \begin{enumerate}
  380. \item[(a)] All council members have submitted sealed votes.
  381. \item[(b)] Time since proposal creation has exceeded a designated platform parameter. This amount may be altered through a proposal, and the new amount goes into effect at the start of the next term.
  382. \item[(c)] End of the given term, the point at which the proposal is automatically rejected by the council.
  383. \end{enumerate}
  384. The next stage allows the council members to submit revelations for their prior sealed votes and is referred to as the \textit{revelation stage}. At the end of this stage, the tallying commences, which works as follows.
  385. If all revealed votes are slashes, then the proposal is rejected and the proposal stake slashed. To clear the quorum requirement, the percentage of council members with revealed votes must be no less than the quorum value for the given proposal type. To clear the threshold requirement, the percentage of council members voting in favour of the proposition must be no less than the threshold. For multiple and ranked-choice propositions, this is interpreted to mean the number of votes in favour of the most popular choice or single ranking, respectively.
  386. When a proposal passes, it needs to immediately be put into effect; however, many proposal types have some applicability pre-condition that must be satisfied for it to be valid. If this does not hold at this time, then the proposal is simply discarded. This can occur in scenarios where the state of the platform changes in a way not foreseen by the initial proposal sponsor or council.
  387. In all scenarios given above, an archived record of how a proposal was processed will be left for future inspection.
  388. % Add pseudo code for how to process votes
  389. \subsection{Working Groups} \label{sec:working_groups}
  390. All non-validator service-provider roles on the platform are organized into domain specific groups termed \textit{working groups}, which comprise the following.
  391. \begin{enumerate}
  392. \item \textbf{Membership screening:} Grant membership status to members while trying to avoid Sybil.
  393. \item \textbf{Membership curation:} Monitor membership base for abuse and Sybil attacks.
  394. \item \textbf{Content:} Curates and manages the availability and integrity of content in the content directory.
  395. \item \textbf{Storage and distribution:} Stores and distributes static data to consumers on demand.
  396. \item \textbf{Live streaming (in future draft):} Distributes dynamic video data to consumers.
  397. \item \textbf{Discovery:} Provides standard discovery services over the content directory to consumers, i.e., search and recommendations.
  398. \item \textbf{Software development:} Develops and deploys all software assets of the platform, including consensus code and user facing applications.
  399. \item \textbf{Content finance:} Curates content finance market and adjudicates project disputes.
  400. \item \textbf{Advertising:} Polices the advertising market on the platform.
  401. \item \textbf{Communications (in future draft):} Administrates the on-chain forums, messaging channel governance, and user support inquires.
  402. \end{enumerate}
  403. \subsubsection{Leads and workers}
  404. Each group has two distinct types of roles, namely the \textit{group lead} and the \textit{worker}. Leads are elected by the council through the proposal system and are responsible for populating and managing other roles in the given group as well policing the conduct of group workers. Leads can also be replaced or evicted and, if the latter, or if there is no lead to begin with, then no group workers can perform any platform-level actions until a new leader is installed. The particular rights and privilege of a worker is entirely dependant on the group in question.
  405. Each group pays out a reward to all group members at a given interval referred to as the \textit{group payout period}, which is a platform parameter distinct for each group. This may be altered through a proposal, and the new value goes into effect at the start of the next period.
  406. \subsubsection{Installing, replacing, and evicting leads}
  407. There are two scenarios under which a new group lead may be introduced in a given group: in the case where there is no existing lead, which is only the case while bootstrapping, and is referred to as \textit{installation}; when an existing lead is leaving their position by their own initiation or alternatively by initiative from the council, and a new one is to be introduced. These are referred to as \textit{replacement} and \textit{eviction}, respectively.
  408. In all cases, candidates for a group lead role come from a list on the platform for the given group, referred to as the \textit{group lead candidate list}. Members can enter the list by staking the amount required to hold the group lead position for the given group. Each list is a fixed size and, if the number of potential candidates who have staked is greater, then inclusion is determined by how much has been staked beyond the limit, although the actual staked amount when introduced a lead is always the staking limit.
  409. %TODO: We need to write more here when the individual group schemes have been finalised
  410. \section{Membership Screening and Curation} \label{sec:membership_curation}
  411. \subsection{Overview}
  412. As mentioned before, for example, in section \ref{sec:member}, it should be possible to onboard users who do not hold any tokens. This activity, referred to as \textit{screening}, allows the platform to accommodate new users who wish to try the platform within certain constraints. However, the combination of no robust identity system and allowing users to consume resources without paying on the margin creates its own set of new problems. These resources need not only be in the form of tangibles such as compute and storage, but can also be things like peer member attention. Not only does this result in wasteful overutilisation but, perhaps, more importantly, it allows platform participants to shape their own payouts at a low cost, since resource use is often tied to payouts. For example, viewing content will divert a larger share of payout to the publisher.
  413. The Joystream protocol also suffers from these ills in principle, at least under a certain set of policy choices. There is no final solution to this without dealing with the fundamental identity and pricing preconditions. None the less, it is critical to equip the platform with a baseline capacity to engage in the presumed cat-and-mouse dynamic with such abuse to reduce the feasibility and cost of attacks.
  414. This is achieved by two measures: first, there is a capacity to block access to the platform in various ways. This activity is termed \textit{suspending} and specifically prevents the relevant actor from being able to participate in the platform through base membership actions.
  415. Second, when anyone is onboarded through screening, the corresponding platform actor who onboarded them is recorded and can be punished for a long time in future, with a suitable bonding period if the abuse is uncovered.
  416. \subsection{Working groups}
  417. This work is parceled out into two complementary working groups, the screening and curation working groups. Both groups allow all members to engage in the same set of group activities, except for the lead, which is also involved in normal group lead activity.\footnote{In principle it is probably advisable to keep the screening group small, even perhaps to a single actor at any given time, in order to keep the set of stakeholders in this capacity limited. This also makes a longer unbonding and staking period more economical.}
  418. \subsection{Screening}
  419. Participants in the screening working group can engage in the screening process and are in that capacity referred to as a \textit{screening authority}.
  420. The precise steps involved in screening, which is an offchain process, are entirely exogenous to the protocol. The set of actual policies and corresponding tools in production at any given time is expected to be the result of an ongoing coordination, based on policy constraints from the council and group lead. Obvious mechanisms that can be employed comprise the following:
  421. \begin{enumerate}
  422. \item[(a)] Email or social media confirmation.
  423. \item[(b)] CAPTCHA, or other labeling, or perceptual tasks.
  424. \item[(c)] Onboarding delays.
  425. \item[(d)] Manual human confirmation.
  426. \end{enumerate}
  427. As part of being screened, a prospective member must accept a set of terms referred to as the \textit{screening terms} and defined as\\
  428. \begin{concept_box}{Screening terms}
  429. \begin{itemize}
  430. \item[-] \textbf{ID:} Unique integer identifier.
  431. \item[-] \textbf{Proxy Quota:} Initial quota for membership.
  432. \item[-] \textbf{Text:} String of capped length (UTF-8) describing the human readable conditions which are being agreed upon.
  433. \end{itemize}
  434. \end{concept_box}
  435. The terms to be used at any given time are known as the \textit{active screening terms} and can be changed through the proposal system.
  436. A new member can be added through screening authority by presenting a signature of the current active terms (or similar) using a key that can also be used as a basis for the membership. When this happens, the ID of the authority is also included in the membership (see section \ref{sec:member_profile}).
  437. \subsection{Suspension} \label{sec:suspension}
  438. The organization and principles of this working group are identical to the screening working group. There are three distinct forms of suspension that can be initiated, namely
  439. \begin{itemize}
  440. \item[-] \textbf{Individual:} A specific member can be suspended by setting the appropriate membership field.
  441. \item[-] \textbf{Group:} A proposal can be submitted allowing for the simultaneous suspension of all members who have been added through screening from a given screening authority within a given window of time in the past.
  442. \item[-] \textbf{Lock down:} A proposal can be submitted allowing for simultaneous suspension of all members.
  443. \end{itemize}
  444. \subsection{Rewards}
  445. All working group participants have some given group-based periodic payoff set by the council.
  446. \section{Data storage and distribution} \label{sec:data_storage_and_distribution}
  447. \subsection{Overview}
  448. Reliably storing and distributing off-chain static data at scale is one of the primary requirements of the platform. This includes data such as media content, metadata, applications and static assets, and private (encrypted) member data such as preferences and statistics. Specifically, this subsystem should satisfy a range of objectives
  449. \begin{itemize}
  450. \item[-] \textbf{Consumption:} Members can
  451. \begin{itemize}
  452. \item[(a)] upload content, respecting certain platform quota limits, for free and expect permanence and distribution.
  453. \item[(b)] securely download data, respecting certain platform quota limits, for free.
  454. \item[(c)] fully utilize a system with communication and resource constraints of a browser.
  455. \end{itemize}
  456. \item[-] \textbf{Paying:} Quota restrictions can be augmented as a result of paying (e.g. through subscription) or discretionary changes made by platform governance.
  457. \item[-] \textbf{Fault tolerance:} Storage has some level of fault tolerance for all content, which ensures that single actor faults do not lead to permanent data loss. This replication should economize on cost and be sensitive to platform policy regarding the desired rate of tolerance.
  458. \item[-] \textbf{Dynamic:} The platform should dynamically be able to be and remain effective at distributing content in concert with changes in total volume of downstream demand and where this demand is located.
  459. \item[-] \textbf{Privacy:} View counts and quota limits are maintained without leaving a permanent public history of what end user viewed what and sharing viewing activity with as few counterparties as possible.
  460. \item[-] \textbf{Ad Awareness:} It may be desirable to interleave media distribution with a dynamic advertising system and, in order to support this, the infrastructure must know when to inject what ad, to whom, and how long to block until normal distribution is resumed.
  461. \item[-] \textbf{Low Bar:} Barrier to entry for aspiring service providers is not too high, for example, in the requirement of lots of hardware or stake.
  462. \end{itemize}
  463. The key problem in organizing this part of the platform is correctly enforcing rewards and punishments on the infrastructure providers. This requires that one accurately determines whether they are behaving correctly. At the core of this assessment lies the problem of how to adjudicate disputes over the timeliness and integrity of response to queries. It is fundamentally not possible to furnish direct purely cryptographic proofs about such claims; hence, the fallback of most alternatives is to construct mechanisms that provide game theoretic assurances of honest and reliable conduct. These alternatives most often attempt to be open commodity markets, where buyers and sellers have temporary relationships. Here, a much simpler approach is utilized, where most good conduct is expected based on risk of governance-based sanctions on deposited bonds, and losing reputational capital. Honesty of the platform, and thus its governance outcomes, is assumed to be reliable due to being a long-term player.
  464. \subsection{Working Group}
  465. The working group is made up of the following roles
  466. \begin{itemize}
  467. \item[-] \textbf{Lead:} Has the normal group-lead responsibilities, but also performs two additional coordinating functions, namely
  468. \begin{itemize}
  469. \item[(a)] Produces policy for how different data should be distributed at any given time.
  470. \item[(b)] Receives and processes errors about misconduct or unavailability among group members.
  471. \end{itemize}
  472. \item[-] \textbf{Storage:} Stores a copy of some subset of data in the data directory and replicates to peers and distributors upon request.
  473. \item[-] \textbf{Distributor:} Distributes data in the data directory on demand to members.
  474. \end{itemize}
  475. \subsection{Storage providers}
  476. A storage provider is member of a group of providers termed \textit{storage tranche group} who share the same participation terms. A tranche is defined as follows: \\
  477. \begin{concept_box}{Storage provider Tranche}
  478. \begin{itemize}
  479. \item[-] \textbf{ID:} Unique integer identifier.
  480. \item[-] \textbf{Capacity:} The number of bytes of storage capacity required.
  481. \item[-] \textbf{Out speed:} The number of Mbps required.
  482. \item[-] \textbf{Stake:} The amount of stake required.
  483. \item[-] \textbf{Duration:} The number of block service to be provided from the initiation block.
  484. \item[-] \textbf{Fixed Reward:} Quantity of native token earned per unit of time.
  485. \item[-] \textbf{Variable Reward:} Quantity of native tokens earned per unit of date stored.
  486. \item[-] \textbf{Slots:} Total number of roles available in this tranche.
  487. \item[-] \textbf{Terms:} String of capped length (UTF-8) describing the human readable conditions to be agreed upon.
  488. \item[-] \textbf{Active:} Whether tranche is actually possible to use, that is, assign new members.
  489. \end{itemize}
  490. \end{concept_box}
  491. All these are kept in a mapping known as the \textit{tranche registry}, which maps tranche ID to the corresponding tranche. Even when a tranche is no longer active, or will be used in the future, it continues to be a part of the registry.
  492. The participation of a member in the role as a storage provider is represented by a \textit{tranche membership} and is defined as follows: \\
  493. \begin{concept_box}{Tranche membership}
  494. \begin{itemize}
  495. \item[-] \textbf{Member:} Membership ID.
  496. \item[-] \textbf{Tranche:} Tranche profile ID.
  497. \item[-] \textbf{Started:} Block height where role started.
  498. \item[-] \textbf{Availability:} Amount of bytes still available.
  499. \item[-] \textbf{Active:} The block at which this provider is to be considered active.
  500. \item[-] \textbf{Paused:} Whether this role is currently paused.
  501. \end{itemize}
  502. \end{concept_box}
  503. Such profiles live in a mapping from the ID to the profile termed the \textit{storage providers}. A member is only considered a provider when the corresponding profile is registered in this map, and this happens through the group lead. The active status of a membership is meant to afford some time between when the provider has entered the role and when there is a full obligation to provide service. The pausedness of a membership is meant to allow discretionary pause in inbound storage requests due to extraordinary circumstances and can be invoked by the member or lead directly.
  504. Note that the same member may participate as a storage provider multiple times and under different tranches.
  505. \subsection{Distributors}
  506. Distributors are organized in a very similar way to storage providers, with analogous concepts such as \textit{distributor tranche group}, \textit{profile}, \textit{registry} and \textit{membership}, with suitable minor alterations. In particular, tranches will also include information about geographically bound latency guarantees and the number of simultaneous upstream connections.
  507. \subsection{Data directory}
  508. The platform maintains state about the available data, and how it is distributed, in the \textit{data directory}. All data objects stored correspond to one among a finite set of \textit{data object types}. Each type is meant to capture the following storage and distribution requirements for some broader family of objects:
  509. \begin{itemize}
  510. \item[-] \textbf{Infrastructure requirements:} By allowing a range of guarantees about permanence and performance, which better aligns with the underlying requirements of different data objects, one can allow better resource utilization.
  511. \item[-] \textbf{Access policy:} Some objects may only be accessible to a given member for certain periods of time, if at all. The obvious example will be data objects behind paywalls.
  512. \item[-] \textbf{Accounting procedures:} Some objects may require some kind of accounting or cleanup as a result of accessing the data. This can, for example, be used to record reliable access statistics for media content, i.e., view count.
  513. \end{itemize}
  514. The first requirement is about reducing cost while the latter two about making the same infrastructure parametric and thus reusable for a wide range of purposes. A data object type is specifically designed as follows: \\
  515. \begin{concept_box}{Data object type}
  516. \begin{itemize}
  517. \item[-] \textbf{ID:} Unique integer identifier.
  518. \item[-] \textbf{Description:} Human readable description.
  519. \item[-] \textbf{Size limit:} When set, represents the maximum number of bytes.
  520. \item[-] \textbf{Replication factor:} Number of copies for data objects of this type that need to exist in the storage system at any time. The simplest interpretation for this is the minimum number of storage providers that must replicate the data object.
  521. \item[-] \textbf{Storage tranches:} Set of tranche IDs that can be used with this data type. If empty, then any tranche can be used.
  522. \item[-] \textbf{Active:} Whether objects of this type can be added at this time.
  523. \end{itemize}
  524. \end{concept_box}
  525. All available types are kept in mapping termed the \textit{data object type registry}, which maps the ID to such a type. Admissible storage tranches are in part kept on the platform to allow automatic assignment of storage providers to any new data object of a given type. For the same reason, there is no commitment to the distributor tranche because distribution requirements will often depend on internal details about the data object itself, which are hard to fully describe.For example, it can be the case where whenever a particular publisher uploads a media item, there are substantial inbound download requests from a corresponding area. This type of policy rule is better left to discretion to setup rather than an automatic consensus rule.
  526. Each data object is defined as follows:\\
  527. \begin{concept_box}{Data Object}
  528. \begin{itemize}
  529. \item[-] \textbf{CID:} A content identifier that allows secure authentication of the data under some implicit chunking schema.
  530. \item[-] \textbf{Type:} Data type ID.
  531. % TODO: flush out further, in particular we need to allow for the system to gracefully change chunking over time, so perhaps keep chunking policy in system.
  532. \item[-] \textbf{Size:} Number of bytes occupied by data.
  533. \item[-] \textbf{Added:} Date and time for original upload event.
  534. \item[-] \textbf{Origin:} ID of member who uploaded the data.
  535. \item[-] \textbf{Liaison:} ID of storage provider that accepted the initial upload.
  536. \item[-] \textbf{Liaison judgement:} One among \textit{pending}, \textit{rejected}, and \textit{accepted}.
  537. \end{itemize}
  538. \end{concept_box}
  539. All records are kept in the \textit{data object registry}, which is a mapping from the CID to the corresponding record. The fact that a storage provider is storing a data object is represented by a \textit{data object storage relationship}, which is defined as follows: \\
  540. \begin{concept_box}{Data object storage relationship}
  541. \begin{itemize}
  542. \item[-] \textbf{ID:} Unique integer identifier.
  543. \item[-] \textbf{CID:} CID of data object.
  544. \item[-] \textbf{Storage:} ID of storage provider which should store object.
  545. \item[-] \textbf{Ready:} Whether the service relationship is ready to be honored by the provider.
  546. \end{itemize}
  547. \end{concept_box}
  548. Such relationships are kept in the \textit{storage relationship registry}, which maps the ID to the relationship. Analogous concepts for distribution that are referred to as \textit{data object distribution relationship} and \textit{distribution relationship registry} also exist.
  549. Lastly, a member downloading a data object is represented by a \textit{download session}, which is defined as follows: \\
  550. \begin{concept_box}{Download session}
  551. \begin{itemize}
  552. \item[-] \textbf{CID:} ID for content.
  553. \item[-] \textbf{Consumer:} ID for member downloading.
  554. \item[-] \textbf{Distributor:} ID for distributor that distributes the content.
  555. \item[-] \textbf{Initiated:} Date and time when the session was initiated.
  556. \item[-] \textbf{State:} Either \textit{started} or \textit{ended}.
  557. \item[-] \textbf{Transmitted:} Amount of bytes of data actually downloaded.
  558. \end{itemize}
  559. \end{concept_box}
  560. Such sessions are kept in the \textit{download session registry}, which maps the ID to the session. Please see the discussion (section \ref{sec:discussion}) on how to address obvious scale and privacy problems introduced by sessions and the registry.
  561. \subsection{Uploading} \label{sec:data_storage_and_distribution:uploading}
  562. A normal uploading flow is as follows \footnote{This is a highly informal description which will be fleshed out in future drafts.}:
  563. \begin{enumerate}
  564. \item
  565. The user issues a transaction to create a new data object record by providing a CID for the underlying payload as well as information about its size and type ID. The transaction is only valid if
  566. \begin{itemize}
  567. \item[(a)] the CID is not already in the data registry.
  568. \item[(b)] the size respects data type size limit.
  569. \item[(c)] data type is active.
  570. \item[(d)] sufficient storage capacity is available among active, non-paused, storage providers within the set of tranches available for data type.
  571. \item[(e)] uploader has no other data object records with pending liason judgment.
  572. \end{itemize}
  573. If so, this will result in the creation of a data object record, where the liason and storage object relationships are automatically assigned. All the latter have an initial status of not being ready. The liason judgment is set to pending. If the record remains pending over some time limit, then the record goes away, and the lead is needed to inspect any received error reports.
  574. \item
  575. The user connects to the liason and requests to upload the data by referencing the data object record. The storage provider can validate the request by reading the platform state and can only then proceed to accept the upload.
  576. \item
  577. The storage provider will check
  578. \begin{itemize}
  579. \item[(a)] the payload matches the CID,
  580. \item[(b)] has the right size, and
  581. \item[(c)] passes an upload filter\footnote{TBD.}
  582. \end{itemize}
  583. If either fails, the judgment will be set to rejected for the given reason. If all pass, the judgement will be set to accepted, and the corresponding storage relationship will be set to ready.
  584. \item
  585. The liason must accept incoming replication attempts from all other providers with a storage relationship with the given record. As they receive the payload, each has a responsibility to alter the readiness of their storage relationship. Any relationship that is still not ready after some defined period of time from the time the record has been added is considered a failure. At this point, the lead must inspect any possible reported errors and adjudicate.
  586. \item
  587. When the time limit for replication by all storage providers has been exceeded, the lead creates distribution relationships for the record based on local policy.
  588. \item
  589. The distributors corresponding to the new relationships can connect to the storage providers that have corresponding storage relationships with ready status to acquire a copy of the payload.
  590. \end{enumerate}
  591. \subsection{Downloading}
  592. A normal downloading flow is as follows \footnote{This is a highly informal description which will be fleshed out in future drafts.}:
  593. % policy for accounting and access: where to get supplementary statE? type tells you.
  594. % should there be an `download mode` ifnormation for trying to access a given type of data?
  595. % ... this would be in the inital tx and view record added to chain at any rate.
  596. \begin{enumerate}
  597. \item
  598. The downloader issues a transaction to create a download session by providing the relevant CID. The transaction is accepted once the following holds:
  599. \begin{itemize}
  600. \item[(a)] the CID corresponds to a data object record
  601. \item[(b)] the data object record has at least one distributor relationship that is ready
  602. \item[(c)] the access policy of the data type accepts the request
  603. \end{itemize}
  604. If so, then a session is added to the session registry, which is in the started state and where the distributor has been chosen from the available ready set.
  605. \item
  606. The downloader connects to a host corresponding to the assigned distributor and authenticates and finally provides a verifiable reference to the new session.
  607. \item
  608. The distributor sends verifiable (based on Authority Key) data chunks in response to requests from the downloader in a tit-for-tat exchange. The downloader sends to the distributor a signature over the claim that a certain total amount of data has been transmitted over the lifetime of the session, analogous to payment channels \cite{payment_channels}. To avoid latency, there should be some amount of pipelinining.
  609. \item
  610. The exchange ends when either all data has been sent or when the downloader has terminated the exchange. At this point, the distributor will submit a new transactions with the most recent signed consumption statement from the downloader. This transaction will settle both the actual consumed data in the session and the state of the session.
  611. \item
  612. Any data type specific accounting policy is executed with reference to the session.
  613. \end{enumerate}
  614. \subsection{Entry, exit, and distribution policy updates}
  615. There are a number of key infrastructure dynamics, such as entry and exit of actors into the roles as distributors or storage providers, and also updates on what is being assigned to what data. These may be initiated and coordinated through off-chain messaging protocols. An honest conduct is expected purely on governance sanctions. This will be described in further detail in the future.
  616. \subsection{Policing and data removal}
  617. The storage and distribution infrastructure is really a utility for the rest of the platform, hence the removal of data from this infrastructure, for any reason, is under the control of the working group which has control over the use case to which the data corresponds.
  618. \subsection{Rewards}
  619. All payouts take place at a given group-specific payout interval.
  620. The group lead is paid a given amount of tokens regardless of what has occurred. Storage providers and distributors both have a fixed and variable payout component, where the latter is based on the actual stored or distributed data quantities, and the rates are captured in the corresponding tranche profiles. The actual variable base quantities are maintained through the uploading assignment process and data type-specific accounting policies, respectively.
  621. % TODO: add section on livestreaming
  622. %\section{Livestreaming} \label{sec:livestreaming}
  623. \section{Content directory} \label{sec:content_directory}
  624. \subsection{Overview}
  625. The content directory contains information about the media content available on the platform. More importantly, it does not contain the primary media itself, which is stored in a separate off-chain infrastructure described in the section on storage and distribution (section \ref{sec:data_storage_and_distribution}).
  626. \subsection{Working group}
  627. The working group comprises the lead and the member. Members are responsible for executing the following functions
  628. \begin{itemize}
  629. \item[-] \textbf{Curation:} Ensuring that the underlying content media and metadata correspond to each other, e.g., in that they display assets are correct or content is in the correct category, etc.
  630. \item[-] \textbf{Policing:} Adjudicating disputes around the availability, ownership, and attribution of content.
  631. \item[-] \textbf{Filtering:} Maintaining and developing the filtering technology in place when publishing to the directory.
  632. \item[-] \textbf{Verification:} Granting privileged status to publishers and content as verified and canonical, which helps in discovery and resolves disputes over the publisher namespace.
  633. \end{itemize}
  634. \subsection{Publisher}
  635. A \textit{publisher} is a member who is allowed to publish content in the content directory and is defined as follows: \\
  636. \begin{concept_box}{Publisher}
  637. \begin{itemize}
  638. \item[-] \textbf{Name:} This is separate from membership name and is its own namespace.
  639. \item[-] \textbf{Description:} A description of the publisher.
  640. \item[-] \textbf{Brand artifacts:} Data directory CIDs for a set of off-chain artifacts that make up the profile brand identity.
  641. \item[-] \textbf{Verification status:} Whether the implied identity of the publisher profile matches the actor who is in control of the membership.
  642. \end{itemize}
  643. \end{concept_box}
  644. \subsection{Content}
  645. There is a base set of properties for all content on the platform, which includes the following:
  646. \begin{itemize}
  647. \item[-] \textbf{Category:} The type of content.
  648. \item[-] \textbf{Payload:} Data directory identifiers for media and metadata.
  649. \item[-] \textbf{Owner:} A publisher or content project planner (see section \ref{sec:content_finance}) who has control over the content and rights to value.
  650. \item[-] \textbf{Monetization policy:} How end users must pay to access content, among which are being free (with or without advertising), transactional, or subscriber access (only subscribers have access).
  651. \item[-] \textbf{Dispute status:} Whether some dispute is currently ongoing. This has implications for how end users should engage with the content.
  652. \end{itemize}
  653. There are a fixed set of primary content categories that are supported at any given time. Each category defines a particular schema for how to define key properties, including
  654. \begin{itemize}
  655. \item[-] \textbf{Payload format:} How to organize the media payload.
  656. \item[-] \textbf{Rendering:} Metadata about how to play back or render media.
  657. \item[-] \textbf{Accessibility resources:} Things that assist a variety of users in consuming the content, such as subtitles or translation metadata, dubbing information, etc.
  658. \item[-] \textbf{Attribution:} Defines who did what in the process of producing the content.
  659. \end{itemize}
  660. Content will also have associated social information around engagement, such as view/access rates and counts, likes, and a comment feed.
  661. \subsection{Disputes}
  662. Any member can submit a dispute about any published content, and these disputes are processed by the working group. There will be a range of different dispute forms, some with the goal of entirely removing content while others with changing attribution or ownership information and, as a result, redirect revenue streams.
  663. %\subsection{Content Filtering}
  664. %\textcolor{red}{TBD.}
  665. \subsection{Rewards}
  666. All group members are paid fixed amounts per unit of time.
  667. \section{Discovery}
  668. \subsection{Overview}
  669. In order for end users to effectively discover relevant content in the content directory, access to the directory is required, and the ability to execute effective processing heuristics across this data needs to be set promptly. In order to alleviate the resulting processing and bandwidth costs, this will impose there is a designated set of discover nodes that provides these services.
  670. \subsection{Working group}
  671. The working group is composed of members that run nodes running a discovery provider service, as described in the next section.
  672. \subsection{Services}
  673. There are three types of discover services that are offered by discovery provider nodes
  674. \begin{enumerate}
  675. \item[-] \textbf{Search:} Keyword and filter-based ranked lists of content.
  676. \item[-] \textbf{Browsing:} Category and filter-based ranked lists of content.
  677. \item[-] \textbf{Recommendations:} Content identifier-based ranked lists of content.
  678. \end{enumerate}
  679. In all three cases, the response provided by a service provider includes the relevant content as well as Merkle proofs, which allows the client to authenticate the integrity of the response. If required, one can extend this to have automated slashing based on bad proofs sent to clients. There is no way to prove omission in this scheme. There will not be a well-defined definition of what this may imply, as different discovery providers are free to pursue their own ranking and discovery policy. Reasonable incentives for good behavior can be generated by encouraging user clients to keep local statistics about the success rate of various providers or by measuring user behavior, which will in turn drive more traffic to better providers. Likewise, the incentive to generate more traffic can be generated by giving a provider the privilege of displaying in-place advertisement, which is not hooked into the normal advertising ecosystem. The inclusion of minimal telemetry feedback to providers can also help them guide the development of their own discovery policies.
  680. \subsection{Rewards}
  681. Beyond the incentive described in the prior section, all providers are given a fixed token reward per unit of time.
  682. \section{Software development}
  683. \subsection{Overview}
  684. Software development needs to be understood broadly, encompassing all activities surrounding research, production and testing of standards (e.g. analogous to BIPs or EIPs), protocols, algorithms, source code, binaries and other digital software assets, as well as deploying such outputs into production environments. Three aspects of this activity are of importance to the platform.
  685. \subsubsection{Financing}
  686. Many protocols suffer from the lack of an endogenous financing mechanism, and stateless protocols cannot have them by definition. Even in many stateful protocols, key contributors end up either severly underfunded, which is detrimental to quality and development progress, or relying on third-party revenue sources that do not have incentives that are guided by the interests of all protocol stakeholders.
  687. To address this, the platform has a dedicated working group of contributors who are rewarded for providing these sorts of services and are accountable to stakeholders through the governance process.
  688. \subsubsection{Development}
  689. For a variety of reasons, most software development projects for open stateful protocols end up with an equilibrum where the development process is organized around a canonical collaborative state. By collaborative state, we mean some sort of code base and social collaboration metadata about that code base. For example, the state may often be a Git repository, and the collaboration metadata may be repository hosting service of some kind, or it can be a curated mailing list of patches and discussion. Ultimately, some social consensus process emerges for how changes to this state is made and, almost invariably, this process becomes a source of market power, its integrity becoming a security risk, and is not formally accountable to protocol stakeholders. Socially desirable changes may be rejected or adopted too slowly, and changes that are undesirable may be adopted. While fork based exit is in principle an option, it is also expensive. This results in the following specific requirements:
  690. \begin{enumerate}
  691. \item[-] \textit{Accountable canonicity}
  692. The platform provides the means by which everyone securely resolves the same collaborative state at all times.
  693. \item[-] \textit{Open contributions}
  694. Any member should be able to submit a proposal for changes.
  695. \item[-] \textit{Direct control}
  696. The governance process may directly mutate the state at any time.
  697. \item[-] \textit{Gated updating and moderation}
  698. Designated role(s) occupied by a dynamic actor set, subject to governance, have the right to accept contributions or make changes on an ongoing basis.
  699. \item[-] \textit{Immutable and secure updating history}
  700. An immutable history of all state changes. Even a Git repository only gives a history of states, but is devoid of secure information about whether a given commit was introduced by someone who had the right to do so. Merged commits are in this respect particularly sensitive, as this is typically the way new changes make their way into producing source snapshots. Moreover, Git does not include the broader collaborative state.
  701. \item[-] \textit{Robust availability guarantees}
  702. The highest level of guarantee is required around the actual availability of state.
  703. \end{enumerate}
  704. Given this set of requirements, the platform maintains a set of on-chain Git repositories, which include familiar functionality, such-a-pull requests, merging, issue tracking, permissions, and publishing releases and test/CI results. Critical changes such as merging are conducted in consensus using ATP.
  705. \subsubsection{Deployment}
  706. Deployment is the process of converting a set of source assets into final production assets, like binaries, and distributing these securely, and possibly automatically, to end users. This requires the following:
  707. \begin{enumerate}
  708. \item[-] \textit{Build authentication}
  709. Given a commitment to a set of source assets, there must be a reliable, reproducible, and secure way for anyone to determine whether a particular set of production assets are the correct output of this process.
  710. \item[-] \textit{Secure updates}
  711. There must be secure way for users to acquire or run new versions of software binaries.
  712. \end{enumerate}
  713. Given this set of requirements, there is a set of standards for defining and conducting deterministic builds. Software updates occur directly from the platform state.
  714. \subsection{Working group}
  715. There are two group types: lead and contributor. The lead is responsible for creating and assigning permissions on projects to contributors in order to help them perform write operations directly. While anyone can in principle contribute through their effort to development, only contributors have a recurring reward for their involvement. The working group also has its own messaging channel.
  716. \subsection{Project}
  717. A project is the following set of items stored on chain:
  718. \begin{enumerate}
  719. \item Git repository.
  720. \item Permissions for who, in the working group, is allowed to make write operations, i.e., push and merge into it.
  721. \item A set of open issues and pull requests with a corresponding discussion thread.
  722. \item A set of releases associated with tagged commits.
  723. \end{enumerate}
  724. The normal write operations in Git repositories, such as initialization, pushing, merging, and tagging, are fully secured by the platform itself by having the Git processing rules embedded in the consensus itself. Opening issues and pull requests are open to any platform member, but only a working group member with suitable permissions can actually moderate issues or merge requests.
  725. \subsection{Artifacts, reproducible, and releases}
  726. An artifact is a file that is the result of some processing of the source material in a project repo commit. This processing may involve processes such as building, linking, and packaging. There is a format to describe such processes, and these will always yield fully deterministic outputs. These processes occur entirely off chain; however, the determinism about the outputs is critical in order to facilitate reliable coordination around the results, in particular around the validity of hash commitments of the artifacts. The most important process is the building process, where this determinism provides reproducible builds. A release is a simple publication of a set of artifacts corresponding to a tagged commit. This can only be done by the group lead and, if the proposed hash commitments turn out to be fraudulent, then they can be challenged through a proposal by anyone. If found to be a correct challenge, then the lead will face sanctions and the challenger will get reward.
  727. %\textcolor{red}{ TBD: Specific format later, R\&D being done.}
  728. \subsection{Automated testing}
  729. There is a format for describing how to run tests off chain. The presence of tests' metadata prevents pull requests from going through unless the group lead signs on them as suitably passing. Just like in the release process, such sign offs can be challenged.
  730. %\textcolor{red}{ TBD: Specific format later, R\&D being done.}
  731. \subsection{Deployment and upgradeability}
  732. There are two types of deployments on the platform. Light deployments simply involve updating the platform state to reflect a new version of some application is available, whether it is backward compatible, and thus optional, and how to retrieve the application itself.
  733. The other type of deployment is heavy deployment and also involves some sort of change to the consensus as well. This change does not involve simply changing some platform parameter value, but rather making an exogenous change to the platform state or processing logic itself. Such a deployment may be just a set of consensus changes that support change in the behavior of a single application or a change in the platform that requires a concerted upgrade to a number of different applications simultaneously.
  734. Both types of deployments are triggered when the group lead submit a proposal based on a release. When this proposal is accepted by the council, the application artifacts are replicated to storage and distribution infrastructure from the group lead. Installations on consumer devices to automatically and securely update are conducted by first consulting the chain to detect the deployment and then connecting to the distribution infrastructure to fetch the payload.
  735. %\textcolor{red}{TBD: [Specific format later, depends on Tendermint vs Substrate decision also, R\&D being done.]}
  736. \section{Content finance} \label{sec:content_finance}
  737. The platform has a built-in ecosystem and tools for creators to finance the production of new works through flexible crowd funding, which gives backers a stake through a project-specific token. This stake gives the right to engage in governance over the project, a possible share of revenue generated by produced assets, and possibly the option to trade assets in a market on the platform.
  738. \subsection{Working group}
  739. All working group members, including the lead, have the same two sets of responsibilities
  740. \begin{itemize}
  741. \item[-] \textbf{Curation:} Curating the project pool for abusive or non-compliant proposals.
  742. \item[-] \textbf{Arbitration:} Arbitrating disputes in project, where the primary sanctions would be in the form of banning, redirecting project funds, and slashing organizer stake.
  743. \end{itemize}
  744. \subsection{Project life cycle}
  745. A project is initially created by the prospective project organizer, and this step involves specifying
  746. \begin{itemize}
  747. \item[-] \textbf{Description:} Text, visual, and other assets used for the description of the project.
  748. \item[-] \textbf{Assets and terms:} What final productive assets will be produced, and what claims, if any, do backers have on different assets in terms of use and reward.
  749. \item[-] \textbf{Funding:} A description of the funding model of the project, including
  750. \begin{itemize}
  751. \item[(a)] How much is being raised, minimum and maximum
  752. \item[(b)] When do the sales begin and how long do they last.
  753. \item[(c)] How much of the total project stake is up.
  754. \item[(d)] What jurisdictions are allowed to participate in funding.
  755. \end{itemize}
  756. \item[-] \textbf{Token:} A description of the project token, including
  757. \begin{itemize}
  758. \item[(a)] Name
  759. \item[(b)] Symbol
  760. \item[(c)] Whether it is trade able, if so at what earliest time after end of funding period
  761. \item[(d)] Whether it gives claim on revenue
  762. \item[(d)] Whether it gives claim to govern
  763. \end{itemize}
  764. \item[-] \textbf{Claimants:} Token allocations to those with claims against the project due to their involvement in the production process.
  765. \end{itemize}
  766. The project itself goes through the following states after being submitted:
  767. \begin{itemize}
  768. \item[-] \textbf{Review:} Here, it will be reviewed to see if it is acceptable within the policy of the platform at the time.
  769. \item[-] \textbf{Open:} The project becomes visible to the public, and corresponding communication channels become available, namely a messaging room and a messaging forum.
  770. \item[-] \textbf{Funding:} Backers can send funds to the project.
  771. \item[-] \textbf{Production:} The raised funds are deployed to create project assets, with the organizer and backers collaborating through a governance process. In particular, the funding may be released based on milestones.
  772. \item[-] \textbf{Active:} Productive assets are finalized and distributed through the platform and possibly third-party platforms also. Any revenue generated by assets distributed on the platform directly will automatically pay out claimants based on the given term, possibly subject to governance. Any revenue generated on external platforms must be documented and submitted to the project by the organizer. Failure to do so will trigger a dispute, and possible sanctions, with the arbitrator.
  773. \item[-] \textbf{Terminated:} The project is over in that backers have no further active influence or claims. The terms will describe when, or if, this can occur.
  774. \end{itemize}
  775. \section{Advertising} \label{sec:advertising}
  776. The platform has a built-in advertising targeting, auction, and delivery system. It allows advertisers to reach audiences through a competitive bidding process for display time across a variety of surfaces in consumer-facing experiences. A core premise for a well functioning advertising ecosystem is that a substantial number of non-Sybil users are accessing the platform through a well-behaved reference client.
  777. \subsection{Working group}
  778. The advertising working group just has a single member, which is the lead, referred to as the advertising authority. This role is responsible for running nodes that assist end users in fetching the correct advertising campaigns from the auction system, and also settling the state of campaigns upon completion or termination, while keeping the display information off the chain.
  779. % FIXME Important to not hold on to data, if leaked, the signatures which validate the authenticity of the data include
  780. \subsection{Surfaces and targeting}
  781. At any given time, there is a fixed set of such surfaces available, each with its own set of display, interaction, and targeting constraints. A separate advertising auction is maintained for each surface, where access allocated to the highest cost per impression bid is currently available.
  782. There are two families of targeting parameters, audience, and session parameters. Audience parameters are those that allow one to target consumers based on individual characteristics, such as age interval, gender, location, language, consumption history, wallet balance, etc. This information does not go on the chain in clear text, but some of it may be stored in the membership settings' object in encrypted form. Session parameters are those that are specific to the context in which the surface is being displayed, thus identifying media being viewed or searched for, or category being browsed, etc.
  783. While all surfaces can target based on audience parameters, the type of session parameter available depends on the surface in question.
  784. Targeting values will be shared with advertising authority to both select the correct ad and also provide confirmation of viewed ads back to the authority; however, this viewing information is never published on the chain.
  785. \subsection{Campaigns}
  786. A campaign is a bid to occupy a certain surface, subject to a particular set of targeting parameters, at a particular price per impression. Specifically, it includes
  787. \begin{itemize}
  788. \item Advertiser identification.
  789. \item Advertising payload matching constraints of given surface. % FIXME . Some lives offchaining your own server?
  790. \item Targeting parameter values matching constraints of the given surface.
  791. \item Expiry time.
  792. \item Maximum number of impressions.
  793. \item Price per impression.
  794. \item Funds covering maximum expenditure.
  795. \end{itemize}
  796. Once a campaign has been submitted, it lives in a pool of campaigns for the given surface until all the funds have been spent; it is then canceled by the advertiser or the platform.
  797. \subsection{Delivery}
  798. % TODO: Note: the delivery can be interleaved on the distributor node side
  799. % without need for a good actor client; all that is required is:
  800. % a) for the (encrypted) stream to be chunked with some chunk boundaries
  801. % aligned with the video frames at which ads are to be inserted,
  802. % b) a distributor-readable file describing such ad insertion points, and
  803. % c) some mechamism by which the distributor can resolve which ad to insert
  804. % based on the downloader ID.
  805. A given advertising surface has a display policy that prescribes when an end user should repopulate an interface (new) content. The following informally describes the steps involved in this process, including a user, an advertising authority, and an advertising server.
  806. \begin{itemize}
  807. \item The user sends the signed session and the audience targeting values to the advertising authority.
  808. \item The advertising authority filters the campaign pool for the given surface based on targeting values and returns the highest bidding match, with corresponding Merkle inclusion proofs of campaign payload.
  809. \item The user fetches the ad from advertising server and receivesthe receipt token in response.
  810. \item The user sends a receipt including this token, the campaign identifier, and their own key to the advertising authority.
  811. \item The user renders advertisement.
  812. \end{itemize}
  813. When an advertising authority detects that a campaign has been displayed enough to exhaust the funds locked up, it submits a proof of this to the platform, which also includes information about how many impressions have been derived from surfaces that are tied to publisher content and what content has actually been shown. This proof is made up of all the receipts from the users that have fetched the given ad. It is compressed using the ZkSNARK primitive \cite{ben2014succinct}, where the user keys are kept as private inputs. This proof can also enforce limits on how many times any given user can at most have submitted a receipt for a given ad, preventing trivial abuse from a single member. The chain automatically validates the proof and settles the given campaign by burning the funds. The advertiser can cancel the campaign using an analogous process. These proofs are further combined to create proofs about the total amount of advertising revenues a publisher has a claim over a given period of time.
  814. \subsection{Rewards}
  815. The advertising authority receives a payment with two components: a fixed per unit of time payout and a payout scaled by proportion of campaign settlements for which proofs are actually submitted. Publishers receive a payout from the advertising, not in the traditional staking-based reward, but an unconditional value transfer per unit of time. This amount is set to be a given fraction of the total revenue being driven through surfaces displaying the content tied to their content.
  816. % TODO: Communications
  817. %\section{Communication}
  818. %\label{sec:communications}
  819. \section{Miscellaneous}
  820. \subsection{Resolving hosts}
  821. Frequently, one may need to resolve host nodes corresponding to an actor on the platform identified with a public key. The mapping between this key and the set of active host nodes under the control of the given actor is represented in a DHT. The actor registers mutable records of such hosts under a DHT key corresponding to the public key. When the set of active nodes changes, simply sign a new message reflecting this and store it under the given key. There are many practical implementations of this pattern; for example, IPNS or BEP44 in BitTorrent.
  822. \section{Discussion} \label{sec:discussion}
  823. In this section, various avenues of possible or required research and inquiry are explored.
  824. \begin{itemize}
  825. \item[-] \textit{Catastrophic error recovery}
  826. Given the rich-on-chain feature set of the platform and the aspiration to conduct frequent on-chain upgrades, the classical blockchain operations model of absolutely never having bugs in production, in perpetuity, may be too expensive. Among other costs, this requirement may reduce the speed of improvement and encourage a set of trusted developer gatekeepers. These costs are possibly dead weight for a protocol that does not intend on emphasizing operational availability and integrity above all other objectives. As a result, it may be advisable to investigate various formal and informal protocols that may be relied upon to coordinate recovery among validators from some sort of consensus failure.
  827. \item[-] \textit{BRAQ}
  828. The currently described model for BRAQ has at least two short comings.
  829. First, due to the presence of an inevitably imperfect screening-based membership introduction (see section \ref{sec:membership_curation}), the number of malicious BRAQ instances may silently grow over time. At some point, a concerted attack across such memberships can make chain throughput unavailable for some time. If such an attack is timed to cover some sensitive time period, it may automatically cause slashing of a platform member. This problem can be ameliorated by, for example, introducing sensible default transaction inclusion policies that favour non-BRAQ-based transactions or simply by including global limits on how many such transactions can be accepted at any given time, perhaps being implemented as a BRAQ instance itself.
  830. Second, the actual quota is not sensitive to payloads involved in actions, only the number of actions. This is not fit for a range of different purposes and can easily be amended.
  831. \item[-] \textit{ATP}
  832. The obvious problem and risk in using ATP is regarding coming up with a safe time period for a given transaction, which may also depend on the payload. Moreover, its not entirely clear how a validator must treat the scenario where the processing is not finished, despite the time being up. The simplest approach is to consider it as any other node failure, such as running out of resources, and simply stop the node.
  833. There is also the opportunity of saving on processing resources by making the current proposal into a challenge response protocol. In this alternative approach, the final state can be proposed by anyone, subject to some bond, and this proposal can be challenged by anyone during a challenge period. In a challenge, all validators can actually conduct the normal ATP processing and, this way, adjudicate the final dispute securely. A challenger found to be correct will win the bond.
  834. Another obvious alternative to the entire ATP approach are things like ZkSNARK \cite{ben2014succinct} and Truebit \cite{teutsch2017scalable}. However, this would impose severe practical limitations on what processing which within scope. For ZkSNARK, it will be, at present, infeasible to generate proofs for just about all processing that can warrant ATP to begin with, by assumption. For both the approaches, one can almost never reuse the existing implementations of the processing in question, even if it is in principle compatible with the approach-specific computing model (e.g. WASM or register machine), which is also not always going to be the case.
  835. \item[-] \textit{Governance}
  836. The current proposal for how governance and elections are organised is relatively naive to obvious problems around liveness, vote buying, and validator censorship. This despite governance being at the heart of the capabilities of the platform and the incentive compatibility of the protocol every other actor faces depends on how effective this process is. Most of the work in this proposal is about how to endow a presumed effective governance system with all the assets constituting a functional content platform. Further work on incorporating more mature ideas is needed.
  837. \item[-] \textit{Screening and suspension and seb 2.0 assets}
  838. One of the biggest weaknesses of the current proposal is that it may or may not be feasibleto manage the integrity of the memberships that are established through screening, in particular since it may be difficult to properly identify malicious attacks in production and, even if one could, the corresponding screening authority may no longer be bonded. The most obvious solution to this problem is to make a screening authority the owner of screened memberships and disable them when the authority unbonds. Members could get rescreened with a new authority, using the old keys, in order to preserve their membership. This may coincidentally ameliorate one of the other primary limitations of the platform, due to the state of current infrastructure, which is the inability to properly own assets such as domains and app store entries. An ecosystem of such screeners can own these assets, conduct their own screening procedure, and capture in the upside the membership base they bring to the platform.
  839. \item[-] \textit{Software development}
  840. Keeping this entire development process has resource costs, not primarily in throughput capacity but state size. For example, a very mature large open-source project may have a Git repository that occupies dozens of gigabytes in, primarily, commit object blobs. This is not a non-starter, per say, but clearly has costs that need to be recognized. There are other approaches, such as the OSCoin and the Radicle stack \cite{oscoin}, which aim to keep the entire process off chain, extend the Git protocol to also incorporate the collaborative assets, and delegate consensus to a trusted set of actors. This does not satisfy all the outlined requirements and begs the question of how to make the consensus actors accountable to the platform; however, it has the benefit of being cheaper on the platform blockchain.
  841. Another issue requiring further work is how to safely update the platform in concert with user facing applications that make assumptions about how the platform functions at any given point of time. This is further complicated by the objective of wanting to use the platform itself, as the infrastructure to do the application updates.
  842. \item[-] \textit{Storage and distribution}
  843. The major problem in the current approach is that all user-downloaded events result in a set of transactions and leave a permanent public history of downloads. This is infeasible from both a capacity and privacy perspective. The alternative currently being explored involves offloading these transactions into a separate chain with trust model based on fraud proofs, and governance to ensure availability, inspired by the Plasma framework. \cite{poon2017plasma}. By committing blocks, and in particular state commitments, into the main blockchain, it becomes possible to make positive claims about the current state in the parallel chain at different times, such as the total amount of data a distributor has moved or the total number of downloads for a particular data object. Expired or fraudulent states can be challenged in the same way during an exit period. Privacy can be introduced by allowing members to use pseudonymous identifier in the parallel chain, which can be proven to match a main chain membership through an appropriate ZkSNARK. The disadvantage of this approach is the complexity and latency of main chain state changes. An alternative can be to dramatically change the trust model and rely on data being shared entirely out of band w.r.t. any shared public state, and then having a voting process-based main chain update based on this objective verifiable data.
  844. A secondary objective is to replace full replication with erasure coding for each data object \cite{reed1960polynomial} such that less total storage space is required for a given level of fault based on unavailability risk. This makes the storage costs lower.
  845. \end{itemize}
  846. \bibliographystyle{unsrt}
  847. \bibliography{./assets/singlebibfile}
  848. \end{document}