0% found this document useful (0 votes)
80 views36 pages

Reportover

This document discusses cryptocurrency database management. It provides an introduction to cryptocurrencies, describing how they work using distributed ledger technology and consensus mechanisms. It also presents the entity relationship diagram and relational schema for the cryptocurrency database. The document outlines the hardware, software, and documentation requirements for the cryptocurrency database management system.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views36 pages

Reportover

This document discusses cryptocurrency database management. It provides an introduction to cryptocurrencies, describing how they work using distributed ledger technology and consensus mechanisms. It also presents the entity relationship diagram and relational schema for the cryptocurrency database. The document outlines the hardware, software, and documentation requirements for the cryptocurrency database management system.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 36

CRYPTOCURRENCY DATABASE MANAGEMENT

Chapter:-1
Introduction

The cryptocurrencies are nothing but the digital version of the other fiat currency in the
traditional financial market of the world. The first ever cryptocurrency was Bitcoin, and was
well known for its decentralization and security. However, the pillars of cryptocurrencies are
nothing but decentralization and the Consensus mechanisms. Cryptocurrencies were
prominently initiated by Satoshi Nakamoto, in order to eradicate the double spending
problems that the digital currencies persisted before the invention of Bitcoin in the form of a
cryptocurrency.

Basically, when the first record is written a specific key is generated for that record. The
interesting thing happens when the further records are written. When the sending record is
written the data and then let the first one goes to the second record and then comes out a
unique key. When the third record is written the data and key from the first and sending
record goes to the third record and then comes out a unique key. Hence as we can observe
that there is a dependency between the records. The records are kind of chained to each other.

Cryptocurrencies basically work on the Distributed Ledger Technology along with the
various Consensus mechanisms, the distributed ledger technology is nothing but a way of
storing the information but not in the traditional format, but information is stored in the form
of records and a bunch of records from a single block. These blocks of information are
constantly developed and new blocks are added at regular intervals. Security is incorporated
through distributed ledger in the Blockchain ecosystem where the whole Blockchain is
transparent to each and every participant of the network. Therefore, providing security to the
whole network as data tampering can be easily recognized with this process.

Along with the Distributed Ledger Technology, various Consensus mechanisms are
employed and invented by the researchers throughout the world. In any particular
organization where a huge group of people is working towards a single goal, it is absolutely
no doubt that there would be differences in the opinion when it comes to making decisions
regarding the development of the community. The consensus mechanism results in the
incorporation of some of the bestdecisions taken. The world's first cryptocurrency coin,
Bitcoin incorporated the Proof of Work consensus mechanism in order to validate the
transactions present onthe Bitcoin Blockchain.

The cryptocurrencies as the name suggests incorporates the Cryptographic principles and is
one of the main ingredients for the providing security to the whole blockchain network.
Precisely the whole information present on a particular block is exposed to a Cryptographic
hash function with the name SHA 256 and results in the generation of a new hash which is
then utilized by the second block to generate its own hashcode. In this particular way, the
block-chain is formed where due to time-stamping methodology, the transactions are
completely safe from access from other sources.

Department Of CSE ,Dr.AIT Page 1


CRYPTOCURRENCY DATABASE MANAGEMENT

Chapter:-2

Literature Survey

This Cryptocurrency Database management has been developed by gathering knowledge


from various resources such as internet reference articles, prescribed text books, websites,
and from other resources as well. Following are the list of references that were referred for
this mini project.

Blockchain technology was first used in 2009, when Bitcoin was introduced, which was the
first to apply the concepts of Blockchain technology. As the words suggest, block-chain. The
blocks of data are chained together in a digital format. The block consists of records which in
turn consists of ledgers, where the transactions are written. In a Blockchain, the records are
distributed among the nodes and everyone has a copy of it. So when one of the records is
tampered or changed, it becomes very easy for us to recognize the tampered record. Which
can be replaced with the authentic one by copying it from others on the network.

The Blockchain architecture is emergent decentralized and a paradigm of distributed


computing that underlies Bitcoin and other cryptocurrencies. A blockchain is something like
a general ledger in which all transactions have been recorded, and it is shared by participants
in a bitcoin network .Blockchain architecture consists of a data layer, a network layer, a
consensus layer, an incentive layer, a contract layer, and an application layer.

