PDF Blockchain, Big Data and Machine Learning: Trends and Applications First Edition Kumar Download

Download as pdf or txt
Download as pdf or txt
You are on page 1of 53

Full download test bank at ebook textbookfull.

com

Blockchain, big data and machine


learning: trends and applications

CLICK LINK TO DOWLOAD

https://textbookfull.com/product/blockchain-
big-data-and-machine-learning-trends-and-
applications-first-edition-kumar/

textbookfull
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Machine Learning and Big Data Analytics Paradigms:


Analysis, Applications and Challenges Aboul Ella
Hassanien

https://textbookfull.com/product/machine-learning-and-big-data-
analytics-paradigms-analysis-applications-and-challenges-aboul-
ella-hassanien/

Demystifying big data and machine learning for


healthcare 1st Edition Frenzel

https://textbookfull.com/product/demystifying-big-data-and-
machine-learning-for-healthcare-1st-edition-frenzel/

Big Data, IoT, and Machine Learning: Tools and


Applications (Internet of Everything (IoE)) 1st Edition
Rashmi Agrawal (Editor)

https://textbookfull.com/product/big-data-iot-and-machine-
learning-tools-and-applications-internet-of-everything-ioe-1st-
edition-rashmi-agrawal-editor/

Proceedings of International Conference on Recent


Trends in Machine Learning, IoT, Smart Cities and
Applications: ICMISC 2020 Vinit Kumar Gunjan

https://textbookfull.com/product/proceedings-of-international-
conference-on-recent-trends-in-machine-learning-iot-smart-cities-
and-applications-icmisc-2020-vinit-kumar-gunjan/
Machine Learning Algorithms for Industrial Applications
Santosh Kumar Das

https://textbookfull.com/product/machine-learning-algorithms-for-
industrial-applications-santosh-kumar-das/

Introducing Data Science Big Data Machine Learning and


more using Python tools 1st Edition Davy Cielen

https://textbookfull.com/product/introducing-data-science-big-
data-machine-learning-and-more-using-python-tools-1st-edition-
davy-cielen/

SQL Server 2019 Revealed: Including Big Data Clusters


and Machine Learning Bob Ward

https://textbookfull.com/product/sql-server-2019-revealed-
including-big-data-clusters-and-machine-learning-bob-ward/

Feature Engineering for Machine Learning and Data


Analytics First Edition Dong

https://textbookfull.com/product/feature-engineering-for-machine-
learning-and-data-analytics-first-edition-dong/

Machine Learning and AI for Healthcare: Big Data for


Improved Health Outcomes Arjun Panesar

https://textbookfull.com/product/machine-learning-and-ai-for-
healthcare-big-data-for-improved-health-outcomes-arjun-panesar/
Blockchain, Big Data
and Machine Learning
Blockchain, Big Data
and Machine Learning
Trends and Applications

Edited by
Neeraj Kumar
N. Gayathri
Md. Arafatur Rahman
B. Balamurugan
First edition published 2020
by CRC Press
6000 Broken Sound Parkway NW, Suite 300, Boca Raton, FL 33487-2742

and by CRC Press


2 Park Square, Milton Park, Abingdon, Oxon, OX14 4RN

© 2021 Taylor & Francis Group, LLC

First edition published by CRC Press 2020

CRC Press is an imprint of Taylor & Francis Group, LLC

Reasonable efforts have been made to publish reliable data and information, but the author and publisher
cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and
publishers have attempted to trace the copyright holders of all material reproduced in this publication and
apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright
material has not been acknowledged please write and let us know so we may rectify in any future reprint.

Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced,
transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter
invented, including photocopying, microfilming, and recording, or in any information storage or retrieval
system, without written permission from the publishers.

For permission to photocopy or use material electronically from this work, access www.copyright.com or
contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-
8400. For works that are not available on CCC please contact [email protected]

Trademark notice: Product or corporate names may be trademarks or registered trademarks, and are used
only for identification and explanation without intent to infringe.

ISBN: 9780367370688 (hbk)


ISBN: 9780429352546 (ebk)

Typeset in Times
by Lumina Datamatics Limited
Contents
Preface......................................................................................................................vii
Editors........................................................................................................................ix
Contributors...............................................................................................................xi

Chapter 1 Introduction to Blockchain and Big Data.............................................. 1


Robbi Rahim, Rizwan Patan, R. Manikandan,
and S. Rakesh Kumar

Chapter 2 Blockchaining and Machine Learning................................................25


R. Venkatesh, L. Godlin Atlas, and C. Mageshkumar

Chapter 3 Blockchain Databases 1...................................................................... 65


S. Dhivya, S. V. Evangelin Sonia, and P. Suvithavani

Chapter 4 Blockchain Databases 2......................................................................97


Anurag Pandey, Abhishek Kumar, Achintya Singha,
N. Gayathri, and S. Rakesh Kumar

Chapter 5 Blockchain Use Cases in Big Data.................................................... 111


Harsh Kumar, Khushbu Agrawal, M. R. Manu, R. Indrakumari,
and B. Balamurugan

Chapter 6 Blockchain Storage Platforms for Big Data...................................... 141


Arnab Kumar Show, Abhishek Kumar, Achintya Singhal,
S. Rakesh Kumar, and N. Gayathri

Chapter 7 Visualizing Bitcoin Using Big Data: Mempool Visualization,


Visualization, Peer Visualization, Attack Visual Analysis,
High-Resolution Visualization of Bitcoin Systems,
Effectiveness..................................................................................... 155
Basetty Mallikarjuna, T. V. Ramana, Suresh Kallam,
Rizwan Patan, and R. Manikandan

Chapter 8 Blockchain and Distributed Ledger System...................................... 177


Yogesh Sharma, B. Balamurugan, and Firoz Khan

v
vi Contents

Chapter 9 Blockchain and Big Data in the Healthcare Sector...........................207


Yogesh Sharma, B. Balamurugan, and Firoz Khan

Chapter 10 Test-Driven Development Based on Your Own Blockchain


Creation Using Javascript.................................................................. 233
P. Balakrishnan and L. Ramanathan

Chapter 11 A Study on Privacy-Preserving Models Using Blockchain


Technology for IoT............................................................................ 265
Syed Muzamil Basha, J. Janet, and S. Balakrishnan

Chapter 12 Convergence of IoT, AI, and Blockchain: Technology Pathway


to Swachh Bharat.............................................................................. 291
P. Hamsagayathri, K. Rajakumari, P. Ramya,
and K. Shoukath Ali

Chapter 13 Quantum Computation for Big Information Processing................... 315


Tawseef Ayoub Shaikh and Rashid Ali

Index....................................................................................................................... 339
Preface
Blockchain is viewed as a revolutionary technology which addresses the modern
techniques of decentralization, identity, data driven decisions, and data owner-
ship. While blockchain applications and use cases are still in its nascent stages, the
potential for digital transformation is immense. Blockchain influences Big Data and
machine learning to find solution for storing and managing data in a distributed
fashion on a P2P network. Blockchain technology can be a new part of the sur-
rounding ecosystem of tools that Big Data uses. Actually, it can play a crucial role in
security for user authentication, restricting access based on a user’s need, recording
data access histories, and proper use of encryption on data. Moreover, privacy and
security are the two major concerns in Big Data analytics that should be significantly
considered to safeguard the network. The main objective of this book is to explore
threat intelligence, forensics and cyber security challenges in Big Data systems
applying machine learning concepts. In particular, we are heading for providing
solutions for the secured Big Data environment. This book is going to explicitly say
all about the dead fusion in realizing the privacy and security of blockchain based
data analytic environment.

vii
Editors
Dr. Neeraj Kumar received his PhD in CSE from SMVD University, Katra (J & K),
India, and was a postdoctoral research fellow in Coventry University, Coventry, UK.
He is working as a Full professor in the department of computer science and engi-
neering, Thapar Institute of Engineering & Technology, Patiala (Pb.), India since
2014. He has published more than 400 technical research papers, 10 edited/authored
books, and 100 conferences publications with more than 10000 citations and h-index
of 56. He has guided many research scholars leading to earn their PhD and ME/
MTech degrees. His research is supported by funding from TCS, CSIT, UGC, and
UGC in the area of smart grid, energy management, VANETs, and cloud computing.
He is a member of the Cyber-Physical Systems and Security (CPSS) research group.
He has research funding from DST, CSIR, UGC, and TCS of more than six crores
from GOI. He has supervised 12 Ph.D students and guided 25 ME/MTech students
with their thesis. He is a senior member of IEEE.

N. Gayathri received her ME degree in computer science and engineering. She is


currently working as an assistant professor in School of Computing Science and
Engineering at Galgotias University. She has published reputed 15 (SCI journals &
Scopus indexed journals), and also presented papers in national/international confer-
ences, published book chapters in CRC Press, IGI global, Springer, Elsevier and also
have edited books in Wiley and CRC Press. Gayathri has six Indian patents. She is
a guest editor for recent patents on computer science. Her research interests include
Big Data analytics, IoT, and networks.

