0% found this document useful (0 votes)
1K views38 pages

Project Black Book

The document is a project report on developing a blockchain based crypto exchange website. It includes sections on requirement analysis, problem statement, project design using Ethereum blockchain and smart contracts, methodology, and implementation details. The project aims to build a decentralized crypto exchange using Ethereum and smart contracts for trading digital assets.

Uploaded by

Mayuresh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views38 pages

Project Black Book

The document is a project report on developing a blockchain based crypto exchange website. It includes sections on requirement analysis, problem statement, project design using Ethereum blockchain and smart contracts, methodology, and implementation details. The project aims to build a decentralized crypto exchange using Ethereum and smart contracts for trading digital assets.

Uploaded by

Mayuresh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

A

PROJECT REPORT
ON

USwap-Blockchain Based Crypto Exchange


Website
Submitted in partial fulfilment of the requirements of the degree of

Bachelor of Engineering
In
Information Technology

by

Abhishek Vishwakarma (76)


Mayuresh Patil (78)
Tejinder Singh Sandhu (79)

Supervisor(s):
Dr. Kiran Bhandari

Department of Information Technology

K.C. College of Engineering and Management Studies And


Research, Thane (E)

University of Mumbai
2022-23
i
CERTIFICATE

This is to certify that the project entitled “USwap-Blockchain Based Crypto Exchange
Website” is a bonafide work of Abhishek Vishwakarma (76) Mayuresh Patil (78) Tejinder
Singh Sandhu (79) submitted to the University of Mumbai in partial fulfilment of the
requirement for the award of the degree of “Bachelor of Engineering" in “Information
Technology”.

Dr. Kiran Bhandari Dr. Kiran Bhandari


Supervisor/Guide Co Supervisor/Guide

Prof. Amarja Adgaonkar Dr. Vilas Nitnaware


Head of Department Principal

ii
Project Report Approval for B.E.
This project report entitled USwap-Blockchain Based Crypto
Exchange Website by Abhishek Vishwakarma, Mayuresh Patil,
Tejinder Singh Sandhu is approved for the degree of Bachelor of
Engineering in Information Technology.

Examiners

1.---------------------------------------------

2.---------------------------------------------

Date:

Place:

iii
Declaration
We declare that this written submission represents our ideas in our own words
and where others' ideas or words have been included, we have adequately cited
and referenced the original sources. We also declare that we have adhered to all
principles of academic honesty and integrity and have not misrepresented or
fabricated or falsified any idea/data/fact/source in my submission. We
understand that any violation of the above will be cause for disciplinary action
by the Institute and can also evoke penal action from the sources which have thus
not been properly cited or from whom proper permission has not been taken
when needed.

Name of student and Roll No. Signature

1. Abhishek Vishwakarma (76)

2. Mayuresh Patil (78)

3. Tejinder Singh Sandhu (79)

Date:

iv
ACKNOWLEDGEMENT

We would like to express special thanks of gratitude to our guide Mrs. Amarja
Adgaonkar as well as our Project Coordinator Dr. Kiran Bhandari who gave
us the golden opportunity to do this wonderful project on the topic of USwap-
Blockchain Based Crypto Exchange Website, which also helped us in doing a
lot of research and we came to know about so many new things. We are very
grateful to our Head of the Department Mrs.Amarja Adgaonkar for extending
her help directly and indirectly through various channels in our project work. We
would also like to thank Principal Dr. Vilas Nitnaware for providing us the
opportunity to implement our project. We are really thankful to them. Finally,
we would also like to thank our parents and friends who helped us a lot in
finalizing this project within the limited time frame.

Name of student and Roll No. Signature

1. Abhishek Vishwakarma (76)

2. Mayuresh Patil (78)

3. Tejinder Singh Sandhu (79)

v
Table of Contents
Certificate ...............................................................................................................................................ii
Project Report Approval for B.E.......................................................................................................... iii
Declaration ............................................................................................................................................ iv
Acknowledgement ................................................................................................................................. v
List of Figures ......................................................................................................................................vii
List of Tables ..................................................................................................................................... viii
Abstract ................................................................................................................................................. ix
1. Introduction ........................................................................................................................................ 1
2. Literature Survey ............................................................................................................................... 3
3. Report on Present Investigation ......................................................................................................... 5
3.1. Requirement Analysis ................................................................................................................. 5

3.1.1 Scope ..................................................................................................................................... 5

3.1.2 Feasibility Study ................................................................................................................... 5

3.1.3 Hardware and Software Requirement ................................................................................... 6

3.2 Problem Statement ....................................................................................................................... 7

3.3. Project Design ............................................................................................................................. 9