With money pouring into the blockchain from investors, venture capitalists, and strategic
partners, it is clear that cryptocurrencies will continue to be in the spotlight for years to come.
However, as with any newly emerging field, being in the spotlight can present a double-
edged sword. It makes for an environment full of passionate and extremely technical
discussion, but it also opens the door to blatant promotional pump-and-dump schemes and
inflexible factions of cheerleaders or naysayers. This clutter makes it considerably difficult
for the average person to really wrap their head around the crypto space – and it creates
opportunities to simplify the sector in an easy, digestible, and accessible way.

In particular, the project has been made possible through the incorporation of Swings and
JDBC from JAVA programming language, in order to develop the front end. In case of the
Back end development, Oracle 10g Express Edition along with the concepts of SQL
programming are utilised in order to serve the requirements of the users . for the connection
of both the front end and the backend , knowledge about the various JDBC drivers was
gained through various resources.

The Relational Database Schema which includes the study of ER Diagram, Relational
Schema Diagram which indirectly provided a base to the implementation of our mini
project which is crytpocurrency management

Department Of CSE ,Dr.AIT Page 2


CRYPTOCURRENCY DATABASE MANAGEMENT

Chapter:-3
System Requirements Specification

3.1 Hardware Requirements


Processor : Pentium i3 or above
RAM : 1GB or above
Hard Disk : 60GB or above
Speed : 1.5 Ghz or above
Screen Resolution : At least 1024 x 768 (1280 x 960 or higher recommended)

3.2 Software Requirements


Operating System : Windows 7 or above
Back end : Oracle 10g
Front end : jdk and jre 1.8 or above
Documentation : MS word 10 or above, MS office 10 or above

Department Of CSE ,Dr.AIT Page 3


CRYPTOCURRENCY DATABASE MANAGEMENT

Chapter:-4
Design

4.1 ER Diagram

An entity relationship diagram (ERD), also known as an entity relationship model, is a


graphical representation of an information system that depicts the relationships among
people, objects, places, concepts or events within that system

coinnum
cname
mcap relate 1
ico
1
price

tsupply crypto
sdate amount
fname M

hdate cpt_wt
N wcode
M 1

Cpt_ex owns wallet


1

exname excode
uses wname wtype
N
M
M
exchange 1
ceo
uses M

decentralised fee customer


cid

cusname
4.2 Relational Schema Diagram balance No of coins

Department Of CSE ,Dr.AIT Page 4


CRYPTOCURRENCY DATABASE MANAGEMENT

The relational schema refers to the organization of data as a blueprint of how the database is
constructed (divided into database tables in the case of relational databases). The formal
definition of a database schema is a set of formulas (sentences) called integrity constraints
imposed on a database.

CRYPTO

Coinnum cname mcap price tsupply fname year hprice hdate

ICO
Coinnum start date duration amount

EXCHANGE
excode exname ceo country decentralised fee

CPT-EX
Coinnum excode

WALLET
wcode wname wtype

CPT-WT
Coinnum wcode

CUSTOMER

Custid cusname excode walcode coinnum noofcoins balance

Chapter:-5
Implementation
Department Of CSE ,Dr.AIT Page 5
CRYPTOCURRENCY DATABASE MANAGEMENT

5.1 Creating Tables


CRYPTO TABLE
create table crypto
(
coinnum int primary key,
cname varchar(1000) ,
mcap float,
price float,
tsupply int,
fname varchar(1000),
year int,
hprice float,
hdate date
);

ICO TABLE
create table ico
(
coinnum references crypto,
startdate date,
duration int,
amount float
);

EXCHANGE TABLE
create table exchange
( excode int primary key,
exname varchar(1000),
ceo varchar(1000),
country varchar(200),
fee float,
decentralised varchar(5)
);

CPT_EX TABLE
create table cpt_ex
(
coinnum reference crypto
excode reference exchangetable
primary key (coinnum,excode)
);

Department Of CSE ,Dr.AIT Page 6


CRYPTOCURRENCY DATABASE MANAGEMENT

WALLET TABLE
create table wallet
(
wcode int primary key,
wname varchar(200),
wtype varchar(200)
);