Md. Arafatur Rahman received his PhD degree in electronics and telecommunica-
tions engineering from the University of Naples Federico II, Naples, Italy in 2013.
He has more than 10 years of research and teaching experience in the domain of
computer and communications engineering. Currently, he is an associate professor
with the Faculty of Computing, Universiti Malaysia Pahang, where he has conducted
undergraduate and master’s courses and supervised more than 21 BSc, 5 MSc, and
5 PhD students. He worked as a postdoctoral research fellow with University of
Naples Federico II in 2014 and visiting researcher with the Sapienza University of
Rome in 2016. His research interests include the Internet-of-Things (IoT), wireless
communication networks, cognitive radio network, 5G, vehicular communication,
cyber-physical systems, big data, cloud-fog-edge computing, machine learning,
and security. He has developed an excellent track record of academic leadership as
well as management and execution of international ICT projects that are supported
by agencies in Italy, the EU, and Malaysia. Dr. Rahman has received number of
prestigious international research awards, notably the Best Paper Award at ICNS
2015 (Italy), IC0902 Grant (France), Italian Government PhD Research Scholarship
and IIUM Best Masters Student Award, Best Supervisor Award at UMP, Awards
in International Exhibitions including Diamond and Gold in BiS 2017 UK, Best of
the Best Innovation Award and Most Commercial IT Innovation Award, Malaysia,

ix
x Editors

and Gold and Silver medals in iENA 2017 Germany. Dr. Rahman has co-authored
articles in around 100 prestigious IEEE and Elsevier journals (e.g., IEEE TII, IEEE
TSC, IEEE COMMAG, Elsevier JNCA, and Elsevier FGCS) and conference publi-
cations (e.g., IEEE Globecom, IEEE DASC) and has served as an advisory board
member, editor (Computers, MDPI), lead guest editor (IEEE ACCESS, Computers),
associate editor (IEEE ACCESS), chair, publicity chair, session chair, and member
of Technical Programme Committee (TPC) in numerous leading conferences world-
wide (e.g., IEEE Globecom, IEEE DASC, IEEE iSCI) and journal editorial boards.
He is a fellow of IBM Center of Excellence and Earth Resources & Sustainability
Center, Malaysia and a senior member of IEEE.

Dr. B. Balamurugan completed PhD at VIT University, Vellore and is currently


working as a professor in Galgotias University, Greater Noida, Uttar Pradesh. He has
15 years of teaching experience in the field of computer science. His area of interest
lies in the field of IoT, Big Data, and networking. He has published more than 100
international journal papers and contributed book chapters.
Contributors
Khushbu Agrawal S. V. Evangelin Sonia
School of Computing Science and Department of Computer Science and
Engineering Engineering
Department of Computer Science Sri Shakthi Institute of Engineering and
Galgotias University Technology
Greater Noida, India Coimbatore, India

Rashid Ali N. Gayathri


Department of Computer Engineering School of Computing Science and
Aligarh Muslim University Engineering
Aligarh, India Galgotias University
Greater Noida, India
P. Balakrishnan
SCOPE, VIT University
Vellore, India L. Godlin Atlas
Department of Computer Science and
S. Balakrishnan Engineering
Department of Computer Science and Sri Shakthi Institute of Engineering and
Business Systems Technology
Sri Krishna College of Engineering and Coimbatore, India
Technology
Coimbatore, India P. Hamsagayathri
Department of Electronics and
B. Balamurugan Communication Engineering
School of Computing Science and Bannari Amman Institute of
Engineering Technology
Galgotias University Erode, India
Greater Noida, India
R. Indrakumari
Syed Muzamil Basha
School of Computing Science and
Department of Information Technology
Engineering
Sri Krishna College of Engineering and
Galgotias University
Technology
Greater Noida, India
Coimbatore, India

S. Dhivya J. Janet
Department of Computer Science and Department of Computer Science and
Engineering Engineering
Sri Shakthi Institute of Engineering and Sri Krishna College of Engineering and
Technology Technology
Coimbatore, India Coimbatore, India

xi
xii Contributors

Suresh Kallam M. R. Manu


Department of Computer Science and School of Computing Science and
Engineering Engineering
Sree Vidyanikethan Engineering Department of Computer Science
College Galgotias University
Andhra Pradesh, India Greater Noida, India

Firoz Khan Anurag Pandey


Higher Colleges of Technology Department of Computer Science
Abu Dhabi, United Arab Emirates Banaras Hindu University
Varanasi, India
Abhishek Kumar
Department of Computer Science Rizwan Patan
Banaras Hindu University Department of Computer Science and
Varanasi, India Engineering
Velagapudi Ramakrishna Siddhartha
Harsh Kumar
Engineering College
School of Computing Science and
Vijayawada, India
Engineering
and
Department of Computer Science
Sree Vidyanikethan Engineering
Galgotias University
College
Greater Noida, India
Tirupati, India
Neeraj Kumar
Robbi Rahim
Department of Computer Science and
Department of Management
Engineering
Sekolah Tinggi Ilmu Manajemen
Thapar Institute of Engineering and
Sukma
Technology
Medan, Indonesia
Patiala, India

C. Mageshkumar Md. Arafatur Rahman


Department of Computer Science and Faculty of Computer System and
Engineering Software Engineering
Sri Shakthi Institute of Engineering and University Malaysia Pahang
Technology Pahang, Malaysia
Coimbatore, India
K. Rajakumari
Basetty Mallikarjuna Department of Computer Science and
School of Computing Science and Engineering
Engineering Sri Shakthi Institute of Engineering
Galgotias University Coimbatore, India
Greater Noida, India
S. Rakesh Kumar
R. Manikandan School of Computing Science and
School of Computing Engineering
SASTRA Deemed University Galgotias University
Thanjavur, India Greater Noida, India
Contributors xiii

T. V. Ramana Arnab Kumar Show


Federal Technical and Vocational Department of Computer Science
Education and Training Institute Banaras Hindu University
(FTVET) Varanasi, India
Addis Ababa, Ethiopia
Achintya Singhal
L. Ramanathan Department of Computer Science
SCOPE, VIT University Banaras Hindu University
Vellore, India Varanasi, India
P. Ramya
P. Suvithavani
Bannari Amman Institute of
Department of Computer Science and
Technology
Engineering
Department of Electronics and
Sri Shakthi Institute of Engineering and
Communication Engineering
Technology
Erode, India
Coimbatore, India
Tawseef Ayoub Shaikh
Department of Computer Engineering R. Venkatesh
Aligarh Muslim University Department of Computer Science
Aligarh, India Sri Shakthi Institute of Engineering and
Technology
Yogesh Sharma Coimbatore, India
Maharaja Agrasen Institute of
Technology
Rohini, Delhi

K. Shoukath Ali
Bannari Amman Institute of
Technology
Erode, India
1 Introduction to
Blockchain and Big Data
Robbi Rahim, Rizwan Patan,
R. Manikandan, and S. Rakesh Kumar

CONTENTS
1.1 Blockchain Basic Technologies......................................................................... 2
1.1.1 Basics of Blockchain and Its Architecture............................................ 2
1.1.1.1 Block Header...........................................................................4
1.1.1.2 Block Identifiers......................................................................5
1.1.1.3 Merkle Trees........................................................................... 5
1.1.1.4 Features of Blockchain...........................................................5
1.1.2 Blockchain and Bitcoin Transactions....................................................7
1.1.3 Hyperledger Frameworks......................................................................7
1.1.4 Smart Contract Framework and Its Working........................................8
1.2 Big Data Source for Blockchain........................................................................9
1.2.1 Blockchain and Big Data to Secure Data............................................ 10
1.2.2 Blockhain and Big Data Technologies for Data Analysis................... 11
1.2.3 Blockchain for Private Big Data Management.................................... 11
1.2.4 Confidentiality, Data integrity, and Authentication............................. 12
1.2.4.1 Data Confidentiality.............................................................. 12
1.2.4.2 Data Integrity........................................................................ 12
1.2.4.3 Data Authentication.............................................................. 12
1.2.4.4 Security Management Scenario for User Big Data
in Blockchain........................................................................ 12
1.3 Blockchain Use Cases in Big Data.................................................................. 13
1.3.1 Ensuring Data Integrity....................................................................... 14
1.3.2 Preventing Malicious Activities........................................................... 15
1.3.3 Predictive Analysis.............................................................................. 16
1.3.4 Real-Time Data Analysis..................................................................... 17
1.3.5 Managing Data Sharing....................................................................... 17
1.4 Applications of Blockchain Technology with Big Data Analytics.................. 18
1.4.1 Anti Money Laundering......................................................................20
1.4.2 Cyber Security..................................................................................... 21
1.4.3 Supply Chain Monitoring.................................................................... 21
1.4.4 Financial AI Systems........................................................................... 22
1.4.5 Medical Records.................................................................................. 22
References................................................................................................................. 22

1
2 Blockchain, Big Data and Machine Learning

1.1 BLOCKCHAIN BASIC TECHNOLOGIES


The first journey of blockchain technology was Bitcoin, It was a form of cryptocur-
rency designed by Nakamoto to design a swift, an inexpensive and translucent peer-
to-peer money transaction. With the acceleration and speedy movement of internet
era, the future industrial revolution also demanded for the requirement of to improve
the privacy of data-driven enterprise architecture, including but not limited to decen-
tralization, persistency, anonymity, and auditability.
A blockchain [1] consisting of two words block and chain refers to a continuous
growing list digital record in the form of packets also called as blocks that are linked
and secured with the aid of cryptographic mechanism. The blockchain, also referred
to as the digitally recorded blocks of data are secured and stored in the form of a
linear chain. Each block in the linear chain comprises of several data, i.e., Bitcoin
transaction.
This Bitcoin transaction on the other hand is secured via cryptographically hashed
following time stamped technology. When a new block is formed, it will contain a
hash of the previous block. These blocks are chronologically ordered initiating from
the first block since the inception in the entire blockchain to the newly formed block.
This process is repeated until it grows and maintains the network.

