# A Blockchain-Based Framework to Enhance Anonymous Services with Accountability Guarantees
## 2 Related Work and Background
Several studies in the literature focus on the anonymity guarantees offered by popular anonymous social networks [5; 26; 27]. However, to the best of our knowledge, no paper concerning the accountability problem is available, although several studies suggest that the lack of accountability may encourage users to engage in illegal behavior, potentially harming other users [7]. We conclude this section by providing some background notions about the blockchain technology with a focus on Ethereum. They will be useful for the understanding of some concepts that we recall in our protocol. Blockchain is a peer-to-peer network that keeps track of the occurrence of events. An entity can generate a transaction towards another entity to exchange a value. This transaction is validated by peers participating in the network, and thus does not require any third-trusted party to validate the transaction. This represents the main advantage offered by this technology. Other features are:  
* The transactions have to be validated and cannot be modified after their validation. * Users cannot repudiate a transaction that they had generated. * Anyone can access and verify the transactions stored on the blockchain. * The users generating the transactions should remain anonymous. Regarding the latter point, for example, Ethereum guarantees pseudonymity, in the sense that the identity of the users is not revealed, but their transactions are linkable. The above properties are generic of the blockchain technology and apply to almost all of the existing public-permissionless implementations [28; 29], even though there exist blockchains supporting full anonymity [30; 31]. In order to give a concrete proposal, in this paper, we refer to the Ethereum blockchain. In Ethereum, there are two types of _accounts_. The first type is represented by the _external owned accounts_ (EOAs), which are controlled by users through private/public key pairs. Specifically, a user \(U\) generates a random string of 32 bytes. It represents the private key \(PRK_{U}\) of \(U\). Ethereum leverages the elliptic curve digital signature algorithm (ECDSA) [32] by selecting the curve secp256k1. Then, by applying the ECDSA algorithm to \(PRK_{U}\), \(U\) obtains a public key \(PBK_{U}\) of 64 bytes (it represents the coordinates of a point of the elliptic curve). Finally, \(U\) applies the hash function Keccak256 [33] to \(PBK_{U}\) and takes the last 20 bytes to obtain an _Ethereum address_. This Ethereum address is used to send and receive transactions, and identifies (in pseudonymous form) \(U\) in the network. Each transaction generated by \(U\) is signed with the private key \(PRK_{U}\). The signed transaction is broadcasted in the blockchain network. Anyone can verify the signature by retrieving the public key of the signer (from the signature and the transaction) and checking that it is equal to the expected public key. Furthermore, the Ethereum address of the signer can be obtained from the public key by applying Keccak256 as described above. The second type of account is called a contract account, and represents an account controlled by code (i.e., a smart contract). A smart contract [34] can be viewed as a collection of data and functions. To deploy an instance of a smart contract, an EOA sends an Ethereum transaction containing the compiled code (on the Ethereum VM) of the smart contract without specifying any recipient. Each instance has its own data (also called state) and functions, and it is associated with an Ethereum address. To invoke a function of the smart contract, an EOA generates a transaction, including the input of the function, intended for the address of an instance of the smart contract. This function may change the state of such an instance. Since the transaction invoking the function is stored on the blockchain, due to the properties of immutability and non-repudiation, anyone can verify the correct state of any instance at any time.