CPT_WT TABLE
create table cpt_wt
(
coinnum references crypto,
wcode references wallet,
primary key(coinnum,wcode)
);

CUSTOMER TABLE
create table customer
(
cid int primary key,
cusname varchar(2000),
excode references exchange,
wcode references wallet,
coinnum references crypto,
noofcoins float,
balance float
);

5.2 Insertion of Tuples

Department Of CSE ,Dr.AIT Page 7


CRYPTOCURRENCY DATABASE MANAGEMENT

Insertion into CRYPTO


insert into crypto values(1,'bitcoin',143.28,6408.71,21,'satoshi nakamato',2009,20030,17-12-
2017);
insert into crypto values(2,'litecoin',5.03,87.56,84,'charlie lee',2011,375,19-12-2017);
insert into crypto values(3,'ethernum',20.99,474.66,102,'vitalik buterin',2013,1430,14-01-
2018);
insert into crypto values(4,'zcash',0.625,123.55,5,'zooko wilox',2016,952,07-01-2018);
insert into crypto values(5,'dash',1.2,266.58,18.9,'evan duffield',2015,1597,21-12-2017);
insert into crypto values(6,'monero',1.7,142.21,16.5,'nicholas',2014,492,07-01-2018);
insert into crypto values(7,'ripple',18.07,0.486,99991,'chris larsen',2012,3.82,04-01-2018);
insert into crypto values(8,'potcoin',0.005,0.186,420,'montreial',2014,0.49,06-12-2017);
insert into crypto values(9,'EOS',4.9,8.53,1006,'daniel larimer',2018,22.86,29-04-2018);
insert into crypto values(10,'NEO',1.07,37.08,100,'Da Hongfei',2014,192,16-01-2018);

Insertion into ICO


insert into ico values(1,24-12-2019,0,0);
insert into ico values(2,11-1-2011,3,202000);
insert into ico values(3,19-12-2013,6,205000);
insert into ico values(4,11-07-2016,7,403000);
insert into ico values(5,7-6-2015,4,100000);
insert into ico values(6,10-1-2014,8,495025);
insert into ico values(7,24-12-2012,1,282200);
insert into ico values(8,24-12-2014,12,99000);
insert into ico values(9,16-02-2017,12,4698000);
insert into ico values(10,24-12-2014,4,745942);

Insertion into EXCHANGE


insert into exchange values (101,'binance','changpeng zhao','china',0.1,’n’);
insert into exchange values (102,'bitmex','author hayes','china',0.2,’y’);
insert into exchange values (103,'bitflyer','yojokane','japan',0.5,’n’);
insert into exchange values (104,'bittrex','billshihara','washington DC',0.3,’y’);
insert into exchange values (105,'poloneix','tristan f agoota','canada',0.25,’n’);
insert into exchange values (106,'bitfinex','ifinex','china',0.8,’n’);
insert into exchange values (107,'cryptopia','alan booth','newzealand',0.4,’y’);
insert into exchange values (108,'huobi','leon li','singapore',0.3,’n’);
insert into exchange values (109,'kraken','jesse powel','canada',0.9,’n’);
insert into exchange values (110,'unocoin','abhinand kasset','india',1.2,’n’);
insert into exchange values (111,'cointed','cristopher reider','london',1.5,’y’);
insert into exchange values (112,'BitBNS','ashishsangal','india',1.1,’y’);
insert into exchange values (113,'coindelta','rajdeep singh','india',0.8,’n’);

Insertion into CPT_EX


insert into cpt_ex(1,113);
insert into cpt_ex(1,112);
insert into cpt_ex(1,103);
insert into cpt_ex(1,105);
insert into cpt_ex(1,107);
insert into cpt_ex(2,101);

Department Of CSE ,Dr.AIT Page 8


CRYPTOCURRENCY DATABASE MANAGEMENT

insert into cpt_ex(2,102);