1.1.1 Basics of Blockchain and Its Architecture


A blockchain simply is referred to as the chain of blocks in a digital format. It is also
referred to as the decentralized ledger that records all transactions. The blockchain
has already been utilized for management of individual identity by several research-
ers in the field of research community. However, a new set of regulations has been
brought into by several researchers while dealing with the personal information of
users concerning blockchain [2].
Each and every time whenever a user or customer make a purchase of digital coins
via decentralized exchange, sells or transfers coins, a digital ledger records that spe-
cific transaction in an encrypted format, not understandable to anyone. In this way,
without the need of the third party, the transaction recorded in digital format is said
to be safeguarded from cybercriminals. The figurative representation of blockchain
is shown in Figure 1.1.
As shown in Figure 1.1, four blocks are included with each block connected in
chain with the other blocks. Here, block 1 is linked to block 2, block 2 is lined to
block 3, block 3 is linked to block 4 and block 4 is linked to block 1, forming a chain.
As illustrated in this figure, the block in other words is considered as the container
for data, where the data is said to be stored in that specific container. The structure
of a block is given below.
As far as Bitcoin blockchain, each block is composed of data referring to
the Bitcoin transactions, Block Header, Block Identifies, and Merkle Trees.
This ­section provides a detail description of the block structure (Table 1.1) [3].
Some of the normally used idioms of blockchain technologies involving the
design of b­ lockchain architecture [4] are shown below in Figure 1.2 along with
the description.
Introduction to Blockchain and Big Data 3

FIGURE 1.1 A sample blockchain.

TABLE 1.1
Block Structure
Field Description Size
Block size Size of block in bytes 4 bytes
Block header Several fields comprises of block header 80 byes
Transaction counters Frequency of transactions 1–9 bytes
Transaction Actual transactions recorded Variable

Header

Block version Merkle Tree Time stamp

Nonce Parent Block Target


Hash threshold

Transaction counter

Number of transactions in the block

Transactions

Transaction Data

FIGURE 1.2 Blockchain architecture.


4 Blockchain, Big Data and Machine Learning

• Blockchain types
• Node
• Consensus algorithm
• Block
• Header
• Transaction counter
• Transaction data

Blockchain types: Based on the operation, blockchain is divided into three


types—public blockchain, private blockchain, and consortium blockchain.
In the organization level, both private and consortium blockchain are used.
On the other hand, in case of public blockchain, security is said to be in the
increasing level; however, privacy is said to be in the decreasing level.
Node: Node is alternatively represented as a computer. It is said to be pos-
sessed by an organization participating in the blockchain network. It is also
referred to as a user. Node remains the central owner of any blockchain.
Its task remains in verifying the transactions with other nodes or com-
puter. The node in the blockchain framework forms as the association point
between blockchain technology and user.
Consensus algorithm: The consensus algorithm is also referred to as the
agreement between the blockchain and the user. It is used in the framework
with the purpose of approving the decisions for nodes or machines. Some
of the familiar consensus algorithm is proof of work (PoW), proof of stake
(PoS), proof ofburn (PoB), and so on.
Block: A block is referred to as the transaction decision included in the current
chain after effective consent.
Header: Block version denotes the presently obtained block version in block-
chain network. In the header, besides the predecessor block hash, successor
block hash is also kept in the header. A nonce is utilized to modify the block
hash output.
Transaction counter: The serial number of the present and previous block is
represented via a transaction counter.
Transaction data: The meaning of this field, i.e., transaction data changes
based on the usability. It either refers to a Bitcoin transaction, records, user
personal information, information pertaining to healthcare, and so on.

1.1.1.1 Block Header


The block header is composed of metadata about that specific block. A block header
is utilized to recognize a specific block on a complete blockchain. It is hashed in a
repeated manner with the purpose of creating proof of work for mining rewards. As
the blockchain comprises of sequences of several blocks that are utilized to store
information pertaining to specific transactions occurring on a blockchain network,
with the aid of block header, differentiation between the blocks are made.
The blockchain network consists of a unique header. Each block is identified with
the aid of block header hash. The specifications of the header include, an 80-byte
long string supporting a 4-byte long Bitcoin version number with a 32-byte previous
Introduction to Blockchain and Big Data 5

block hash. It also includes a 32-byte long Merkle root supporting a 4-byte long time-
stamp with a 4-byte long nonce utilized by the cryptography miners. Along with the
above description, the block header includes the following:
• Cryptographic hash
• Mining competition
• Data structure to summarize the transactions in the block

1.1.1.2 Block Identifiers


The block identifiers are specifically the cryptographic hash. With these block iden-
tifiers, the specific block is said to be identified in a unique manner. Usually, two
block identifiers are said to exist—block header hash and block height. As far as
block header hash are concerned, the block’s hash is evaluated by each node as soon
as the block is received from the network. The second method to obtain a block is via
its position in the blockchain, which is simply called as the block height.

1.1.1.3 Merkle Trees


The Merkle tree refers to the framework of transactions in the specific block for the
corresponding blockchain. The Merkle tree is utilized to store the summary of all
transactions in the block and refers to a data structure utilized for summarizing and
verifying the dataset integrity containing cryptographic hashes. It is also a method
to summarize the entire transactions pertaining to a block, ensuring an efficient pro-
cess to verify whether a transaction is included in a block or not. Figure 1.3 given
below illustrates a sample blockchain Merkle tree.

1.1.1.4 Features of Blockchain


Comprehending how a blockchain functions [5] from technical aspect, the charac-
teristics of blockchain should be understood. There are several things that the block-
chain is ready for change. It is reasonable that the Blockchain can really damage
multiple institutions and organizations and make the operations more representative,
secure, unambiguous, and effective. Blockchain steers an indispensable and disor-
derly tendency in several fields and aspects. With the growth in the evolution, several
intermediaries reduces in number, hence the overall system forms a decentralization
form, ensuring security and transparency.
Some of the key characteristics of blockchain is listed below is an adaptable one, in
that sense it is said to be altered to fit specific purposes. Figure 1.4 given below shows the
blockchain features, followed by which the description about the features are provided.

FIGURE 1.3 Calculating the blocks using Merkle tree.


6 Blockchain, Big Data and Machine Learning

Dispersed
estimation

Blockchain Informationre
Agreement features pository

Source Stability

FIGURE 1.4 Blockchain features.

As shown in Figure 1.4, the blockchain features include:

• Agreement
• Dispersed estimation
• Information repository
• Source
• Stability

The descriptive nature of blockchian features are elaborated as follows.

Agreement: The first and foremost feature of blockchain is the agreement.


Agreement, as the terms itself defines the potentiality of all the anony-
mous network users, agreeing the network’s rules and regulations. Besides,
whether the rules and regulations are being following by the network users
or not are also monitored in a regular basis in the blockchain framework.
The agreement in blockchain is said to be arrived at in several means like
PoW algorithm or PoS algorithm and so on.
As far as the PoW algorithm is concerned, complex mathematical equa-
tions are solved by crypto currency miners. The competing crypto miner
whoever solves these complex equations received the block reward, a frac-
tion of digital Bitcoin. On the other hand, the PoS algorithm is validated in
a deterministic fashion. Here, the more coins the crypto miner owns a vir-
tual currency, the more the crypto miner is likely to be selected to validate
blocks and add to the blockchain.
Dispersed estimation: The second important feature of blockchain is its dis-
persed estimation. Considering the example scenario of Bitcoin blockchain,
each user of the Bitcoin blockchain that is executing a full node will possess
an entire copy of the whole blockchain. The copy if composed of the data
all the entire transactions recorded on the Bitcoin blockchain.
Upon successful completion of the download, the node are then said to be
executed in an independent manner wherein the transactions are processed
Introduction to Blockchain and Big Data 7

and are then sent through several nodes across the network. One of the
most important aspects about the blockchain’s dispersed estimation is that
there is not central node in the network to process and distribute the data.
However, every node forming the block in the blockchain is said to be exe-
cuted in an independent manner.
Information repository: The third paramount feature of blockchain is the infor-
mation repository. Here, the information repository refers to the information
storage area. For example, in Bitcoin blockchain, the information repository
here refers to the information related to the Bitcoin transactional data.
Source: Blockchains ensures source in a preprogrammed manner. In conven-
tional type of banking, the customer is aware that the money deposited
or the jewels kept in the locker are safe in the bank. However, in case of
blockchain transaction, each activity performed by the user is traced, doc-
umented and fully identifiable without the aid of third-party required to
attest for a specific action to be taken.
Stability: The blockchain transaction are said to be stable because of the rea-
son that it is highly said to be stable. In that sense, the transaction pertain-
ing to blockchain cannot be changed as soon as the transaction is recorded.
Even in the case of erroneous record, the record cannot be deleted and is
said to be noticeable cannot be deleted. Furthermore, in order to make cor-
rections in the recorded transactions, a new transaction is said to be gener-
ated. That generated transaction is then said to refer the erroneous record.

1.1.2 Blockchain and Bitcoin Transactions