3.3.1. Ethereum .............................................................................................................................. 9

3.3.2. Smart Contract ................................................................................................................... 10

3.3.3. Metamask ........................................................................................................................... 11

3.3.4. DFD Diagram..................................................................................................................... 12

3.3.5. UML Diagram .................................................................................................................... 14

3.4. Methodology ............................................................................................................................. 16

3.5. Implementation ......................................................................................................................... 20

3.5.1 Test Cases ........................................................................................................................... 20

3.5.2 Gantt Chart .......................................................................................................................... 21

3.5.3. Working ............................................................................................................................. 22

4. Conclusion ....................................................................................................................................... 27
REFERENCES..................................................................................................................................... 28

vi
List of Figures
Figure No. Name of figure Page No.

1 3.3.4.1: DFD Level 0 ................................................................................................ 12


2 3.3.3.2: DFD Level 1 ................................................................................................ 13
3 3.3.4.1: UML Diagram .............................................................................................. 14
4 3.4.1: Ethereum Working .......................................................................................... 17
5 3.4.2. Working of Smart Contract ............................................................................. 18
6 3.5.3.1 Smart Contract Setup .................................................................................... 22
7 3.5.3.2 Smart Contract Implementation .................................................................... 22
8 3.5.3.3 Home Page .................................................................................................... 23
9 3.5.3.4 Wallet Connected .......................................................................................... 23
10 3.5.3.5 Swap value with the tokens ........................................................................... 24
11 3.5.3.6 Swaping confirmation on metamask ............................................................. 24
12 3.5.3.7 Swap Completed ........................................................................................... 25
13 3.5.3.8 Transaction details on Goerli Testnet ........................................................... 25
14 3.5.3.9 Block Created for the transaction.................................................................. 26

vii
List of Tables
Table No. Name of table Page No.

1 2.1. Literature survey ............................................................................................... 3


2 3.1.3.1: Hardware Requirement ................................................................................ 6
3 3.1.3.2 : Software Requirement ................................................................................ 6
4 3.2.1: Comparison between Centralized and Decentralized Network ...................... 8
5 3.5.1.1: Test Cases Result ....................................................................................... 20
6 3.5.2.1. Gantt Chart ................................................................................................. 21

viii
ABSTRACT
The increasing popularity of cryptocurrencies has highlighted the need for secure and efficient
cryptocurrency exchange platforms. In this paper, we present the design and implementation of a
blockchain-based cryptocurrency exchange website, leveraging the latest advances in blockchain
technology. USwap provides a decentralized and transparent solution for users to trade their digital
assets. Built on the Goerli Ethereum Testnet, our platform leverages the immutability and transparency
of blockchain to provide a secure and trustless environment. Smart contracts written in Solidity
programming language automate the trading process and provide users with an intuitive interface.
Smart contracts on the USwap platform use a constant product formula to automatically adjust prices
based on supply and demand. Users can trade any ERC-20 token on USwap without the need for a
counterparty, creating a trustless and efficient trading environment. USwap ensures the safety of user
data with encryption, multi-factor authentication, and firewalls. With the potential for future usefulness
in digital currency exchange, uswap has the ability to revolutionize the digital currency exchange
industry. The implementation on the Goerli Ethereum Testnet allows for a more efficient and cost-
effective testing environment, while the use of blockchain technology ensures the immutability and
transparency of transactions. In conclusion, our blockchain-based cryptocurrency exchange website
presents a decentralized, secure, and transparent solution for digital currency exchange. With the
implementation on the Goerli Ethereum Testnet, we provide a reliable and efficient testing
environment for our users. USwap offers a secure and user-friendly interface for traders to exchange
their digital assets, creating a new era for digital currency exchange.

ix
1. INTRODUCTION
The emergence of cryptocurrencies has revolutionized the way we think about currency,
financial systems, and transactions. As more people embrace digital assets, the need for secure
and efficient cryptocurrency exchange platforms becomes increasingly apparent. In this paper,
we present the design and implementation of a Ethereum blockchain-based cryptocurrency
exchange website, USwap, that leverages the latest advances in blockchain technology to
provide a secure, decentralized, and transparent solution for users to trade their digital assets.

We will use the concept of blockchain, smart contract. We will also create Ethereum wallet
using MetaMask and also ERC20 tokens. A smart contract is a computer program that runs on
a blockchain network and executes predefined actions based on predetermined conditions. In
other words, it's a self-executing contract that can automatically trigger actions when specific
conditions are met, without the need for intermediaries. Smart contracts were first introduced
in 1994 by Nick Szabo, but it wasn't until the creation of Ethereum in 2014 that they became
widely adopted. Ethereum's smart contracts are written in a programming language called
Solidity, which allows developers to create custom applications that can automate various
processes.

