This repo has been developed during my academic publications in grad school, for recent developments of Fairblock (as a start-up) please check here
Fairblock is a front-running protection mechanism for blockchain applications.
While blockchain systems are quickly gaining popularity, front-running remains a major obstacle to fair exchange and other blockchain applications. FairBlock shows 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
The blockchain for this application is built using Cosmos SDK and created with Starport. In an alternative approach, FairBlock is implemented using smart contracts as the communication layer for smart contract blockchains such as Avalanche and Ethereum.
Check out our publications on Fairblock: SecureComm 2022 paper Thesis on FairBlock
curl https://get.starport.network/[email protected]! | bash
export PATH=$PATH:$(go env GOPATH)/bin
starport chain serve
serve
command installs dependencies, builds, initializes, and starts FairBlock.
FairBlockd tx fairblock submit-target "description of target" "block height that IBE private key should be extracted" --from "client"
- Submit encrpyted messages (bids, offers, or any other sensitive information that can be used for front-running attacks if leaked)
FairBlockd tx fairblock submit-encrypted "plaintext for message" "IBE Encrpytion of message with public key derived from target block height" "deposit" --from "sender of encrypted message"
plaintext of message will be converted to SHA256 on the client as a cryptographic commitment. The messages are never leaked to any public entity which might want to front-run
FairBlockd tx fairblock submit-share "IBE key share for alice" "target block height" --from "alice"
- Original sender submits a commitment for his/her plaintext of encrypted message OR a decrpytor uses IBE private key shares and computes a private key to decrypt the encrypted message with the incentive of taking the original sender's deposit
FairBlockd tx fairblock commit-decryption "plaintext of message" --from "sender or decryptor"
The plaintext of commited decryption will be converted to SHA256 on the client side so the plaintexts are never leaked to any public entity which might want to front-run
- Original sender or the decryptor Reveals the plaintext of his/her commited decryption to take back or win the deposit
FairBlockd tx fairblock reveal-decryption "plaintext of message" --from "sender or decryptor"
FairBlockd q block
FairBlockd q fairblock list-target --output json
FairBlockd q fairblock list-share --output json
FairBlockd q fairblock list-encryptedtx --output json
FairBlockd q fairblock list-commit --output json
The blockchain in development can be configured with config.yml
.
Run the following commands to install dependencies and start a Vue.js-based web app:
cd vue
npm install
npm run serve
The frontend app is built using the @starport/vue
and @starport/vuex
packages.
cd distributedIBE/ibe
go mod tidy
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
DKG protocol on Blockchain for IBE without a trusted dealer
Front-running presentation by Phil Daian at IEEE Symposium on Security and Privacy