Bitcoin on the other hand is a cryptocurrency. As far as Bitcoin is concerned, it is a form
of digital currency in a decentralized form without the requirement of the third party
or bank. Transactions are said to be performed between the users without the require-
ment of the third parties or the intermediaries. The verification process is performed
via cryptography method and stored in a public distributed ledger called a blockchain.

1.1.3 Hyperledger Frameworks
The hyperledger framework refers to an open source collective endeavor to provide
cross industry blockchain technologies, hosted by Linux Foundation. Hyperledger
simply refers to the type of software that everyone are said to use with the objective
of creating one’s own personalized blockchain. Figure 1.5 shows the figurative rep-
resentation of hyperledger framework.

Software Developers Healthcare industry

FIGURE 1.5 Hyperledger framework for healthcare industry.


8 Blockchain, Big Data and Machine Learning

As shown in Figure 1.5, using personalized software with the support of specialized
developers, software is developed for healthcare industry.

1.1.4 Smart Contract Framework and Its Working


The framework of smart contract is designed in such a manner that it allows to
digitally permits, crosscheck, or validate the negotiation or contrast performance.
The purpose of using smart contracts is that it allows the performance of credible
transactions without the involvement of third parties or banks. The working of smart
contract is illustrated with the aid of Figure 1.6.
As illustrated in Figure 1.6, the smart contract working is split into three steps
and they are as follows:

1. Smart contracts are written in the form of code. With the code written, it
is submitted to the blockchain. Both the code and the rules and regulations
pertaining to the usage of the contract are available on the digital ledger in
a public manner.
2. Whenever an event presented in the contract is triggered, to name a few are,
expiry date or arrival of target price for purchasing a product, the event of
code is said to be executed.
3. The regulators have the provision to look into the contract activity on the
blockchain. This is performed with the objective of obtaining an under-
standing about the market. This is said to be attained with higher rate of
privacy for the individual users.

Some of the uses of smart contract working are:

• Blockchain healthcare
• Blockchain music
• Blockchain government

Blockchain healthcare: With the specialization of smart contract, one of the


fields of interest include healthcare, where the personal health records of
the patients are said to be encoded and stored on the blockchain. Then,
with the aid of only a private key, accessing of information is provided to
specific individuals. Besides, the surgeries that has to be performed with
certain patients are first stored on a blockchain and are then further sent

Trigger

Set of code Code execution Regulators

FIGURE 1.6 Smart contract working.


Introduction to Blockchain and Big Data 9

to insurance providers as proof-of-delivery. The digital ledger besides are


found to be useful for managing the healthcare of patients, specifically for
drug supervision, maintaining rules and regulations, testing, and compiling
with the healthcare supplies.
Blockchain music: Certain key issues in the case of music industry include
the ownership rights, distribution of royalty in an equitable manner and
ensuring transparency. Industry concerning digital music concentrates on
production monetizing, however the rights pertaining to ownership are
often ignored. The technology of blockchain and smart contracts technol-
ogy cut shots this problem by forming an extensive and precise fragmented
database of music rights. Besides, the digital ledger and clear transmission
of artist royalties and real-time distributions to all involved with the labels
are also being provided. In turn, the music players or vocalists are paid with
digital currency based on the concerts being conducted by them or accord-
ing to the terms of the contract.
Blockchain government: Digital data analysis say hackers garb the elec-
tronic system to influence votes. The digital ledger in blockchain technol-
ogy would avert this at the votes are said to be in the form of encrypted
nature. In this way, the private individuals can affirm that their valuable and
sensitive votes were includes and guarantee who they elected for. In this
way, by using the blockchain technology, the entire system would result in
minimizing the money for the government too. Also, based on the report of
McKinsey and Company made in 2013 report that open data that are freely
attainable from freely accessible government-sourced data being available
over the internet to all citizens of the country. Even startups have started
using this blockchain technology to eliminate fraudulent schemes; farmers
can utilize for precision farm-cropping; and so on.

1.2 BIG DATA SOURCE FOR BLOCKCHAIN


As discussed above in detail about the blockchain in the above section, to give a pre-
cise description, blockchain refers to a time-stamped series of data that is supervised
by a group of computers and specifically not possessed by any single entity. As far
as security is concerned, each block of data is said to be secured via cryptographic
mechanisms. On the other hand, big data refers to the data sets that are bound to be
complex for conventional type of data processing software [6–9]. Despite data with
several rows ensure greater statistical power, however, data with higher complex-
ity, i.e., involving more columns results in higher amount of false discovery rate.
Figure 1.7 shows the conceptual diagram of Big Data and Blockchain.
As shown in Figure 1.7, the reason behind the successful relationship between Big
Data and Blockchain is that the blockchain easily addressed the drawbacks of big
data. Some of the reasons are:

• Decentralization
• Transparency
• Immutability
10 Blockchain, Big Data and Machine Learning

FIGURE 1.7 Conceptual diagram of big data and blockchain.

Decentralization: The data stored in a blockchain is not said to be owner by


single entity. Hence, there is not probability of data or information getting
lose if that entity is said to be compromised. The conventional way of data
storage before the existence of Bitcoin was found to be centralized services.
Here, the entity was found to be centralized that stored all the information
pertaining to all the users in the network. Alternatively, while retrieving the
information, this entity was said to be contacted whenever required with
information, i.e., conventional banking system. In case of the decentralized
system, the information is not stored at a single entity; on the other hand,
every user in the network possesses his/her information. To perform com-
munication with another user, it can be done directly, without the require-
ment of a third party or via another entity.
Transparency: The transparent framework of the blockchain assists in track-
ing the data back to its point of origination. Yet another interesting fact
about the Big Data and Blockchain convergence is transparency. The per-
son or the users’ identity is said to be hidden by utilizing the complicated
cryptography mechanism and described only via public address. Hence,
while the users’ real identity is secured, the transactions that were per-
formed via the public address are only said to be viewed.
Immutability: Finally, immutability, in the framework of the blockchain
refers to that once some transactions have been entered into the blockchain
framework, the transactions are not said to be damaged or destroyed with.
The reason behind immutability in blockchain is that of the application [10]
of cryptographic hash functions. By applying this function, an input string
of any length is obtained as input and producing an output of a definite
length. As far as cryptocurrencies like Bitcoin are concerned, the transac-
tions occurring through digital ledger are considered as input, processed
via a hashing algorithm, resulting in a fixed length output.

1.2.1 Blockchain and Big Data to Secure Data


The technology combining Blockchain and Big Data assists in safeguarding the
data from possible data leaks. With the information being stored on the channel,
or blocks, even the most senior executives do not have the access to retrieve the
Introduction to Blockchain and Big Data 11

information provided multiple permissions are obtained from the network to access
the big data. Hence, it becomes highly complex and complicated from a cybercrimi-
nal point of view to seize it.
This is because of the reason that instead of uploading the big data or information
to a database server or to a cloud server, blockchain subdivided into finite number
of chunks and distributes them across the entire network of computers. In this way,
the presence of middleman or third party is avoided for processing a transaction.
Therefore, instead of placing the trust on a service provider, decentralization is said
to be achieved or ensured via immutable ledger. Besides, the big data in blockchain
is said to be in the encrypted form. Hence, it is said to be highly secured.

1.2.2 Blockhain and Big Data Technologies for Data Analysis


Blockchain as referred to above as a digital and decentralized public ledger that
records transactions across several machines linked in a peer-to-peer network basis.
Though it was originally designed for cryptocurrency assets involving Bitcoin; how-
ever, in the current years it has been used for several purposes. Apart from the above
said applications, blockchain also possess large amount of potentiality in analytics.
Several business establishments have started benefiting from data analytics for
several years. One type of data analytics that is assured to revolutionize and meta-
morphose the industry is predictive analytics. Predictive analytics is concentrated
on performing the predictions about the future course of actions on the basis of an
immense amount of historical data as well as mechanisms using machine learning
techniques.
Besides, with data analytics concern, the computational power of blockchain is
possessed from collective associated computers. Hence it is said to be strong enough
to precisely design the model to be examined on the basis of larger and enormous
amount of datasets, stored across the computers and therefore the network and pull
up the ones that can provide the answer. As for potential applications, blockchain
analytics are found to be of heavily applicable in the area of marketing, i.e., digital
marketing. In this way, even digital marketers could be able to prepare for future
marketing advertisements with the assistance of data obtained from market realities.

1.2.3 Blockchain for Private Big Data Management


Blockchain for private big data management is one of the main ways in which block-
chain set itself from the conventional models of mechanisms that are frequently
used today. No identity are said to be required in the network layer for blockchain.
This means that not name, email id, address, or any other information pertaining to
the user is required to download the information and the technology is started for
utilization.
In other words it refers to that there requires or possess no third party of central
server to store the users’ information, making blockchain technology significantly
more secure than a centralized server being used that can be easily cracked, putting
its users’ most sensitive data at risk. However, blockchain specifically increases the
data analysis transparency. This is designed in such a manner that if an entry or
12 Blockchain, Big Data and Machine Learning

Data integrity

Data Data
Confidentiality authentication

Security

FIGURE 1.8 Conceptual diagram of security for blockchain.

transaction is not said to be verified, it is rejected in an automatic manner. Hence,


the big data stored in blockchain is said to be highly and entirely transparent [11].

1.2.4 Confidentiality, Data integrity, and Authentication


Security concerns in blockchain for big data management are studied from the data
confidentiality, data integrity and data authentication point of view. Figure 1.8 shows
the conceptual diagram of security concerns in blockchain.

