This repo has been developed during my academic publications in grad school, for recent developments of Fairblock (as a start-up) please check here
While blockchain systems are quickly gaining popularity, front-running remains a major obstacle to fair exchange. In this paper, we show how to apply Identity-Based Encryption (IBE) to prevent front-running with minimal bandwidth overheads.
In our approach, to decrypt a block of N transaction, the number of messages sent across the network only grows linearly with the size of decrypting committees, S. That is, to decrypt a set of N transactions sequenced at a specific block, a committee only needs to exchange
In FairBlock, a committee named "keepers" run a DKG protocol to generate a shared master key associated with a system-wide master public key for an IBE scheme. Next, we associate each block or range of blocks with an IBE "identity". Consequently, clients can commit to their transactions by encrypting their information with master public key and an identity for a future block h (or a range of blocks). Validators run the consensus and sequence all encrypted transactions in a block. Finally, to decrypt the block with minimal overheads, each keeper (a) computes a share of the private key for the IBE identity corresponding to block identifer h, and (b) broadcasts it over the blockchain. After sufficiently many keepers propagated their shares, anyone can perform the key reconstruction process to obtain the private key that allows decryption of all transactions encrypted under identity "h" with no further communication. In FairBlock, another set combined of users, clients, or validators named "relayers" (which can be overlapping with keepers) are responsible for key reconstruction and decryption.
protocol
contains protocols for user participation, on-chain communication, Incentivization implemented in Solidity smart contracts
encryption
contains the Go code for Identity-Based Encryption and Threshold Decryption. This is built upon the IBE implementation of vuvuzela/crypto
.
-
cd protocol
-
truffle compile
-
open Ganache, make sure what in the
truffle-config.js
matches with Ganache -
truffle migrate
-
truffle test --show-events
ortruffle test
-
cd distributedIBE/ibe
-
go test
- This project has been built based on Vuvuzela and tcpaillier projects
- This implementation has not been vetted for a production setting, use with caution
- This project has been tested on Linux