Ethereum is an open-source blockchain-based platform that enables developers to build


decentralized applications (dApps) using smart contracts. It was created by Vitalik Buterin in
2014 with the aim of providing a more versatile and flexible blockchain infrastructure
compared to Bitcoin, which only supports one application - the transfer of digital
currency.Ethereum uses its native cryptocurrency, Ether (ETH), as a means of payment for
transactions and as a reward for miners who help secure the network. The platform's smart
contracts allow developers to create applications that can automate processes and run without
any downtime or interference from a third party. This makes Ethereum ideal for creating
decentralized finance (DeFi) applications, such as lending and borrowing platforms,
decentralized exchanges, and stablecoins. Goerli Ether testnet is a testing environment for the
Ethereum network that uses Goerli Ether, a type of testnet Ether. It was launched in 2019 to
provide a stable and reliable testing environment for Ethereum developers.

1
USwap is a decentralized exchange (DEX) that is built on the Ethereum blockchain. It is a
protocol that allows users to trade cryptocurrencies in a trustless and decentralized manner.
USwap is required because it provides several benefits over centralized exchanges. Firstly,
USwap allows for peer-to-peer trading without the need for intermediaries, meaning that users
have full control over their funds and can trade without the risk of theft or fraud. This is
possible due to the use of smart contracts, which automate the trading process and eliminate
the need for a central authority. Secondly, USwap provides liquidity through an automated
market maker (AMM) system. This means that traders can buy and sell cryptocurrencies
without needing to find a counterparty to trade with, as the system uses a liquidity pool that is
provided by users. This leads to a more efficient and liquid market, which can result in lower
trading fees and better prices for traders. Thirdly, USwap is open-source and fully transparent,
meaning that anyone can audit the code and verify that it is secure and trustworthy. This creates
a more trustless and decentralized trading environment, which is essential for the growth and
adoption of the decentralized finance (DeFi) ecosystem. Overall, USwap is required because
it provides a secure, decentralized, and efficient way for users to trade cryptocurrencies, which
is essential for the growth and adoption of the decentralized finance ecosystem.

2
2. LITERATURE SURVEY

Table 2.1. Literature survey

Year of
No. Author(s) & Year Title of Paper Domain of paper
Publication
Zibin Zheng, Shaoan An Overview of
Xie, Blockchain
Hongning Dai, Technology: Blockchain
1 June'17
Xiangping Architecture, Technology
Chen, and Huaimin Consensus, and Future
Wang Trends
Sidharth Rajput,
Archana Singh, Smiti
Blockchain Technology Blockchain
2 Khurana, February'22
Tushar Bansal, and Cryptocurrenices Technology
Sanyukta Shreshtha
A Systematic Literature
Review of Blockchain
Tuan-Vinh Le, Technology: Security Blockchain
3 July'21
ChienLung Hsu Properties, Technology
Applications and
Challenges
Zibin Zheng,Shaoan
Xie,
Hong-Ning Dai, Weili An Overview on Smart
4 Chen, Xiangping December'20 Contracts: Challenges, Smart Contracts
Chen, Advances and Platforms
Jian Weng,
Muhammad Imran
Bhabendu Kumar An Overview of Smart
Mohanta, Contract and Use Cases in
5 October'19 Smart Contracts
Soumyashree S Panda, Blockchain Technology
Debasish Jena
Vittorio Capocasale , Standardizing Smart
6 January'22 Smart Contracts
Guido Perboli Contracts
Margarita Capretto ,
Transaction Monitoring of
7 Martin Ceresa , and July'22 Smart Contracts
Smart Contracts
Cesar Sanchez
Mr. Advin Manhar, Blockchain
Blockchain With
8 Nachiketa Roy Soni, June'22 Technology &
Cryptocurrency
Kajal Khandelwal Cryptocurrency

