Practical-Off-Chain-Smart-Contract-Execution
A methodology to improve blockchain throughput and reduce gas fees by executing smart contracts off-chain.
![image](https://private-user-images.githubusercontent.com/86458423/292212540-25c0b3e0-5310-42f6-b0d1-6e776cc1e176.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDcxNzI1MzUsIm5iZiI6MTcwNzE3MjIzNSwicGF0aCI6Ii84NjQ1ODQyMy8yOTIyMTI1NDAtMjVjMGIzZTAtNTMxMC00MmY2LWIwZDEtNmU3NzZjYzFlMTc2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAyMDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMjA1VDIyMzAzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIxZGI1Y2IyNWY3NmUwNDU2MjIxNmMwMzExYzY3YjFkYzMzZDQ1ZmE0MjFmOGY1MDg4MWNmZDFmYjFjMzcwNTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0._yToPLG1TLPliTupv92d77foX8_FaCW5L56poY8FwA0)
We quantify the performance in terms of gas fees and execution time.
![image](https://private-user-images.githubusercontent.com/86458423/292262364-ac6e41f5-90ec-47fd-8c41-f8d5d623b402.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDcxNzI1MzUsIm5iZ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A1VDIyMzAzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE2MDFiZWFjZTAzNzg0MjRiYjMyZmMzNGMxZWI1ZmQ2NTM5OTk0YWM3M2EzYTQ2NjA5YTM2MzMwNDRmYTRiMzcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.cmyvjZF0j2DjjwzUPJIHzmrWk21s-XOlaOpLe1G9UTg)
Execution Details
Execution Platform
Remix
Necessary Dependencies
- Remixd
- Hardhat
- Python- Web3
Steps
- cd into the folder blockchain project by command
cd blockchain_project
- Connect your localhost to the remix platform to import the files. For this, start a connection using remixd library.
- Start a local blockchain testnet using the hardhat library in npm.
- Now deploy the solidity contract
name.sol
on the local testnet using the remix platform. - Now, run the file
client.py
in a separate terminal. This is representative of the client, who interacts with the executor from the pool of operators. - Finally, run the two files
operator1.py
andoperator2.py
in separate terminals representative of the pool of operators. - The client can give commands to the executor, chosen from the two operators and can even change the executor.
- Refer to
report.pdf
for in depth analysis .