insert into cpt_ex(2,110);
insert into cpt_ex(2,104);
insert into cpt_ex(2,107);
insert into cpt_ex(3,101);
insert into cpt_ex(3,111);
insert into cpt_ex(3,103);
insert into cpt_ex(3,112);
insert into cpt_ex(4,110);
insert into cpt_ex(4,101);
insert into cpt_ex(5,112);
insert into cpt_ex(5,109);
insert into cpt_ex(6,108);
insert into cpt_ex(6,107);
insert into cpt_ex(7,107);
insert into cpt_ex(7,111);
insert into cpt_ex(8,106);
insert into cpt_ex(9,105);
insert into cpt_ex(10,104);
insert into cpt_ex(10,107);
insert into cpt_ex(10,112);

Insertion into WALLET


insert into wallet values (201,'ledger nano','h');
insert into wallet values (202,'edge wallet','s');
insert into wallet values (203,'exodus','h');
insert into wallet values (204,'coin nomi','s');
insert into wallet values (205,’Trezor','s');
insert into wallet values (206,’ledger blue','s');
insert into wallet values (207,’Jaxx','s');
insert into wallet values (208,’Mist','s');
insert into wallet values (209,’Metamask','s');
insert into wallet values (210,’Mycelium','h');

Insertion into CPT_WT


insert into cpt_wt values(1,201);
insert into cpt_wt values(1,202);
insert into cpt_wt values(1,203);
insert into cpt_wt values(1,204);
insert into cpt_wt values(1,205);
insert into cpt_wt values(2,202);
insert into cpt_wt values(2,206);
insert into cpt_wt values(3,207);
insert into cpt_wt values(3,208);
insert into cpt_wt values(4,207);
insert into cpt_wt values(5,204);
insert into cpt_wt values(6,201);
insert into cpt_wt values(6,206);
insert into cpt_wt values(7,208);
Department Of CSE ,Dr.AIT Page 9
CRYPTOCURRENCY DATABASE MANAGEMENT

insert into cpt_wt values(7,207);


insert into cpt_wt values(8,202);
insert into cpt_wt values(9,210);
insert into cpt_wt values(9,206);
insert into cpt_wt values(10,204);
insert into cpt_wt values(10,208);
insert into cpt_wt values(10,206);

Insertion into CUSTOMER


insert into customer values(301,’Yagnesh’,112,204,1,5,32043.55);
insert into customer values(302,’John’,101,207,9,10,85.3);
insert into customer values(303,’Rita’,111,209,4,250,156.25);
insert into customer values(304,’Shazeb’,109,201,7,2985,1450.71);
insert into customer values(305,’Tanuja’,107,201,9,2530,21580.9);
insert into customer values(306,’Tejas’,106,210,10,9425,349473);
insert into customer values(307,’Harry’,110,208,1,140,897219.4);
insert into customer values(308,’Peter’,101,204,3,715,339381.9);
insert into customer values(309,’Sharath’,113,204,7,6975,3389.85);
insert into customer values(310,’Heena’,112,208,6,4542,645917.8);

Chapter:-6
Snapshots
Department Of CSE ,Dr.AIT Page 10
CRYPTOCURRENCY DATABASE MANAGEMENT

6.1 Frontend UI

Department Of CSE ,Dr.AIT Page 11


CRYPTOCURRENCY DATABASE MANAGEMENT

Department Of CSE ,Dr.AIT Page 12


CRYPTOCURRENCY DATABASE MANAGEMENT

Department Of CSE ,Dr.AIT Page 13


CRYPTOCURRENCY DATABASE MANAGEMENT

Department Of CSE ,Dr.AIT Page 14


CRYPTOCURRENCY DATABASE MANAGEMENT

Insertion of coins

Insertion of ICO info

Department Of CSE ,Dr.AIT Page 15


CRYPTOCURRENCY DATABASE MANAGEMENT

Insertion of Exchnage

Insertion of Wallet

Department Of CSE ,Dr.AIT Page 16


CRYPTOCURRENCY DATABASE MANAGEMENT

Insertion of coin supported by an Exchange

Insertion of coin supported by an Exchange

Department Of CSE ,Dr.AIT Page 17


CRYPTOCURRENCY DATABASE MANAGEMENT

Insertion of a Customer

Department Of CSE ,Dr.AIT Page 18


CRYPTOCURRENCY DATABASE MANAGEMENT

Deletion of a coin

Deletion of ICO info of a coin

Department Of CSE ,Dr.AIT Page 19


CRYPTOCURRENCY DATABASE MANAGEMENT

Deletion of an Exchange

Deletion of a Wallet

Department Of CSE ,Dr.AIT Page 20


CRYPTOCURRENCY DATABASE MANAGEMENT

De-listing a coin from Wallet

De-listing a coin from Exchange

Department Of CSE ,Dr.AIT Page 21


CRYPTOCURRENCY DATABASE MANAGEMENT

Deletion of a Customer

Department Of CSE ,Dr.AIT Page 22


CRYPTOCURRENCY DATABASE MANAGEMENT

6.2 Backend

6.2.1Select Statements

Contents of crypto table

Contents of ico table

Department Of CSE ,Dr.AIT Page 23


CRYPTOCURRENCY DATABASE MANAGEMENT

Contents of exchange table

Contents of wallet table

Department Of CSE ,Dr.AIT Page 24


CRYPTOCURRENCY DATABASE MANAGEMENT

Contents of customer table

Contents of cpt_wt table

Department Of CSE ,Dr.AIT Page 25


CRYPTOCURRENCY DATABASE MANAGEMENT

Contents of cpt_ex table

Department Of CSE ,Dr.AIT Page 26


CRYPTOCURRENCY DATABASE MANAGEMENT

6.2.2 Queries
1)Find the customer name who pays the maximum fee for exchange.

select cusname
from customer c,exchange e
where c.excode=e.excode and e.fee=(select max(fee) from exchange);

2)find the name and market capitalization of cryptocurrency which raised maximum amount
during its initial coin offering and is also supported by binance exchange

select cname,mcap

from crypto c,ico i,exchange e,cpt_ex ce

where i.coinnum=c.coinnum and ce.coinnum=c.coinnum and ce.excode=e.excode and


i.amount=(select max(amount) from ico) and e.exname='binance';

Department Of CSE ,Dr.AIT Page 27


CRYPTOCURRENCY DATABASE MANAGEMENT

3) list the customer imformation who owns a coin who’s initial coin offering lasted for
prolonged duration.

select distinct(c.cid),c.cusname,c.noofcoins,c.balance
from customer c,crypto cy,ico i

where c.coinnum=cy.coinnum AND cy.coinnum in (select coinnum


from ico
where duration = (select max(duration) from ico) );

Department Of CSE ,Dr.AIT Page 28


CRYPTOCURRENCY DATABASE MANAGEMENT

4)list the imformation about the wallets which cand hold the coins which are inturn supported
by india based exchanges

select distinct(w.wcode) , w.wname, w.wtype

from wallet w, crypto c, cpt_wt cw, exchange e, cpt_ex ce

where w.wcode=cw.wcode AND cw.coinnum=c.coinnum AND c.coinnum=ce.coinnum


AND ce.excode IN (select excode
from exchange
where country = 'india');

Department Of CSE ,Dr.AIT Page 29


CRYPTOCURRENCY DATABASE MANAGEMENT

5) Retreive the customer id, name and balance of people who use hardware wallets and
decentralised exchange.

select c.cid ,c.cusname,c.balance


from customer c, exchange e
where c.excode=e.excode AND e.decentralised='y'

intersect

(select c.cid ,c.cusname,c.balance


from customer c, wallet w
where c.wcode=w.wcode AND w.wtype='h');

Department Of CSE ,Dr.AIT Page 30


CRYPTOCURRENCY DATABASE MANAGEMENT

6) list all the imformation about the exchange which supports ripple