3
Blockchain-Based
Ismaila Kolawole Blockchain
9 January'22 Decentralized Stock
Oshodi Technology
Exchange
Mubashar Amjad, A Novel Blockchain
Gareth Based
Taylor, Chun Sing Approach to Exchanging Blockchain
10 August'22
Lai, Information and Data in Technology
Zhengwen Huang, Power Systems
Maozhen Li
11 Kamil Jezek August'21 Ethereum Data Structures Ethereum
Tathagata Roy Bitcoin and Ethereum:
12 January'22 Ethereum
Chowdhury The Crypto Currencies
Smart Contract And
13 Nasir Ali April'22 Transaction Fee on Smart Contracts
Ethereum
Gerald B. Imbugwa, Smart Parking Solution
14 Manuel Mazzara, February'22 for Enterprise on Ethereum
Salvatore Distefano Ethereum
An Improved Ethereum-
Ahubele, Eke, B.O, Based Ethereum & Smart
15 April'21
Onuodu F.E Model for Smart Contract Contracts
Implementation
Worakamol Wisetsri,
C.Vijai, Kasidit, Cryptocurrency - An
16 April'22 Cryptocurrency
Chueinwittaya, Overview
Puttithorn Jirayus
Abhijit Thakuria, An Overview of Web 3.0
17 April'22 Web 3.0
Bidyut Bikash Baruah applications in Libraries
Carol Alexander ,
The Role of Binance in
Daniel Cryptocurrency
18 July'21 Bitcoin Volatility
F. Heck and Andreas Exchange Platform
Transmission
Kaeck
Grounds for Value
Creation
and Capturing: The case Cryptocurrency
19 Mykyta Aleksandrov April'22
of Cryptocurrency Exchange Platform
Exchange Platform
Binance
Suman Ghimire, Dr. A Survey on Bitcoin
20 Henry Selvaraj December'21 Cryptocurrency and its Cryptocurrency
Mining

4
3. Report on Present Investigation
3.1. Requirement Analysis

3.1.1 Scope
Blockchain technology has a great future worldwide. An incredible scope of Blockchain
technology has been observed in the financial field. The financial organizations were not able
to sufficiently handle the heavy workload after demonetization and thus brought out the
problems of having a centralized specialist for handling the financial transactions[8]. As a
result, the RBI is inspiring banks to encourage digitization. They have also released a
statement which emphasized the probability of Blockchain to fight faking and the chances of
bringing about particular modifications in the working of financial markets, collateral
identification and payment system. Incorporating Blockchain with financial transactions gives
out amazing benefits, such as a significant amount of time and money could be saved,
including a drastic reduction in time needed for processing and validating transactions. The
blockchain functions on a distributed database which make the operations smoothly, ensuring
tight security, and made it safe from cyber-attacks.

3.1.2 Feasibility Study


Crypto currencies are a new system in the financial sector. The word crypto refers to
various encrypted texts. The crypto currencies refer to various encryptions, algorithms, and
unique cryptographic techniques it is also referring a new model of digitalization as
medium for facilitating the conduct of the different financial transactions which are safe
and secure. We are implementing a simple website where people can exchange between
different cryptocurrency. Since we are using Ethereum Service, the charges for each
transaction is very less as compared to other systems with same level of security. The
community of the Ethereum is growing every day and many more nodes or miners are adding
to the service. In future with more miners available, the taxation fee will be reduced even
further. Economically this will be the most viable payment option, as well as to exchange
Currency. Currently you can exchange the currency only from RBI authorized banks[10].
Also, you need to have NRO account in order for you to be able to exchange the currency. The
charges on exchanging the currency are 1% of the exchange value.

5
3.1.3 Hardware and Software Requirement
Table 3.1.3.1: Hardware Requirement

Hardware Description
Intel® Core i3+ @2.40 GHz / AMD Ryzen 3+
Processor
@3.6 GHz
RAM 4GB+
Hard Disk 500GB+

Table 3.1.3.2: Software Requirement

Software Description
Operating System Windows 7/8/10/11
Programming Tool VS Code
Contract Setup CRANQ
Contract Programming Solidity
Pre-requisite Software React
Programming JavaScript
Other HTML/Tailwind CSS

6
3.2 Problem Statement

Centralizing Data was an incredible way of gathering the information needed for running their
business, optimizing where to operate from, and analysing that information at a greater speed.
But some problems arose from malpractice and some new methods are now more attractive.
As people increasingly conduct business, socialize, and communicate through the internet,
greater checks must be in place to ensure that their privacy is protected and that they control
what information they share online. Going forward, a move to decentralized identity solutions
is essential to ensure data privacy and security. By facilitating end-to-end technology run on
blockchain, decentralized solutions enable private information to be shared securely, while
users remain in full control of their data. Current centralized cryptocurrency exchanges are
susceptible to hacks, thefts, and regulatory risks, and they often suffer from poor liquidity and
high trading fees. Furthermore, traditional financial systems exclude a large portion of the
population due to their stringent regulatory requirements and high fees. Therefore, there is a
need for a decentralized crypto and currency exchange website that is secure, efficient, and
accessible to all. This problem statement highlights some of the key issues with centralized
cryptocurrency exchanges and traditional financial systems, including their susceptibility to
security risks and exclusionary practices. A decentralized exchange website could address these
issues by providing a secure and efficient platform for trading cryptocurrencies and other
assets, while also promoting financial inclusion by eliminating some of the regulatory barriers
and fees associated with traditional financial systems.