1.2.4.1 Data Confidentiality


This refers to the process of information hiding. It is performed with the purpose of
hiding information in such a manner that only the intended recipients view the data
or information provided by the provider. Data confidentiality is said to be attained
by utilizing several data encryption mechanisms available in the industry and also
through key pair models.

1.2.4.2 Data Integrity


This refers to the process of ensuring that the data transmitted from the source
machine or user to the destination machine or user is invariable by all means.
The data could be stopped in during the passage from the source machine or user
to the destination machine or user and also can be altered. Nowadays, data integrity
are said to be performed via by fingerprinting mechanism so that the destination
machine or user could approve that the data or information is not changed.

1.2.4.3 Data Authentication


This refers to the process of ensuring that the data provider is obviously the provider
of data. Therefore, the data provider should be authenticated in such a manner that
the source machine or the sender bluffing to be the source machine would not be able
to fake the communication.

1.2.4.4 Security Management Scenario for User Big Data in Blockchain


In this section a security management scenario for user big data in blockchain envi-
ronment is provided. The scenario presented in Figure 1.9 combines several users
controlled by Bigchain, the third parties inclined to access the information pertain-
ing to private provided by blockchain users, around the blockchain infrastructure
that is going to provide secure access to the data controlled by end users.
Introduction to Blockchain and Big Data 13

Key Key
generation generation

Third party Devices

Blockchain

FIGURE 1.9 Security management scenario for block user data in blockchain.

As given in the above scenario, end users of blockchain environment administer


their own security key. The security keys are generated using several cryptographic
mechanisms to be provided to the blockchain users. Besides, generating security
keys for blockchain users, credentials are also said to be generated for the third par-
ties so that the data is said to be accessed under strict access control. Both credentials
and security key are then translated to the blockchain environment so that rules
defined by the end user with respect to storage of data and accessing of data is said
to be ensured in a smooth manner [12–16].
The devices in blockchain in turn utilizing the security keys in turn store the
information into the blockchain. Finally, the end users feed the blockchain with spe-
cific and relevant information, wherein the smart contract are then applied by apply-
ing restrictions based on the security factor corresponding to each blockchain user to
store and retrieve data. Besides, the third party on the other hand, requesting autho-
rization for the corresponding end user for utilizing private data can in turn access
those data stored in the blockchain.

1.3 BLOCKCHAIN USE CASES IN BIG DATA


With increasing demand for data analytics, who can allocate more intuitions with
data and assist in solving more complicated issues, the need of blockchain in data
came into existence. This is even more complex and found to be more complicated
when big data is concerned, a matured facet of data science that bestows with enor-
mous data, cannot be lifted by conventional data processing models [17].
As far as blockchain and big data are concerned, data science examines data for
analyses data for actionable perceptions, whereas blockchain documents and per-
forms data validation. In other words, data science is used for prediction, whereas
blockchain is used in data integrity. According to Maria Weinberger of Janexter, “if
big is the quantity, blockchain is the quality.” Therefore, blockchain is concentrated
14 Blockchain, Big Data and Machine Learning

Data integrity

Preventing
Predictive
malicious
analysis
activities

Real-time data Managing


analysis data sharing

Blockchain use cases

FIGURE 1.10 Conceptual diagram of blockchain use cases in big data.

on data validation whereas big data is concentrated on making predictions from


enormous amounts of data. In this manner, blockchain has formed a new form of
perspective in data management and operation, without relying on central angle
where the entire data should be combined but in the form of decentralization.
In addition, validated data generated through blockchain technology comes in the
form of structured manner and precise. Also, the other important aspect where the
data generated through blockchain has become a boost for big data is the data integ-
rity because blockchain verifies the source where the data came from via its linked
chains without the aid of a third party (Figure 1.10).
Figure 1.10 shows the conceptual format of blockchain use cases in big data and
involves:

• Ensuring data integrity


• Preventing malicious activities
• Predictive analysis
• Real-time data analysis
• Managing data sharing

The above said use cases in big data are described in the following sections.

1.3.1 Ensuring Data Integrity


The first aspect making the blockchain use in big data is that the data recorded on
the blockchain are found to be reliable. This is because of the reason that they have
undergone via a process involving verification, specifically meant for ensuring qual-
ity. Therefore, the blockchain is said to provide transparency also. Though block-
chain technology was designed and processed with the objective of increasing the
integrity of Bitcoin, with the popularity of Bitcoin, the underlying technology behind
the design of blockchain has started receiving its popularity in other segment also.
Figure 1.11 shows the data integrity for big data blockchain.
Another random document with
no related content on Scribd:
BOOK VIII
BOOK VIII
Charles marries his sister to the Prince of Hesse—He is besieged in
Stralsund and escapes to Sweden—The enterprise of Baron
Gortz his premier—Plans of reconciliation with the Czar—An
attack on England—Charles besieges Frederickshal in Norway
—He is killed—His character—Gortz is beheaded.

DURING these preparations the King gave his only surviving