select e.excode,e.exname,e.ceo,e.country ,e.fee,e.decentralised


from exchange e ,cpt_ex ce, crypto c
where e.excode = ce.excode AND ce.coinnum = c.coinnum AND c.cname='ripple';

Department Of CSE ,Dr.AIT Page 31


CRYPTOCURRENCY DATABASE MANAGEMENT

7)Retreive all the coin information who’s crowd funding was initiatied after 2015.

select c.coinnum, c.cname, c.mcap, c.price, c.tsupply, c.fname, c.year


from crypto c
where EXISTS (select *
from ico i
where c.coinnum = i.coinnum and i.startdate > '31-Dec-2015');

8) List the exchnage info which supports both ‘Bitcoin’ and ‘Ethernum’.

select e.excode ,e.exname, e.ceo, e.country, e.fee, e.decentralised


from exchange e, cpt_ex ce, crypto cy
where e.excode = ce.excode and
ce.coinnum = cy.coinnum and
cy.cname = 'bitcoin'

intersect

select ee.excode ,ee.exname, ee.ceo, ee.country, ee.fee, ee.decentralised


from exchange ee, cpt_ex cee, crypto cye
where ee.excode = cee.excode and
cee.coinnum = cye.coinnum and
cye.cname = 'ethernum';

Department Of CSE ,Dr.AIT Page 32