In contrast to centralized solutions, decentralized systems ensure private data remains


immutable and secure and is only able to be shared when outlined users consent to provide
information. The goal of any blockchain solution is to deliver what the users of that solution
need, and this may or may not include certain levels of decentralization. To better understand
decentralized networks, the table below breaks out how decentralized networks compare to the
more common centralized networks [11].

7
Table 3.2.1: Comparison between Centralized and Decentralized Network

Criteria Centralized Decentralized


Resources are owned &
Maintained & controlled by
shared by network members;
Network/hardware resources single entity in a centralized
difficult to maintain since no
location
one owns it

Maintained & controlled by Each member has exact same


Solution components
central entity copy of distributed ledger

Maintained & controlled by Only added through group


Data
central entity consensus
No one owns the data &
Control Controlled by central entity
everyone owns the data
Single Point of Failure Yes No
Fault tolerance Low Extremely high
Maintained & controlled by Increases as # of network
Security
central entity members increase
Maintained & controlled by Decreases as # of network
Performance
central entity members increase
Example ERP system Blockchain

In this project we will decentralize the transaction data, In our real world, there are two types
of transaction that exists, centralized transaction and decentralized transaction. The centralized
transactions are the one that is controlled by the one authority like RBI in India, all the
transactions are controlled by the RBI. The user makes a payment through the bank payment
gateway and the bank then processes the request and sends you the response for that request
which is either failure or success. While in the decentralized transactions, the transaction is
not controlled or authorized by one authority but all the peer members available in the network
at that time. So, in this type of transaction, the user sends the request in the form of a block.
The block is then broadcasted to every party in the network which then approves the
transaction and only then the money is transferred to Merchant’s Account [12].

8
3.3. Project Design

3.3.1. Ethereum
Ethereum is a decentralized, open-source blockchain platform that enables developers to build
and deploy decentralized applications (dApps). It works through a network of computers, or
nodes, that are connected to the Ethereum blockchain. The Ethereum blockchain consists of a
series of blocks that contain transactions and smart contract code. These blocks are linked
together in a chain and are secured using cryptographic algorithms. Nodes on the network
work together to validate transactions, maintain the blockchain, and ensure its security.
One of the key features of Ethereum is its support for smart contracts. Smart contracts are self-
executing programs that run on the Ethereum blockchain and can automatically enforce the
terms of a contract. They can be used for a wide range of applications, such as decentralized
finance (DeFi), gaming, identity verification, and more.
To interact with the Ethereum blockchain, users need to use an Ethereum wallet. This wallet
can be a software wallet, a hardware wallet, or a web-based wallet, and it enables users to
store, send, and receive Ethereum and other tokens on the network. When a user wants to send
a transaction on the Ethereum network, they need to pay a small fee in Ether, the native
cryptocurrency of the Ethereum blockchain. This fee is used to incentivize nodes on the
network to validate and process the transaction. Overall, Ethereum works through a network
of nodes that work together to maintain a secure and decentralized blockchain platform. It
enables developers to build and deploy smart contracts and dApps, and it supports a wide
range of use cases in areas such as DeFi, gaming, identity verification, and more.
Overall, Ethereum is important because it has enabled the development of new and innovative
decentralized applications, promoted decentralization and transparency, and supported the
growth and adoption of blockchain technology.

9
3.3.2. Smart Contract
A Smart Contract (or cryptocontract) is a computer program that directly and automatically
controls the transfer of digital assets between the parties under certain conditions. A smart
contract works in the same way as a traditional contract while also automatically enforcing the
contract. Smart contracts are programs that execute exactly as they are set up(coded,
programmed) by their creators. Just like a traditional contract is enforceable by law, smart
contracts are enforceable by code.
A smart contract is just a digital contract with the security coding of the blockchain. It has
details and permissions written in code that require an exact sequence of events to take place
to trigger the agreement of the terms mentioned in the smart contract. It can also include the
time constraints that can introduce deadlines in the contract. Every smart contract has its
address in the blockchain. The contract can be interacted with by using its address presuming
the contract has been broadcasted on the network.

Benefits of smart contracts

Speed, efficiency and accuracy

Once a condition is met, the contract is executed immediately. Because smart contracts are
digital and automated, there’s no paperwork to process and no time spent reconciling errors
that often result from manually filling in documents.
Trust and transparency
Because there’s no third party involved, and because encrypted records of transactions are
shared across participants, there’s no need to question whether information has been altered
for personal benefit.
Security

