Professional Documents
Culture Documents
A thesis submitted by
October, 2022
i
DEDICATION
ii
DEPARTMENT OF SOFTWARE ENGINEERING
CERTIFICATE OF APPROVAL
Dated:
iii
ACKNOWLEDGEMENT
the most Merciful and most Gracious., who blessed mankind with
have numerous obstacles along the path in completing this final year
also like to express our gratitude and special thanks to our chairman
List of Abbreviations xi
List of Figures xv
Abstract xvi
1 INTRODUCTION 1
1.2 BACKGROUND . . . . . . . . . . . . . . . . . . . . 1
1.6 ADVANTAGE . . . . . . . . . . . . . . . . . . . . . . 4
cryption . . . . . . . . . . . . . . . . . . . . . 5
v
1.7.5 CHAPTER 5: Design, Developments and Im-
plementation . . . . . . . . . . . . . . . . . . 6
2 LITERATURE REVIEW 7
2.1 OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . 7
2.2.1 TrueConf . . . . . . . . . . . . . . . . . . . . 10
2.2.2 Matrix . . . . . . . . . . . . . . . . . . . . . . 10
2.2.3 Wickr . . . . . . . . . . . . . . . . . . . . . . 11
2.2.4 Signal . . . . . . . . . . . . . . . . . . . . . . 11
2.2.5 Baariar . . . . . . . . . . . . . . . . . . . . . 12
3.1 BLOCKCHAIN . . . . . . . . . . . . . . . . . . . . . 14
3.3.1 Cryptography . . . . . . . . . . . . . . . . . . 18
3.3.3 Blocks . . . . . . . . . . . . . . . . . . . . . . 19
vi
3.3.5 Forming A Sequence . . . . . . . . . . . . . . 20
3.3.6 Transaction . . . . . . . . . . . . . . . . . . . 21
3.3.12 Network . . . . . . . . . . . . . . . . . . . . . 26
TRACT ON ETHEREUM . . . . . . . . . . . . . . . 37
3.7.1 Encryption . . . . . . . . . . . . . . . . . . . 43
vii
3.7.4 What Exactly Is The Advance Encryption Stan-
dard (AES)? . . . . . . . . . . . . . . . . . . . 46
4.1 TOOLS . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.2.2 React . . . . . . . . . . . . . . . . . . . . . . 49
4.2.3 JavaScript . . . . . . . . . . . . . . . . . . . . 50
4.2.4 Web3 . . . . . . . . . . . . . . . . . . . . . . . 50
4.3.1 Solidity . . . . . . . . . . . . . . . . . . . . . 51
4.3.2 Python . . . . . . . . . . . . . . . . . . . . . . 52
4.3.3 Blockchain . . . . . . . . . . . . . . . . . . . . 52
4.3.4 Metamask . . . . . . . . . . . . . . . . . . . . 53
TION 57
5.1 DESIGN . . . . . . . . . . . . . . . . . . . . . . . . . 57
viii
5.1.3 Successfully Logged In As Username . . . . . 58
5.3 DEPLOYMENT . . . . . . . . . . . . . . . . . . . . 65
5.3.5 Messaging . . . . . . . . . . . . . . . . . . . . 71
5.3.7 Functionalities . . . . . . . . . . . . . . . . . 73
5.4 IMPLEMENTATION . . . . . . . . . . . . . . . . . . 77
ix
6.1 CONCLUSION . . . . . . . . . . . . . . . . . . . . . 87
References 90
x
LIST OF ABBREVIATIONS
xi
LIST OF TABLES
xii
LIST OF FIGURES
cation) . . . . . . . . . . . . . . . . . . . . . . . . . . 9
xiii
5.6 Message Section . . . . . . . . . . . . . . . . . . . . . 61
xiv
5.28 MUMBAI TEST NETWORK FAUCET . . . . . . . 82
xv
ABSTRACT
different identities and goals must therefore have a secure and sim-
such as hacks and data being sold on the internet, denial of service
has the potential to benefit society and the way user information or
This claim, however, has not been verified. This thesis created a new
xvi
CHAPTER 1
INTRODUCTION
sengers. Send and receive messages among the DApp and chat with
1.2 BACKGROUND
1
2
Blockchain and sensible contracts are a very new thanks to write and
system, Provide accross the globe and just about liberal to use.
state machine ideas could also be built. what is more it aims to sup-
framework.
more are using centralized network to store their data due to central-
servers goes down or collapse you cannot access your data or maybe
you will lose your data. Also problems like Data Leaking and Data
3
messaging application
• Server dependency
• Data Alteration
• Data Leaking
a platform that will be secure efficient enough with high level of se-
tion
1.6 ADVANTAGE
ing the primary goals of the thesis. It includes the review of similar
cryption.
This chapter provides the information about the section of tools and
LITERATURE REVIEW
2.1 OVERVIEW
The ongoing chapter describes the general idea of the related work
Over the last decade, WhatsApp, WeChat, etc, these ancient ap-
server that stores all the knowledge together with identity to chats.
7
8
tures like Native Platform and Availability and also it provides the
2.2.1 TrueConf
with meeting room systems, and much more. TrueConf is not open-
2.2.2 Matrix
gram, which currently only keeps its client public, raising numerous
2.2.3 Wickr
2.2.4 Signal
application was used by people who had a strong desire for priva-cy,
eller does not collect user data and does not display advertisements.
12
2.2.5 Baariar
activists, and eve-ryone else looking for a secure, simple, and robust
the In-ternet goes down, Briar will connect via Bluetooth or Wi-Fi
the Tor network if the Internet is availa-ble, shielding users and their
With BBMe, you can get all of your messaging needs met in one
Tox began a few years ago, following Edward Snowden’s leaks about
application that did not re-ly on central servers. The system would
13
method to turn off any of the encryption features, while still being
group of de-velopers from all over the world got together and started
3.1 BLOCKCHAIN
technology to store and manage knowledge across the web and alter-
blockchain and its potential way exceed its genesis in Bitcoin. It sup-
ports not simply digital cash and trusty data movement and storage,
ingly network are bundled into blocks, that are further to existing
14
15
ure 3.1).
and may be error prone. Up yet we’ve usually been okay with
this. Blockchain is that the answer all the issues mentioned above.
any database servers. once a group action happens within the dis-
on the distributed network. All the nodes agree that this alteration
will be done and therefore the transaction is completed. All the dis-
16
the previous block. Blocks are solely further and ne’er get deleted.
A hacker would want to faux all the process and power of the min-
database is put in on each node. each single node must verify every
only transfer and store money, but it can also replace all processes
17
and business models that accept charging a small fee for a group
All that is required is to code the transactional data for a car ride or
a long stay, and you have a superbly secure approach that disrupts
dles the group action in between 2 parties while not a 3rd party.
3.3.1 Cryptography
tic way, and no-one are going to be able to edit it. This method is
needs 2 keys, a public and a personal key. Public key’s visible to ev-
key is generated its try is additionally created that is that the public
key at identical time. making public key from private key is easy,
but the other is very difficult. It’s nearly not possible to work out
distributed out, it’s public key is sent out with it, and it is signed
with a private key. The recipient has the general public key. The
sender created the signature with the non-public key pair. The recip-
ient opens the message with the private key. Unlocking the message
3.3.3 Blocks
Blocks are files that for good record and hold transaction data.
change, edit or take away the blocks that were added earlier and are
deeper within the chain. this is often however the dealingss become
functions.
20
Blocks are files that for good record and hold transaction data.
change, edit or take away the blocks that were added earlier and are
deeper within the chain. this is often however the dealingss become
address of the previous block and thus the hash of the information
contained in the previous block. The block chain contains the ledger
3.3.6 Transaction
that represent a cash exchange between two entities (or users). For
the previous transactions and thus the succeeding owner’s public key
a chain. Figure 3.3 shows how the next timestamp reinforces those
before it.
22
from electricity at a similar rate for any node within the globe. a
for a worth that once hashed, comparable to with SHA-256, the hash
begins with variety of zero bits. the common work needed is expo-
until a worth that offers the hash of the block the specified zero bit.
not redoing the work. The act of mining and making a winning hash
cerning ten minutes. this is often the time needed to unravel a given
till the mining is complete. The laborers give the proof of work by
finishing the maths problem and thus give permission for block to
24
truthful within the sense that a laborer with p fraction of the entire
process power can win the reward and build a block with the chance
will solely achieve success if the attacker can wake up bear vital com-
conjointly most of the mining are often centralized in the areas with
Proof of stake is that the most typical different to proof of work. The
exist on day one and no mining is required. the prospect of the val-
are one practical decentralised ledger solution that does not rely on
stake within the system determines how likely they are to create a
block and get the related reward. A replacement block is made with
3.3.12 Network
all the nodes. The new transactions are collected into a block by
the nodes. each node will work extremely laborious to unravel the
problem, so give the proof-of-work for its block. the primary node
that finds the proof-of-work will broadcast it to all the nodes. All the
opposite nodes will solely approve the new block provided that all the
nodes settle for the new block, it’ll be additional to the chain. The
longest chain is that the correct chain, and accepted by the nodes.
this is often the chain that other nodes can add blocks to it. There
time. because the result the blocks won’t be the same. a number of
the taking part nodes will receive one or another first. The nodes
will work on the primary block they received. the opposite branch
are saved just in case it becomes long. If one amongst the branches
become longer and longer, all the nodes will move to the longer
node, and abandon the shorter one. The tie are broken. The new
broadcasts are happy with born messages. The node that did not
That is when the node realises it has misplaced it. When the most
27
space. The Merkle tree used to hash transactions only has the root
enclosed within the block’s hash, to facilitate this while not breaking
saved.
distributed ledger. These nodes have a full copy of the ledger. The
nodes are often virtual or real. The distributed ledger runs on the
dled into blocks, that are additional to the existing blocks, so forming
Nursing existing block within the chain would invalidate all the sub-
the process software. it’s an online service platform that may of-
Heroku.
Ethereum features:
pline signatures
third parties
time
• Unlimited storage
will trivially act with everything else, from name to custom cur-
rencies
vice.
that anyone will use to develop anything, however it’ not attending
use this to try and do anything, but they’re not going to specialize in
nity abuse and to avoid the questions that will inevitably arise from
damaged right all the way down to the smallest decimal. In Table-
set any fuel price they choose, but miners are free to ignore any
will cost the sender more in terms of Ether, provide a higher fee to
to list the lowest fueloil rate for which they can complete trans-
the fuel price and maximising the risk that their transaction will be
power, along with clever contracts with limitless loops, which can be
tracts are carried out. EVM is completely cut off from CPUs and
every node in the system runs the Ethereum virtual machine. Appli-
nated group action through a network are best suited for Ethereum.
within the chain runs EVM. EVM is that the app server that’ aim-
ing to handle process sensible contracts thus the—and also the pro-
on the market through these nodes together with Swarm for hosting
• Changeless
• No censorship
then need to have a brand new address. each contract has it’s own
address. The initial plan for Ethereum was to try to write some
committal that allows the user to place money in a holding bin, and
can also store data and move thereupon blockchain gap unlimited
possibilities.
34
features a flat topology and every one participants are the same.
may be a new and innovative variety of information. it’s not like al-
ternative kind of databases that are put in on one central server. In-
The participants who used the database use these computers. Same
wants to pay another user but does not have enough money in their
35
that. Having this central power has the flaw of single point of fail-
who has access and what variety of access they have, what’s keep in
them, what and once knowledge gets deleted, and what is backed and
archived. In most cases, folks stay the ultimate arbiter of the valid-
are one in all the key reasons that blockchain and distributed ledger
with web3 has shown. a web site talks to web3 with JASON-RPC.
on the network.
37
in the Ethereum state machine, including all of the code and infor-
code. This is so that each node can send an instruction to the EVM
who then propagates the resulting state change to the rest of the net-
work.
38
The next step is ”Providers”. Providers are the noders that are
You can read the state stored on the blockchain after connecting to
is one more step you must take before submitting the transaction
to the blockchain: ”sign” the transaction with your private key. As-
sume we have a DApp that allows users to read or publish blog posts
DApp will ask the user to ”sign” the transaction with their private
signing for applications. Every time the frontend requires the user
Asking users to pay extra to utilise our DApp each time their trans-
action needs to add a new state is not the best user experience. We
cause of this.
A distributed file system called IPFS is used to access and store data.
Astute readers may have also noticed that the frontend code is not
point for your DApp. What if AWS fails? What if it censors your
such as IPFS.
3.7.1 Encryption
as a ”key.”
Only your laptop and the website you’re interacting with will un-
mastercard number.
After the initial connection, your browser and the website perform
decryption.
looking for a name that described the highest level of security with
the message such that when a user send a message it will be en-
128 bits. These distinct blocks are converted utilising 128, 192, and
256 bit keys. It then connects these blocks to create the ciphertext
mutations).
formula.
CHAPTER 4
4.1 TOOLS
Visual Studio Code is a code editor, to put it simply. The free edi-
and support for more coding and development, which these editors
itor, is one of the various kinds of editors that have arisen. The
48
49
VISUAL STUDIO CODE. With its features, users can tailor the ed-
libraries from the internet and add them to the code as necessary.
web developers can now produce mobile apps that really ”native”
4.2.2 React
When the data changes, it will efficiently update and render the
correct components.
50
4.2.3 JavaScript
4.2.4 Web3
with the blockchain directly. Web3.eth gives the user the tools they
different accounts and check their balances, and much more. Web3
is employed for:
51
• Perform transactions
contract.
4.3.1 Solidity
trol how accounts behave within the Ethereum state. A crucial lan-
Influences section..
4.3.2 Python
code, like Perl, is available under the GNU General Public License
4.3.3 Blockchain
transactions, blockchains are well known for their crucial role. The
security of a record.
amounts of storage and close when they are full. a data chain known
one before it. After this new block is added, any additional data is
4.3.4 Metamask
to verify the owner of a blockchain address that can send and receive
Custom RPC
• ChainID: 80001
• Symbol: MATIC
ploy, test and run their dApps risk-free and free on the blockchain
like Polygon, which debuted in 2017. May 20, 2022 over 2 bil-
transfer transactions.
5.1 DESIGN
tionality.
In the first step, user need to connect with the metamask by clicking
name for itself. After adding username, MetaMask authorize the the
57
58
username of User.
In the Chat section, user can see the added friend when user click
on a freind name the message section will apear for the particular
When you are addding a new friend using +NewChat Button, you
need to enter the name for your friend and also you have to paste
friend’s device.
60
Here we can see the chat between user and friend. It will apear when
we select the particular friend to start the chat. Also the Refresh
of the application.
User Flow Diagram describes the user journey within the application.
Backend Flow Diagram shows the flow of the data in the backend.
5.3 DEPLOYMENT
Only the sender and recipient of the message can decrypt the mes-
shares his public key with other users while keeping his private key
66
Only the sender and recipient can generate the same encryption key.
The sender generates the key from the sender’s private key and the
recipient’s public key. The receiver calculates the key from your pri-
vate key and the sender’s public key. The contract generates events
is done through the web appli-cation and not through the contract.
Messages and friends list are added based on the history of events
fee)
With the addition of these scripts, the file system is now the main
API. Each .js file is converted into a route that is automatically pro-
cessed and rendered, causing the server to render and index ./pages.
takes these components and places them in the dom to render them
some data including the sender which is the address of the person
69
sending the money and also the value which is the value of what is
that duplicate users are not created and is also called by other
whether two users are already friends with each other or not.
longer friends.
5.3.5 Messaging
The final part of the Solidity contract will allow for the exchange
• user will have the property name that will store the username
• The friend has the properties public key, which is the friends
public address, and the name the user wants to refer to them
by.
• the name the user wants to refer to them by. The message has
73
for ”message”.
• User List, where all platform users are associated with their
public address
5.3.7 Functionalities
Sending Transaction:
Object:
74
Gas:
GasPrice:
used for each gas paid for. It’s the reward sent to the miner and it’s
the cost of each unit of gas when we send the transaction. Gas has
GasLimit:
Value:
Data:
Amount(optional)
must be hexadecimal.
Returns:
Data, 32 bytes: The hash of the transaction, or the null hash if the
The transaction is not added to the blockchain. Note that the es-
eth.getBlockNumber()”.
The gas price is determined by the average gas price of the last
mutable and transactions on the blockchain also cost gas. The only
old version always remains on the blockchain. Testing the smart con-
When compiling the contract, we get the ABI and the bytecode as
output.
We provide the bytecode on the local testnet. The test calls various
script.
On the device, creates the local area network. The JavaScript inter-
5.4 IMPLEMENTATION
The Solidity compiler compiles the smart contract into bytecode and
.sol file. The compile.js file looks in the contracts folder and compiles
the Solidity files. The contents of the file are read from disk.
creates a directory path from the currently compiled js file to the con-
file.
To read the raw source of the contract, let’s create the constant
source. Now we can write the compiled statement, this is where the
In the Remix file explorer, create a Database.sol file and write the
tab in the left navigation bar and click the blue button. contract for
the sol Make a note of the ABI because it will be required in the
MENT.” Select ”Web3 injected” and click the Deploy button (make
a note of the contract address once our contract has been success-
methods of a contract, such as: B. The data type of the input pa-
rameters, the return data type and the property of the method, such
To build the application for production, use the npm run build com-
only this folder needs to be deployed. The URL from the address
React into production mode and optimally optimize the build Per-
ployed. The best approach is to compile once and write the result
to a file in the build folder that can be read later. The compiled
script runs once and then runs the application as many times as you
piler again, it means that the smart contract has changed. In this
81
case, the entire build folder should be deleted if it exists. reads the
Next, compile the contract using the Solidity compiler. The output
read from the build directory without having to recompile the con-
tract. The output variable contains the object that is the output of
The build folder and the JSON file it contains will be generated
faucet delivers free gas to the specified address. The web3 library
to create and implement new contracts. The first argument for the
is passed to JSON.parse.
tells web3 that a contract exists and gives it the expected interface.
the network. It is taken from the property whose value is the ac-
are unlocked and have free ether. Deployment on the main/test net-
tells web3 which network it needs to communicate with. For the im-
for Ether. ) is used to unlock the account and use the ether in it
that we can connect to. The solution is to run a local node on our
machine.
and then we can use this node running on our computer to connect
and web3 automatically converts all calls to low-level ABI calls over
will inject its own web3, hence web3 is define. This way, when Meta-
Mask runs, the Web3 version of MetaMask will be used. Web3 will
6.1 CONCLUSION
and easier. The chat process nowadays has a Switch node, while
run by any user and also to send and receive encrypted messages.
87
88
and with the help of Military grade encryption the level of security
the server application will become unavailable for the user while de-
the blockchain fulfill that need it restrict the third party to access
your data. People are connecting peer to peer with each other. Our
HushMessnger also restrict any third party to access your data only
image and video sharing, custom chat groups, and exploring a new
world but we will try to make our application more secure for the
89
2020
. Dec 2021
90
91
(2021).
[9] Heiler, Q., von Seck, R. and Jelten, J., 2019. Peer-to-Peer Ma-
[10] Kim, G., Kim, S., Park, M., Park, Y., Lee, I. and Kim, J., 2021.
vs. Telegram.
[14] Blöchinger, S. and von Seck, R., 2021. Survey of Mesh Net-
[16] iyoshi, K., Tauseef, M., Gebremedhin, R., Gokhale, V. and Eid,
com/JavaScript-tutorials/Server-[Accessed18-Feb-2019]
com/post/the-architecture-of-a-web-3-0-application
2018]
[16- Apr-2019]
com/
https://medium.com/mercuryprotocol/
Feb-2019]
com/blockchainethereumbusinessapps4print-170523081730/
95/blockchain-ethereum-and-business-applications-25-638.