CRYPTOCURRENCY DATABASE MANAGEMENT

9) list the exchange code,name,ceo and country supporting that coins whos total supply is
not more than 30 million

select distinct(e.excode),e.exname,e.ceo,e.country
from exchange e,cpt_ex ce,crypto c
where e.excode=ce.excode AND ce.coinnum IN (select coinnum
from crypto
where tsupply<= 30.0
);

Department Of CSE ,Dr.AIT Page 33


CRYPTOCURRENCY DATABASE MANAGEMENT

10)Display the coin details which are used by customers ( which are in the descending order
of their balance).

select c.cusname,c.balance,cy.coinnum, cy.cname, cy.mcap, cy.price, cy.tsupply, cy.fname,


cy.year
from customer c, crypto cy
where c.coinnum = cy.coinnum
order by balance desc;

Department Of CSE ,Dr.AIT Page 34


CRYPTOCURRENCY DATABASE MANAGEMENT

CONCLUSION
Cryptocurrencies are bound to have a very strong future, but the question is to What extent
the cryptocurrencies will be under the control of the regulators in the future? On the other
side, the intervention of the government can also be profitable for the cryptocurrency market
as many people would start investing in it, assuming backup support from the government.
Also, such robust database would be an icing on the cake, as it enables the users to gain
insights regarding the current market condition of the mini world.

The problems, which existed in the earlier Centralised currency system, where the
governments would use the people’s money, without their concern, but with Cryptocurrencies
there is no room for such hasty decisions to be taken. This is because the people are in the
sole control of their funds. Even the government is looking out for a chance to eradicate the
Cryptocurrencies, as the people have stopped using the Fiat currencies provided by the
government.

Because cryptocurrencies require only an Internet connection, and are not dependent on
established institutions such as banks, they are ideally suited for societies without a well-
developed financial infrastructure .As with how many individuals emerging markets skipped
over landlines and went straight for mobile phones, the same individuals may skip the
overhead of the traditional banking system and engage directly in mobile banking. For these
reasons, we expect cryptocurrencies to become a major influence in emerging markets over
the next 3-5 years.

Within the cryptocurrency community, one of the most popularized goals is the total
replacement of banks and other centralized financial intermediaries. Although such
institutions may never be fully replaced by a democratized network, their role (and associated
profitability) may steadily diminish with rise of cryptocurrencies, hopefully leading to the
prevention of future financial catastrophes on the scale of the this crisis

Although cryptocurrencies have the possibility to replace functions of the existing financial
infrastructure, their greatest potential may be in incorporating with other technologies to
facilitate a true revolution. The blockchain model is ideally suited for Internet of Things (IoT)
transactions, which require both efficient simplicity and robust security. For example,
imagine if every time you needed to fill up a car with gas, your car could pay the gas station
automatically.

In addition to revolutionizing the financial system, the blockchain technology of underlying


cryptocurrencies has the potential to expand across nearly any industry that involves large-
scale record-keeping.

Department Of CSE ,Dr.AIT Page 35


CRYPTOCURRENCY DATABASE MANAGEMENT

BIBILOGRAPHY

www.stackoverflow.com
www.w3schools.com
www.tutorialspoint.com
https://www.quora.com/

Java The Complete Reference, Seventh Edition


iiti.ac.in/people/~tanimad/JavaTheCompleteReference.pdf

Fundamentals of Database Systems


iips.icci.edu.iq/images/exam/databases-ramaz.pdf

J2EE The Complete Reference, Third Edition


iiti.ac.in/people/~tanimad/J2EETheCompleteReference.pdf

Department Of CSE ,Dr.AIT Page 36

You might also like