Blockchain transaction records are encrypted, which makes them very hard to hack. Moreover,
because each record is connected to the previous and subsequent records on a distributed
ledger, hackers would have to alter the entire chain to change a single record.

10
3.3.3. Metamask
Metamask is a browser extension and mobile app that provides a user-friendly interface for
interacting with decentralized applications (dApps) on the Ethereum blockchain. It functions
as a digital wallet, allowing users to securely store, manage, and transfer their Ethereum and
ERC-20 tokens.
Metamask also acts as a bridge between users and dApps, enabling users to interact with them
without the need for a separate wallet or complicated technical knowledge. It allows users to
access dApps directly from their browser or mobile device, with a simple login process that
connects their Ethereum wallet to the dApp. Additionally, Metamask provides a range of tools
and features for managing Ethereum transactions and interacting with the blockchain. These
include customizable gas fees, support for multiple Ethereum networks, transaction history
and tracking, and integration with popular dApps and services.
Overall, Metamask is an important tool for facilitating user adoption of Ethereum-based
dApps, providing a user-friendly interface and simplifying the process of interacting with the
blockchain.

11
3.3.4. DFD Diagram

Figure 3.3.4.1: DFD Level 0

Smart contracts are self-executing programs that run on a blockchain network. They operate based on
a set of pre-defined rules and conditions, and they execute automatically when certain conditions are
met.

Here is an example of how a smart contract might work:

1. A user creates a smart contract with certain rules and conditions, such as a contract for buying
and selling a digital asset.

2. The contract is then deployed on a blockchain network, such as Ethereum.

3. The user then sends the required digital assets, such as Ether, to the smart contract's address.

4. The smart contract automatically verifies that the required assets have been received and that
the contract conditions are met.

5. If the conditions are met, the smart contract automatically executes the transaction and
transfers the digital assets to the appropriate parties.

6. The transaction and the contract execution are recorded on the blockchain, providing
transparency and immutability.

12
Figure 3.3.3.2: DFD Level 1

13
3.3.5. UML Diagram

Figure 3.3.4.1: UML Diagram

1. Ethereum Network: The Ethereum network consists of a decentralized network of


nodes that run the Ethereum software. Nodes can be connected to each other through
a peer-to-peer network.

2. Blockchain: The Ethereum blockchain is a distributed ledger that stores all transactions
and smart contracts executed on the network. The blockchain consists of a series of
blocks, with each block containing a set of transactions.

3. Smart Contracts: Smart contracts are self-executing programs that run on the Ethereum
blockchain. They are written in programming languages such as Solidity and can be
used to automate complex transactions and processes.

4. Ethereum Clients: Ethereum clients are software applications that enable users to
interact with the Ethereum network. Clients can be full nodes that download and store
the entire blockchain or light clients that connect to full nodes to access the network.

5. Wallets: Ethereum wallets are software applications that enable users to manage their
Ethereum accounts and interact with the network. They allow users to send and receive
Ether, as well as interact with smart contracts.

14
6. DApps: Decentralized applications (DApps) are applications that run on the Ethereum
network and use smart contracts to automate transactions and processes. DApps can
include games, marketplaces, social networks, and more.

7. Tokens: Ethereum also supports the creation and management of tokens, which can
represent digital assets such as currencies, assets, or utility tokens.

15
3.4. Methodology

USwap is a decentralized cryptocurrency exchange that has gained popularity due to its unique
automated market maker (AMM) system. The methodology of USwap is centered around
liquidity provision, pricing, trading, fees, and arbitrage.
Firstly, users can provide liquidity to USwap by depositing an equal value of two different
ERC-20 tokens into a liquidity pool. This creates a market for the two tokens, allowing other
users to trade them against each other.
Secondly, USwap uses a constant product formula to determine the price of assets in a liquidity
pool. This means that the product of the amount of each token in the pool is a constant, which
is used to calculate the price of the tokens. As a result, when one token is bought or sold, the
amount of the other token in the pool changes, which in turn changes the price of the token.
Thirdly, users can trade any ERC-20 token on USwap by sending a transaction to the USwap
smart contract. USwap calculates the price of the token based on the constant product formula
and executes the trade accordingly.
Fourthly, USwap charges a 0.3% fee on all trades, which is added to the liquidity pool.
Liquidity providers earn a proportionate share of the fee based on their share of the liquidity
pool. This incentivizes liquidity provision, which is necessary for the functioning of the AMM
system.
Finally, because USwap uses a constant product formula, prices can vary from the market
price. This creates an opportunity for arbitrageurs to buy low and sell high across multiple
platforms, helping to keep prices in line with the broader market.
Overall, USwap's methodology has enabled the development of a decentralized
cryptocurrency exchange that allows for trading of any ERC-20 token, with liquidity providers
earning a share of fees and arbitrageurs helping to keep prices in line with the broader market.
The unique AMM system of USwap has helped to make decentralized trading more accessible
and efficient, while also promoting liquidity provision and decentralization in the
cryptocurrency ecosystem.