sister in marriage to Frederic, Prince of Hesse-Cassel. The Queen
Dowager, his grandmother, aged fourscore years, did the honours of
the fête on the 4th of April, 1715, and died shortly afterwards. The
King could not attend the ceremony, as he was so busy finishing the
fortifications of Stralsund, which was in danger from the Kings of
Denmark and Prussia. But he made his brother-in-law generalissimo
of all the forces of Sweden. This Prince had served the States-
General in the French war, and was considered a good soldier, a
qualification for his sister’s hand in the eyes of Charles XII.
Misfortunes now followed as fast as victories had once done. In
June 1715 the English King’s German forces and those of Denmark
invested the strong town of Wismar; the Danes, Saxons and
Prussians, 36,000 of them, marched in a body to Stralsund to form a
siege. Not far from Stralsund, five Swedish ships were sunk by the
Danes and Prussians. The Czar held the Baltic with two large men-
of-war, and 150 transports, which had 30,000 men on board. He
threatened a descent on Sweden, appearing alternately on the coast
of Elsingburg and Stockholm. All Sweden was in arms, expecting an
invasion; his land forces were chasing the Swedes from the places
they held in Finland towards the Gulf of Bothnia, but he attempted
nothing further. At the mouth of the Oder, a river that divides
Pomerania, and, passing Stetin, falls into the Baltic, there is a little
island called Usedom. Its position makes it a place of considerable
importance, for it commands the Oder both on the right and the left,
and whoever holds it is master of the navigation of that river. The
King of Prussia had dislodged the Swedes, and was holding the
place as well as Stetin, saying that he did so purely for the sake of
peace. But the Swedes had retaken Usedom in May 1715, and held
two forts there, one called Suine, on a branch of the Oder of that
name, the other called Penamonder, of greater importance, on
another branch of the river. The forts were manned with only 250
Pomeranians, commanded by an old Swedish officer called Kuze-
Slerp, a man who deserves to be remembered. On the 4th of April
the King of Prussia sent 1,500 foot and 800 dragoons into the island.
They arrived and landed on the side of Suine without opposition. The
Swedish commander had left them this fort, as being the least
important, and, not being able to divide his small force, he withdrew
to the castle of Penamonder, resolving to await the worst.
So they were forced to make a formal siege. They shipped
artillery at Stetin, and sent in a reinforcement of 1,000 Prussian foot
and 400 horse. On the 18th, they opened the trenches in two places,
and a brisk battery was played by cannon and mortars. During the
siege a Swedish soldier, sent privately with a letter to Charles, found
means to land on the island and slip into the place. He gave the
letter to the commander. It was as follows: “Do not fire till the enemy
come to the edge of the ditch; defend yourselves to the last drop of
your blood.—Charles.”
Slerp read the note, resolved to obey, and die as he was bid in
his master’s service. On the 22nd, at daybreak, the assault was
made. The besieged did as they were told, and killed many, but the
ditch was full, the breach large, and the besiegers too numerous.
They entered at two different places at once.
The commander now thought that he had no further duty but to
obey orders and sell his life dear, so he abandoned the breaches,
entrenched his few troops, who all had honour and courage enough
to go with him, and placed them so that they should not be
surrounded.
The enemy hastened up, surprised that he did not ask for
quarter; but he fought a whole hour, and when he had lost half his
soldiers, was killed at last with his lieutenant and major. There were
then left 100 men and one officer; these asked that their lives might
be spared, and were taken prisoners. In the commander’s pocket
they found his master’s letter, which was taken to the King of
Prussia.
Just as Charles had lost Usedom, and the neighbouring islands
which were quickly taken, while Wismar was on the point of
surrender, with no fleet to lend aid, and Sweden in great danger, he
himself was at Stralsund, besieged by 36,000 men. Stralsund,
famous throughout Europe for the siege the King of Sweden
sustained there, is one of the strongest places in Pomerania. It is
built between the Baltic and the Lake of Franken, near the Straits of
Gella. There is no land passage to it but across a narrow crossway
defended by a citadel, and by retrenchments that were once thought
inaccessible. There was in it a garrison of 9,000 men, and, more
than all, the King of Sweden himself. The Kings of Denmark and
Prussia besieged it with an army of 36,000 men, consisting of
Saxons, Prussians and Danes. The honour of besieging Charles was
too great an incitement to them to make any task difficult, so the
trenches were opened on the night between the 19th and 20th of
October, 1715.
The King of Sweden said at first that he wondered how any place
well manned and fortified could be taken. True, he had taken many
towns himself in the course of his victories, but none by regular
attack. It was the fame of his exploits that gained them; besides, he
never judged others by his own standard, and always underrated his
enemies. The besiegers carried on their work with great alacrity, and
they were assisted by a curious chance.
It is well known that the Baltic has no flux and reflux. The
entrenchments of the town were thought impregnable, as there was
an impassable marsh on the west and the sea on the east.
No one had remarked before that in a strong westerly wind the
waves of the Baltic roll back so as to leave only three feet of water
under the entrenchment. They had always thought it deep. A soldier,
happening to fall from the top of the entrenchment, was surprised to
find a bottom; but having made that discovery, he concluded that it
might make his fortune. So he deserted, and going to the quarters of
Count Wakerbath, General of the Saxon forces, he told him that the
sea was fordable, and that it would be easy to carry the Swedes’
entrenchments. The King of Prussia was not slow to take the hint.
The next day the west wind was still blowing; Lieutenant-Colonel
Kepel entered the water with 1,800 men, and 2,000 advanced at the
same time on the causeway; all the Prussian artillery fired, and the
Prussians and Danes gave an alarm on the other side. The Swedes
were sure they could deal with those who were advancing with such
rashness by the causeway; but Kepel, coming in behind them from
the sea, enclosed them so that they could make no headway, and
the position was carried after terrible slaughter on both sides. Some
of the Swedes retired into the town, but they were pursued by the
besiegers, and some entered pell-mell with those that were fleeing.
Two officers and four Saxon soldiers were already on the
drawbridge, but they had just time to shut it, and took the men, and
so for that time the town was saved. They found four-and-twenty
pieces of cannon on the entrenchments, which they turned against
the town. After this success the siege was carried on eagerly, the
town being cannonaded and bombarded without remission.
Opposite Stralsund on the Baltic is the island of Ruegen, which is
a rampart of the place, whither the garrison and people could retire if
they only had boats. This island was of the first importance to
Charles, for he knew that if the enemy were masters of it he would
soon be invested both by sea and land, and probably buried in the
ruins of Stralsund, or else taken prisoner by those whom he had
formerly despised so much and used so harshly.
However, the wretched state of his affairs had prevented him
from sending a sufficient garrison to Ruegen, and there were not
more than 2,000 regular troops altogether on the island. For three
months the enemy had been making all the preparations for an
attack on it, but having built boats for the purpose, the Prince of
Anhalt, favoured by good weather, made a landing at last with
12,000 men on the 15th of November.
The King, who was everywhere, was in this island; he joined
2,000 men who were entrenched near a little haven, about three
leagues from where the enemy had landed. He marched with them
at midnight, with great silence. The Prince of Anhalt had used what
seemed unnecessary caution to entrench his cannon. His officers
expected no attack by night, and had no idea but that Charles was
safe at Stralsund. But the Prince, who knew Charles much better,
ordered a deep ditch, with chevaux de frise on the edge, and took as
much care as if he had to do with a superior force.
At two in the morning Charles came to the enemy’s camp,
without the slightest noise. His soldiers said to one another, “Come,
let us pull up the chevaux de frise.” These words were overheard by
the sentinels; the alarm was quickly given, and the enemy stood to
arms. The King, raising the chevaux de frise, saw a great ditch. “Ah,”
he said, “impossible; this is more than I expected.” Not at all
discouraged, and knowing nothing of their numbers, nor they of his,
for the night favoured him in that, he decided at once, leaped into the
ditch, followed by some of the boldest. The chevaux de frise was
removed, the earth levelled with any trunks and branches they could
find, and the bodies of the dead for fascines. The King, generals,
and boldest of the officers and soldiers got on one another’s
shoulders as in assaults.
The fight began in the enemy’s camp; the vigour of the Swedes
threw the Danes and Prussians into disorder, but their numbers
being too disparate, the Swedes were repulsed in about a quarter of
an hour, and repaired to the ditch.
The unfortunate King rallied his troops in the field, and the fight
was renewed with equal warmth on both sides. He saw his favourite
Grothusen fall, and General Dardoff, and as he fought passed over
the body of the latter while he was still breathing. During, his
companion from Turkey to Stralsund, was killed before his face. The
King himself was shot near the left breast; Count Poniatowski, who
had been so lucky as to save his life before at Pultawa, had the good
fortune to do the same again, and gave him a new mount. The
Swedes retired to a part of the island named Alteferre, where they
still held a fort; from thence the King returned to Stralsund, obliged to
leave those brave troops who had served him so well in that
expedition; they were all prisoners of war two days later.
Among the prisoners was that unfortunate French regiment, the
débris of the battle of Hochstet, which had first served Augustus, and
afterwards Charles. Most of the soldiers were drafted into a new
regiment belonging to the son of the Prince of Anhalt, and he was
their fourth master. In Ruegen the commander of this vagrant
regiment was then the famous Count Villelongue, who had so nobly
risked his life at Adrianople to save Charles. He was taken with all
his men, and was ill rewarded for all his services, fatigues and
sufferings.
The King, having only weakened himself by all these prodigies of
valour, pent up in Stralsund and expecting to be taken, was yet the
same as he had been at Bender. Nothing could surprise him. All day
he was making ditches and entrenchments behind the walls, and at
night he sallied out against the enemy. The town was badly
damaged, bombs fell thick and fast, and half the town was in ashes.
The townsfolk, far from complaining, were full of admiration for their
master, whose temperance, courage and fatigues were astonishing;
they acted as soldiers under him, following to the attack, and were
now as good as another garrison.
One day, as the King was dictating to a secretary some
dispatches for Sweden, a bomb fell into the house, came through the
roof, and burst very near his room. Part of the floor fell in, but the
ante-room where he was at work, being attached to a thick wall, was
undisturbed, and by a lucky chance none of the splinters came in at
the door, though it was open. In this noise and confusion the
secretary dropped his pen, thinking that the house was coming
down. “What is the matter?” said the King calmly; “why are you not
writing?” The man could only stammer out, “The bomb, Sire!” “Well,”
said the King, “what has that to do with our writing? Go on.”
An ambassador of France, a M. de Croissy, was then shut up
with the King in Stralsund. To send a man on an embassy to Charles
was like sending him to the trenches. The King would talk with
Croissy for hours together, in the most exposed places, where
people were falling on all sides, killed by the bombs and cannon; the
King was unconscious of the danger, and the ambassador did not
care to say anything to make him chose a safer place for business.
Before the siege this minister tried his best to make a treaty between
the Kings of Sweden and Prussia; but the one expected too much,
and the other would not make any concessions. So that the only
satisfaction that Croissy got out of his embassy was the familiarity he
enjoyed with this remarkable man. He often slept on the same cloak
with him, and, as they shared so many dangers and fatigues, he was
outspoken with him. Charles encouraged this in the case of those he
liked, and would sometimes say to Croissy, “Veni, maledicamus de
rege.” “Come, let us talk scandal of Charles.”
Croissy stayed in the town till the 13th of November. Then, with
the permission of the enemy to pass with his baggage, he took leave
of Charles, whom he left among the ruins of Stralsund with only a
third of his garrison left, and fully resolved to stand an assault.
In fact, the assault on the horn-work was made in four days. The
enemy took it twice, and were twice beaten off.
At last numbers prevailed, and they became masters of it.
Charles stayed two days longer in the town, expecting every moment
a general assault; on the 16th he stayed till midnight in a little ravelin
quite destroyed by bombs and cannon; the day after the principal
officers begged him to stay no longer in this untenable situation, but
retreat was now as dangerous as to stay there. The Baltic was full of
Russian and Danish ships; in the port at Stralsund there was only
one boat with sails and oars. So many dangers made retreat
glorious, and determined Charles to go; he embarked on the evening
of December 20th, with ten persons aboard. They were obliged to
break the ice, and it was several hours before they could get away.
The enemy’s admiral had strict orders not to let Charles escape from
Stralsund. Happily they were to leeward of him, and could not
approach. He ran the most risk in passing a place called the
Barbette, in Ruegen, where the Danes had fixed a battery of twelve
cannon. They fired, and he made all the sail he could to get clear of
their range. Two men were killed close by him, and at another shot
the mast was shattered. In the midst of these dangers the King met
two of his ships that were cruising in the Baltic, and the next day
Stralsund was surrendered, and the garrison made prisoners of war.
The King landed at Isted in Scania, and came to Carlscrona, in a
very different state from that in which he had left it, ten years before,
when he started in a ship of twelve guns, to dictate to the North.
As he was so near his capital, it was concluded he would go
there after so long an absence. But he could not bear the thought of
it till he had gained some great victories. Nor did he want to see his
people who loved him, and to whose burdens he had perforce to add
to defend himself against his enemies. He only wanted to see his
sister, and he sent for her to meet him near Lake Wetter, in
Ostrogothia. He rode post-haste with one attendant, spent a day with
her, and returned.
At Carlscrona, where he passed the winter, he levied new forces
everywhere. He thought his subjects were only born to follow him to
war, and he had accustomed them to think so too. He enlisted many
of but fifteen years old. In many villages there were only old men,
women and children left; in some places the women ploughed
unaided. It was still more difficult to get a fleet. But to bring that
about commissions were given to privateers, who enjoyed great
privileges to the ruin of the country, but who provided him with some
ships. This was the last effort of Sweden to meet the great expense;
all the houses were searched, and half their provisions carried into
the King’s warehouses. All the iron in the country was bought up for
his use and paid for in paper, which he sold for ready money.
Whoever wore silk, or wigs, or gilded swords was taxed, and there
was a heavy hearth-rate.
A people thus loaded with taxation would have revolted under
any other King, but here the most miserable peasant knew that his
master was faring harder than he himself. So they quietly bore what
their King was always the first to bear. In the public danger, private
misfortunes were not thought of. They expected hourly an attack
from the Russians, Danes, Prussians, Saxons, and the English.
Their fear was so strong, and so well justified, that those who
possessed valuables buried them.
It was a surprise to all Europe, who had still an eye on Charles,
when, instead of defending his country about to be attacked by so
many princes, he invaded Norway at the head of 20,000 men. Since
the time of Hannibal there had been no instance of a general who,
unable to hold his own against his enemies at home, had gone to
attack them in their own dominions. His brother-in-law, the Prince of
Hesse, accompanied him. There is no way from Sweden to Norway
except by dangerous by-ways, where at every turn one meets with
pools of water, formed by the sea between the rocks; bridges have to
be made every day. A very few Danes might have stopped the
Swedish army, but they were not ready for such a rapid invasion.
Europe was still more surprised to find the Czar so quiet, without
descending on Sweden as he had intended.
The reason was that he had a plan, which was one of the
greatest, and one of the most difficult to carry out, that has ever been
conceived.
Baron Gortz, a Franconian by birth, and Baron of the empire,
having done the King of Sweden important services during his
sojourn at Bender, was now his favourite and Prime Minister. He was
the boldest and the most diplomatic of men: full of resource in
adversity, ambitious in his plans, and active in his policy, no project
was too ambitious for him, no means too dear for his end; he was
prodigal with presents, oaths, truth and falsehood. From Sweden he
went to England, France, Holland, to himself lay the train which he
meant to use; he was able to inflame all Europe, and that was his
idea. What his master was at the head of an army, he was in the
cabinet, and this gave him more influence over Charles than any
minister had ever had before. This King, who from the age of twenty
had given orders to Court Piper, was now willing to receive them
from Baron Gortz, and was the more submissive because his
misfortunes had made it necessary for him to ask advice, and
because Gortz’s advice suited with his courageous disposition. He
found that of all the princes in league against him Charles felt
especially resentful to George of Hanover, King of England: because
he was the only one whom Charles had never injured, and had
entered into the affair only as a mediator, with intent to hold Bremen
and Verden, which he bought for a trifle from the King of Denmark.
It was early that he discovered the Czar’s secret discontent with
the allies, who all wanted to prevent his getting any footing in
Germany.
Since the year 1714 the Czar had been in a position to make a
descent on Sweden, but whether he could not agree with the Kings
of Poland, England, Denmark, and Prussia, allies whose suspicions
were justifiable, or whether he thought his troops not seasoned
enough to attack that people at home, whose very peasants had
beat the pick of the Danish forces, he still took care to put it off.
The want of money was what had hitherto delayed him. For the
Czar was one of the greatest monarchs in the world, but not one of
the richest, his revenue not amounting to more than 18,000,000
French francs. He had discovered gold, silver, iron and copper
mines, but the profit they yielded was uncertain, and the working of
them expensive. He had established a great trade, yet at first it did
not flourish; his new conquests increased his power and his fame,
but brought him very little treasure.
Time was necessary to bind up the wounds of Livonia, a fertile
country which had suffered much from a fifteen years’ war, by fire,
sword and plague—almost desolate of inhabitants, and a burden to
the conqueror. The fleets he now maintained; and every day some
new enterprise was exhausting all his treasures. He had been
reduced to the bad expedient of raising the value of the coinage, a
remedy which never cures the evil, and is particularly injurious to any
country where the imports exceed the exports. It was upon these
grounds that Gortz had laid the basis of a revolution; he was bold
enough to suggest to the King of Sweden that he should make
peace with the Czar, insinuating that the Czar was very angry with
the Kings of Poland and England, and that Peter and Charles
together might make the rest of Europe tremble.
There was no making peace with the Czar, unless he yielded a
good many provinces to the east and west of the Baltic, but he called
his attention to the fact that in yielding such places as the Czar
possessed already, and which he could not possibly regain, he might
have the honour of replacing Stanislas on the throne of Poland, and
setting James II’s son upon that of England, besides restoring the
Duke of Holstein.
Charles was pleased with all this, and without giving the matter
much consideration he gave the minister full powers to act: Gortz left
Sweden with carte blanche for any prince he wished to treat with. His
first business was to try how the Court of Moscow stood, which he
did through the Czar’s chief physician, a man devoted to the
Pretender’s interests, as most of the Scots are, where they are not in
the pay of the English Court. This physician represented to Prince
Menzikoff, with all the eagerness of a man much interested, the
greatness and importance of such a plan. Prince Menzikoff was
pleased with it, and the Czar approved it. Instead of an invasion of
Sweden he sent his troops to winter in Mecklenburg, and came there
himself on the pretext of settling some disputes between his nephew
the Duke and his nobles: his real object was to gain a principality in
Germany, for which he hoped to bargain with the Duke.
The allies were angry at this step, not caring to have so terrible
and formidable a neighbour, who, should he once gain German
provinces, might become Emperor and oppress the sovereigns. The
greater was their resentment, the more that Gortz’s plan flourished.
But he negotiated with all the confederates in order to conceal his
private intrigues. The Czar fed them all with vain hopes. Charles was
all this while with his brother-in-law in Norway at the head of 20,000
men, the country was defended by 110,000 Danes in separate
bands, which were routed by the King and Prince of Hesse. Charles
advanced to Christiania, the capital, and fortune smiled on him
again, but from want of provisions he was forced to retire to Sweden,
there to await the result of his minister’s plan.
This affair was to be carried through with profound secrecy, and
elaborate preparations were necessary: these two are incompatible.
Gortz planned to go as far as Asia in his quest, and though the
means seemed undesirable, it would at least bring men, money and
ships to Sweden, which could be used for an attack on Scotland.
For some time the pirates of all nations, and especially the
English, had banded themselves together to infest the seas of
Europe and America; they had received no quarter and had retired to
Madagascar, a large island on the east coast of Africa; they were
quite desperate, and famed for actions which would have made them
heroes had they been legal. They wanted a prince to take them
under his protection, but international law shut them out from every
harbour.
When they heard that Charles XII was returned to Sweden they
hoped that, as he was devoted to war and forced to take share in it,
and needed a fleet and soldiers, he would be glad to make terms
with them. So they sent a deputy, who travelled to Europe in a Dutch
ship, to propose to Baron Gortz that they might be received at
Gothenburg, where they promised to prepare three-score ships
loaded with treasure.
The Baron persuaded the King to agree, and two Swedes were
sent to negotiate with them. Then more honourable and substantial
help came from Cardinal Alberoni, who directed the government of
Spain long enough for his own reputation but not for the good and
glory of that kingdom.
He took up the project of setting James II’s son on the English
throne with great enthusiasm. But as he had only just taken up the
ministry, and Spain was to be settled before he could attempt to
overthrow thrones, it appeared that there was no great likelihood of
his undertaking the task at present. Yet in two years he had done so
much for Spain, and had so raised her prestige in Europe that he
had got the Turks (it is reported) to attack the Emperor. Then he took
steps to remove the Duke of Orleans from the Regency and King
George from the English throne. Such danger lies in the power of
one single man who is absolute, and has the sense and capacity to
use his power.
Gortz, having made this beginning in the Courts of Russia and
Spain, went secretly to France, and thence to Holland, where he
interviewed representatives of the Pretender’s party. He got special
information concerning the strength, number, and position of the
disaffected in England, what money they could raise, and what men
they could put in the field. They only wanted 10,000 men, with which
they would feel assured of success. Count Gyllemburg, the Swedish
ambassador in England, acting under Gortz’s instructions, had
several meetings with the disaffected; he encouraged them and
promised them all they wanted. The Pretender’s party even
advanced considerable sums, which Gortz received in Holland, and
with which he bought ships and ammunition.
Then he secretly sent some officers to France, especially a
certain Folard, who, having served in thirty French campaigns
without mending his fortune, had volunteered with Charles, not with
any ulterior motive, but just to serve under a prince with such a
reputation. He especially hoped to get the Prince to adopt the new
discoveries he had made in the art of war, which he had studied
theoretically and had published views of in a commentary of
Polybius. Charles was pleased with his ideas, and, as he was never
governed by convention, he intended to make use of Folard in his
attack on Scotland.
The main point for Baron de Gortz was to settle a peace between
Charles and the Czar, in spite of the many difficulties in the way.
Baron Osterman, a man of weight in Russia, was not so ready to
agree with Gortz. He was as cautious as the other was enthusiastic.
One was for letting things gradually ripen, the other wanted to reap
and sow together. Osterman was afraid his master, pleased with the
plan, would grant too advantageous terms with Sweden, and so
delayed the conclusion of the matter. Luckily for Gortz the Czar
himself came to Holland at the beginning of 1717 on the way to
France, for he had yet to see this nation, criticized, envied, and
imitated by all Europe. He wanted to satisfy his insatiable curiosity,
but also he hoped to arrange some political matters.
Gortz had two talks with the Emperor at the Hague, and did more
by their means than he could have done in six months with
plenipotentiaries. Everything went well, his great plans seemed quite
unsuspected, and he hoped they would only be known to Europe in
their execution. The first who discovered these intrigues was the
Duke of Orleans, Regent of France, who had spies everywhere. The
Duke, having personal obligations to the King of England, made the
discovery of the whole plot against him. At the same time the Dutch,
having suspicions of Gortz’s behaviour, communicated them to the
English ministry. Gortz and Gyllemburg were getting on with their
schemes rapidly, when one was arrested at the Hague and the other
in London.
As Gyllemburg had broken international law by the conspiracy
they did not scruple in England to attack his person. But it was
thought exceedingly strange that the States-General imprisoned
Baron Gortz out of mere friendship for the King of England. They
even went so far as to appoint Count Velderen to question him. This
was going very far, and as it turned out, only added to their
confusion. Gortz asked Velderen if he knew him. “Yes,” said the
Dutchman. “Well, then,” he answered, “you must then be aware that
I shall only answer what I like.”
All the foreign ministers protested against the wrong done to the
persons of Gortz and Gyllemburg. Nothing could excuse the Dutch
from breaking so sacred a law in seizing the King of Sweden’s
premier, who had never done anything against them, and so violating
the spirit of freedom which has attracted so many strangers and has
been the cause of her greatness. The King of England acted within
his rights in seizing an enemy, so that the letters found among
Gyllemburg’s papers from him to Gortz were printed to justify the
King’s proceedings.
The King of Sweden was in Scania when the printed letters came
with the news of his ministers having been seized. He only smiled
and asked if his letters were printed too, and ordered the English
ambassador and all his family to be seized. But he could not take the
same vengeance on the Dutch, because they had no minister then at
the Court of Sweden. He kept a disdainful silence towards England
and Holland.
The Czar’s behaviour was just the opposite: as he was not
named but only hinted at by distant references in the letters of Gortz
and Gyllemburg, he wrote a long letter full of congratulations to the
King of England on the discovery, with assurances of his good-will.
King George received his protestations with incredulity, but
pretended to believe them. A plot laid by private men is at an end
when once discovered, but where kings are concerned a discovery
only makes it go further. The Czar came to Paris in 1717, and did not
spend all his time in viewing the wonders of art and nature there: the
academies, public libraries, cabinets of the antiquaries and royal
palaces. He made a proposal to the Regent which, had it been
accepted, would have put the finishing touch to the greatness of
Russia. It was this: to himself ally with the King of Sweden, who
would yield many countries to him, to take from the Danes their
power in the Baltic, to weaken England by a civil war, and to attract
to Russia all the trade of the North. He had thoughts, too, of setting
up Stanislas against King Augustus, so that when the fire was
kindled in all directions he could fan the flame or damp it as he saw
fit. With these views he proposed to the King’s Regent to mediate
between Sweden and Russia, and to make an offensive and
defensive alliance with them and Spain. The treaty, though so
natural and so useful to the nations concerned, putting into their
hands the balancing of power in Europe, was yet rejected by
Orleans, for he did just the opposite and made a league with the
Emperor and the King of England.
Political motives were then so powerful with all princes that the
Czar was going to declare war against his old friend Augustus, and
to help Charles his mortal enemy; while France, for the sake of the
English and Germans, was going to declare war against a grandson
of Louis XIV, after having so long supported him at great expenditure
of blood and treasure against those very enemies. All that the Czar
could obtain was that the Regent should interpose for the freeing of
Baron Gortz and Gyllemburg. He returned to Russia about the end of
June, having shown a rare example of an emperor travelling to
improve his mind. But what most of the French people saw of him
was a rough, unpolished exterior, the result of his education, while
they were blind to the legislator and the genius who had founded a
new nation. What he had sought for in Orleans he soon found in
Alberoni, who governed all Spain. Alberoni wanted to restore the
Pretender: first as the minister of Spain, so ill-used by the English,
and secondly because he had a personal quarrel with the Duke of
Orleans for his close alliance with England against Spain; besides,
he was a priest of that Church for which the Pretender’s father had
lost his crown.
The Duke of Ormond, as unpopular in England as the Duke of
Marlborough was admired, had left the country at the time of
George’s accession, and was now in Spain. He went with full powers
from the King of Spain to meet the Czar, in Courland, accompanied
by a certain D’Irnegan, an Englishman of ability and daring. The
business was to ask the Princess Anna, the Czar’s daughter, for
marriage with James’s son, in the hopes that such an alliance would
bring the Czar over to the King’s side. Baron Gortz, among his other
schemes, had intended this lady for the Duke of Holstein, who did
marry her later. As soon as he heard of the Duke of Ormond’s plan
he grew jealous and did what he could to defeat it.
He left prison in August with the Count Gyllemburg, without any
apology from the Swedish to the English King. At the same time the
English ambassador and his family were released at Stockholm,
where their treatment had been a great deal worse than
Gyllemburg’s in London.
Gortz at liberty was an implacable enemy, for besides his other
aims he now sought vengeance. He went post-haste to the Czar,
who was now better pleased with him than ever, for he undertook to
remove in less than three months all obstacles to a peace with
Sweden. He took up a map which the Czar had drawn himself, and,
drawing a line from Wibourg, by Lake Ladoga, up to the frozen
ocean, promised to bring his master to part with all that lay east of
that line, besides Carelia, Ingria, and Livonia. Then he mentioned the
marriage of the Czar’s daughter to the Duke of Holstein, holding out
hopes that the Duke would readily give his country instead, and if
once he became a member of the Empire the Imperial crown would,
of course, come to him or some of his descendants. The Czar
named the isle of Aland for the conferences between Osterman and
Gortz; he asked the English Duke of Ormond to withdraw lest the
English Court should take alarm. But D’Irnegan, his confidant,
remained in the town with many precautions, for he only went out at
night and never saw the Czar’s ministers but in the disguise of either
a peasant or a Tartar.
As soon as the Duke of Ormond went, the Czar impressed upon
the King his courtesy in having sent away the chief partisan of the
Pretender, and Baron Gortz returned to Sweden with great hopes of
success.
He found his master at the head of 30,000 troops with all the
coast guarded by militia. The King needed nothing but money, but he
had no credit at home or abroad. France, under the Duke of Orleans,
would give him none. He was promised money from Spain, but that
country was not yet in a position to support him.
Baron Gortz then tried a project he had tried before. He gave
copper the same value as silver, so that a copper coin whose
intrinsic value was a halfpenny might, with the royal mark, pass for
thirty or forty pence, just as the governors of besieged towns have
sometimes paid their soldiers with leather money till they could get
better. Such expedients may be useful in a free country, and have
often been the salvation of a republic, but they are sure to ruin a
monarchy, for the people quickly lose confidence, the minister is
unable to keep faith, the money paper increases, individuals bury
their specie, and the whole plan fails, often with disastrous results.
This was the case in Sweden. Baron Gortz had paid out his new coin
with discretion, but was soon carried beyond what he had intended
by forces he could not check. Everything became excessively dear,
so that he was obliged to multiply his copper coin. The more there
was of it the less was its value. Sweden was inundated with this
false money, and one and all complained of Gortz. So great was the
veneration of the people for Charles that they could not hate him, so
the weight of their displeasure fell on the minister who, as a foreigner
and financier, was sure to suffer their opprobrium.
A tax that he arranged on the clergy gave the final touch to the
universal hatred; priests are only too ready to plead that their cause
is God’s, and publicly declared him an atheist, because he asked for
their money. The new coins were embossed with the figure of
heathen gods, and hence they called them the gods of Gortz.
The ministry joined in the universal hatred of him, all the more
ardently because they were powerless. None in the country liked him
except the King, whom his unpopularity confirmed in his affection.
He placed absolute confidence in him, giving him also his entire
confidence at home. He trusted to him, too, all negotiations with the
Czar, especially as to the conference at Aland, which of all things he
wished to urge on with the greatest haste.
As soon as Gortz had completed at Stockholm the arrangements
for the treasury which demanded his presence, he went away to
complete with Osterman the great work he had in hand. These were
the preliminaries of that alliance which was to have changed the face
of affairs in Europe, as they were found among Gortz’s papers.
The Czar was to keep Livonia, part of Ingria, and Carelia, leaving
the rest to Sweden. He was to join Charles in restoring Stanislas,
and to send to Poland 80,000 men to dethrone the very king on
whose side he had been fighting for so many years before; he was to
supply ships to carry 30,000 to Germany and 10,000 to England; the
forces of both were to attack the King of England’s German
dominions, especially Bremen and Verden; the same troops were to
restore the Duke of Holstein and force the King of Prussia to an
agreement by parting with a good deal of his new acquisitions.
Charles acted henceforth as if his own victorious troops had done
all this, and demanded of the Emperor the execution of the peace of
Altranstadt. But the Court of Vienna scarcely deigned an answer to
one whom they feared so little. The King of Poland was not
altogether so safe, but saw the storm coming. Fleming was the most
suspicious man alive and the least reliable. He suspected the
designs of the Czar and the King of Sweden in favour of Stanislas,
so he endeavoured to have him taken off to Deux Ponts, as James
Sobieski had been in Silesia. But Stanislas was on his guard, and
the design miscarried.
In the meantime Charles was making a second attempt upon
Norway in October 1718. He had so arranged matters that he hoped
to be master of the country in six months.

You might also like