16
Ethereum Working

Figure 3.4.1: Ethereum Working

Ethereum is a decentralized blockchain platform that enables developers to build decentralized


applications (dApps) and deploy smart contracts.
Here's a brief overview of how Ethereum works:
1. Smart contract creation: Developers can create smart contracts using programming
languages such as Solidity, which are then compiled into Ethereum bytecode.
2. Contract deployment: Once the smart contract is created, it is deployed onto the
Ethereum network. This requires sending a transaction containing the contract
bytecode and other required data to a special address on the Ethereum blockchain.
3. Mining: Ethereum is a proof-of-work blockchain, which means that transactions are
verified and processed by miners who use computational power to solve complex
mathematical problems. Miners are rewarded with Ether (the native cryptocurrency of
the Ethereum network) for their work.
4. Contract execution: Once the smart contract is deployed, it is stored on the blockchain
and can be executed automatically when certain conditions are met. For example, a
smart contract for a token sale might be set up to automatically distribute tokens to
buyers once they send Ether to the contract's address.

17
5. Gas fees: Transactions on the Ethereum network require a fee known as gas, which is
paid in Ether and is used to incentivize miners to process transactions. Gas fees can
vary based on network congestion and the complexity of the transaction.
Overall, Ethereum's key innovation is its ability to enable developers to create and deploy
smart contracts, which enable automated and decentralized execution of complex transactions
and processes. This makes it a powerful tool for building decentralized applications and
disrupting traditional industries.

Smart Contract Working

Figure 3.4.2. Working of Smart Contract

• Identify Agreement: Multiple parties identify the cooperative opportunity and desired
outcomes and agreements could include business processes, asset swaps, etc.
• Set conditions: Smart contracts could be initiated by parties themselves or when certain
conditions are met like financial market indices, events like GPS locations, etc.
• Code business logic: A computer program is written that will be executed
automatically when the conditional parameters are met.
• Encryption and blockchain technology: Encryption provides secure authentication and
transfer of messages between parties relating to smart contracts.

18
• Execution and processing: In blockchain iteration, whenever consensus is reached
between the parties regarding authentication and verification then the code is executed
and the outcomes are memorialized for compliance and verification.
• Network updates: After smart contracts are executed, all the nodes on the network
update their ledger to reflect the new state. Once the record is posted and verified on
the blockchain network, it cannot be modified, it is in append mode only.

19
3.5. Implementation

3.5.1 Test Cases

Table 3.5.1.1: Test Cases Result

Test Case Test Description Expected Result Actual Result Pass/Fail

User is connected to User is connected to


Connect Test connect wallet
the wallet the wallet Pass
Wallet process
successfully successfully

Funds are swapped Funds are swapped


Swapping Test swapping funds
from user account from user account Pass
funds from user account
successfully successfully

Swapping Test swapping funds Shows error as Shows error as


funds when from user account "Insufficient "Insufficient
Pass
insufficient when balance is Balance" and user is Balance" and user is
balance insufficient not able to swap not able to swap
Smart contracts Smart contracts
Test smart contract perform as expected, perform as expected,
Smart functionality, and prices are and prices are
contract including price adjusted adjusted Pass
functionality adjustment based on automatically based automatically based
supply and demand on supply and on supply and
demand demand
Test platform
User data is User data is
security measures,
encrypted and encrypted and
including encryption,
Security secured, and platform secured, and platform Pass
multi-factor
security measures security measures
authentication, and
function as expected function as expected
firewalls
Platform maintains Platform maintains
Test platform
speed and speed and
Performance performance under Pass
functionality under functionality under
heavy load
heavy load heavy load
Test platform Platform functions as Platform functions as
Cross-
compatibility with expected across expected across
browser Pass
multiple web different web different web
compatibility
browsers browsers browsers

20
3.5.2 Gantt Chart
Table 3.5.2.1. Gantt Chart

21
3.5.3. Working

Figure 3.5.3.1 Smart Contract Setup

Figure 3.5.3.2 Smart Contract Implementation

22
Figure 3.5.3.3 Home Page

Figure 3.5.3.4 Wallet Connected

23
Figure 3.5.3.5 Swap value with the tokens

Figure 3.5.3.6 Swaping confirmation on metamask

24
Figure 3.5.3.7 Swap Completed

Figure 3.5.3.8 Transaction details on Goerli Testnet

25
Figure 3.5.3.9 Block Created for the transaction

26
4. Conclusion
In conclusion, digital currency decentralized exchange platforms have the potential to revolutionize
the way we trade cryptocurrencies. By utilizing blockchain technology and smart contracts, these
platforms enable users to trade directly with each other, without the need for intermediaries or
centralized authorities. This not only provides users with more control over their funds, but also
promotes greater transparency and security in the exchange process. With the growing popularity of
cryptocurrencies and the increasing demand for decentralized solutions, it is likely that digital
currency decentralized exchange platforms will continue to play a significant role in the development
of the crypto ecosystem.

In conclusion, the decentralized cryptocurrency exchange USwap has gained popularity due to its
unique automated market maker (AMM) system that focuses on liquidity provision, pricing, trading,
fees, and arbitrage. USwap's methodology allows users to trade any ERC-20 token, while liquidity
providers earn a share of fees, and arbitrageurs help to keep prices in line with the broader market.
USwap's AMM system has contributed to making decentralized trading more accessible and efficient,
promoting liquidity provision and decentralization in the cryptocurrency ecosystem. Overall, USwap
is a promising player in the decentralized exchange space and is worth considering for those interested
in decentralized trading.
Recently RBI has announced they will implement there own Digital currency. In coming 5 years
people will start shifting to digital currency completely.

27
REFERENCES
[1] Nick Szabo. The idea of smart contracts. Nick Szabo’s Papers and Concise Tutorials, 2022
[2] Hong-Ning Dai, Zibin Zheng, and Yan Zhang. Blockchain for internet of things: A survey.
IEEE Internet of Things Journal, 2022.
[3] Leading cryptocurrency exchanges by trading revenue 2018 | Statista. (n.d.). Retrieved
January 23, 2022, from
https://www.statista.com/statistics/944325/cryptocurrencyexchanges-trading-revenue/
[4] Hull, R., V.S. Batra, Y.M. Chen, A. Deutsch, F.F.T. Heath III and V. Vianu (2021).
Towards a Shared Ledger Business Collaboration Language Based on Data- Aware Processes.
Springer International Publishing, Cham.18-36.
[5] Andreas M. Antonopoulos,Gavin Wood, ‘Mastering Ethereum’ ,Publisher – O’Reilly
[6] Kiana Danial ,‘Cryptocurrency Investing For Dummies’ , Publisher – For Dummies, 1
edition
[7] What is Decentralization in Blockchain?
https://aws.amazon.com/blockchain/decentralization-in-blockchain/ [8] What is
Decentralized Transactions? https://www.geeksforgeeks.org/what-are-
decentralizedtransactions/#:~:text=While%20in%20the%20decentralized%20transactions,t
he%20form%2 0of%20a%20block.
[9] V. Gatteschi, F. Lamberti, C. Demartini, C. ‘’Pranteda and V. Santamaría, "’To
Blockchain or to not Blockchain: that's the Question,’" in IT skilled, vol. 20, no. 2, pp. 62-74,
Mar./Apr. 2018.
[10] T. T. A. Dinh, R. Liu, M. Zhang, G. Chen, B. C. Ooi and J. Wang, "Unraveling
Blockchain: a knowledge process read of Blockchain Systems,"’ in IEEE
[11] Transactions on information and information Engineering, vol. 30, no. 7, pp. 1366-1385,
one July 2018.
[12] N. Kshetri, "Can Blockchain Strengthen the net of Things?,"’ in IT skilled, vol. 19, no.
4, pp. 68-72, 2017.
[13] K. R. ’Özyılmaz and A. Yurdakul, "Work-in-advance: incorporating low-control IoT
gadgets to a blockchain-based foundation," 2017 International Conference on Embedded
software system (EMSOFT), Seoul, 2017, pp. 1-2.

28
[14] Y. Gupta, R. Shorey, D. Kulkarni and J. Tew, "The connectedness of blockchain within
the net of Things," 2018 tenth International Conference on Communication Systems and
Networks (COMSNETS), Bengaluru, 2018, pp. 561-564.
[15] R. Han, V. Gramoli and X. Xu, "’Assessing Blockchains for IoT," 2018 ninth IFIP
International Conference on New Technologies, quality and Security (NTMS), Paris,
2018, pp. 1-5.
[16] J. Ellul and G. J. Pace, "AlkylVM: A Virtual Machine for good Contract Blockchain
Connected net of Things," 2018 ninth IFIP International Conference on New
Technologies, quality and Security (NTMS), Paris, 2018, pp. 1-4.

29

You might also like