Introducing Blockchain with Java: Program, Implement, and Extend Blockchains with Java 1st Edition Spiro Buzharovski instant download
Introducing Blockchain with Java: Program, Implement, and Extend Blockchains with Java 1st Edition Spiro Buzharovski instant download
https://ebookmeta.com/product/introducing-blockchain-with-java-
program-implement-and-extend-blockchains-with-java-1st-edition-
spiro-buzharovski-2/
https://ebookmeta.com/product/introducing-blockchain-with-java-
program-implement-and-extend-blockchains-with-java-1st-edition-
spiro-buzharovski/
https://ebookmeta.com/product/introducing-blockchain-with-lisp-
implement-and-extend-blockchains-with-the-racket-language-1st-
edition-boro-sitnikovski/
https://ebookmeta.com/product/learn-java-with-math-1st-edition-
ron-dai/
https://ebookmeta.com/product/statistics-of-earth-science-data-
their-distribution-in-time-space-and-orientation-2nd-edition-
graham-j-borradaile/
Rethinking darkness cultures histories practices 1st
Edition Nick Dunn Editor Tim Edensor Editor
https://ebookmeta.com/product/rethinking-darkness-cultures-
histories-practices-1st-edition-nick-dunn-editor-tim-edensor-
editor-2/
https://ebookmeta.com/product/junkyard-blues-1st-edition-al-moye/
https://ebookmeta.com/product/marketing-an-introduction-15th-
global-edition-gary-armstrong/
https://ebookmeta.com/product/spectacular-sports-world-s-
toughest-races-understanding-fractions-saskia-lacey/
https://ebookmeta.com/product/the-grey-eagles-of-chippewa-
falls-1st-edition-john-e-kinville/
The Protocol of the Gods A Study of the Kasuga Cult in
Japanese History Allan G. Grapard
https://ebookmeta.com/product/the-protocol-of-the-gods-a-study-
of-the-kasuga-cult-in-japanese-history-allan-g-grapard/
CHAPTER 1
Introduction
to Blockchain
https://doi.org/10.1007/978-1-4842-7927-4_1
Note that we will skip some of the technical bits in this chapter, as it
is only supposed to serve as introductory material. The technical bits
will be covered later when we start building the blockchain.
Let’s assume that you and your friends exchange money often, for
example, paying for dinner or drinks. It can be inconvenient to
exchange cash all the time.
One possible solution is to keep records of all the bills that you and
your friends have. This is called a ledger and is depicted in Figure 1-
1.
1 We will use this definition throughout the book, but note that there
are many different definitions on the Internet. By the end of this
book, you should be able to distinguish the slight nuances and
similarities in each definition.
transactions.
Further, at the end of every day, you all sit together and refer to the
ledger to do the calculations to settle up. Let’s imagine that there is a
pot that is the place where all of the money is kept. If you spent
more than you received, you put that money in the pot; otherwise,
you take that money out.
There are several ways this can be resolved, and the solution that we
will provide will be a simple check of the sum of the inputs and the
sum of the outputs.
A problem that might appear with this kind of system is that anyone
can add a transaction. For example, Bob can add a transaction where
Alice pays him a few dollars without Alice’s approval. We need to re-
think our system such that each transaction will have a way to be
verified/signed.
Definition 1-3 a
However, let’s assume that Bob is keeping the ledger to himself, and
everybody agrees to this. The ledger is now stored in what is a
centralized place. But in this case, if Bob is unavailable at the end of
the day when everybody gathers to settle up, nobody will be able to
refer to the ledger.
We need a way to decentralize the ledger, such that at any given time
any of the people can do a transaction. For this, every person
involved will keep a copy of the ledger to themselves, and when they
meet at the end of the day, they will sync their ledgers.
You are connected to your friends, and so are they to you. Informally,
this makes a peer-to-peer network.
Definition 1-4 a
peer-to-peer network is formed when two or
For example, when you are accessing a web page on the Internet
using a browser, your browser is the client, and the web page you’re
accessing is hosted by a server. This represents a centralized system
since every user is getting the information from a single place—the
server.
With the system (Figure 1-3), as the list of peers (people) grows, we
might run into a problem of trust. When everybody meets at the end
of the day to sync their ledgers, how can they believe the others that
the transactions listed in their ledgers are true? Even if everybody
trusts everybody else for their ledger, what if a new person wants to
join this network? It’s natural for existing users to ask this newcomer
to prove that they can be trusted. We need to modify our system to
support this kind of trust. One way to achieve that is through so-
called proof of work, which we introduce next.
5
Chapter 1 IntroduCtIon to BloCkChaIn
Definition 1-5 a
For each record we will also include a special number (or a hash) that
will represent proof of work, in that it will provide proof that the
transaction is valid. We will cover the technical details in the
“Hashing”
section.
At the end of the day, we agree that we will trust the ledger of the
person who has put most of the work in it. If Bob has some errands
to run, he can catch up the next day by trusting the rest of the peers
in the network.
1.2 Encryption
Note that in this section we will mostly talk about numbers, but
characters and letters can also be encrypted/decrypted with the same
methods, by using the ASCII2 values for the characters.
1.2.1 Functions
( x)
12
23
……
1.2.2 Symmetric-Key Algorithm
9
Chapter 1 IntroduCtIon to BloCkChaIn
This scheme is known as the Caesar cipher. To encrypt the text “abc”
we have E("abc") = "bcd", and to decrypt it we have D("bcd") =
"abc".
We share the public key with the world and keep the private one to
ourselves.
This algorithm scheme has a neat property where only the private
key can decode a message, and the public key can encode a
message.
10
public key p
1. Pick one random number, for example 100. This will represent a
common, publicly available key.
4. To encrypt data, add it to the public key and take modulo 100: E(x,
p) = (x + p) mod 100.
5. To decrypt data, we use the same logic but with our private key, so
D(x′ , s) = (x′ + s) mod 100.
11
The wallet will contain a pair of public and a private key. These keys
will be used to receive or send money. With the private key, it is
possible to write new blocks (or transactions) to the blockchain,
effectively spending money. With the public key, others can send
currency and verify signatures.
EXERCISE 1-1
EXERCISE 1-2
12
EXERCISE 1-3
EXERCISE 1-4
1.3 Hashing
13
The hash of the block is based on the block’s data itself, so to verify a
hash we can just hash the block’s data and compare it to current
hash.
EXERCISE 1-5
EXERCISE 1-6
In which way can the linked list depicted in Figure 1-4 be traversed?
What are the implications of this property?
3 Hashcash was initially targeted for limiting email spam and other
attacks.
However, recently it’s also become known for its usage in blockchains
as part of the mining process. Hashcash was proposed in 1997 by
Adam Backa.
14
Definition 1-10 a
1.5 Bitcoin
15
Chapter 1 IntroduCtIon to BloCkChaIn Although there are many
blockchain models and each one of them differs in implementation
details, the blockchain we will be building upon in this book will look
pretty similar to Bitcoin, with some parts simplified.
We will list a few important workflows that our system will use,
among others.
Checking a wallet balance for person A will first filter all blocks in the
blockchain (sender = A or receiver = A) and then sum them to
calculate the balance. The more our blockchain grows, the longer this
operation will take. For that purpose, we will use unspent transaction
outputs or the UTXO model. This model is a list of transactions
containing information about the owner and the amount of money.
Thus, every transaction will consume elements from this list.
1.7 Summary
The point of this chapter is to get a vague idea of how the system
that we will implement looks. Things will become much clearer in the
next chapter where we will be explicit about the definitions of every
entity.
16
17
CHAPTER 2
Model: Blockchain
Core
https://doi.org/10.1007/978-1-4842-7927-4_2
5pir3x/e- coin. The exercises included will offer insight and give you
ideas for you to modify my code to create alternative
implementations of various aspects of the application. I urge you to
try to complete as many of them as possible; my hope is that at the
end you will have not only a greater and deeper understanding of
blockchain technology but also with a great project for your portfolio
that’s an alternative to my implementation instead of a mere copy. I
have chosen to create a folder named Model inside my
src.com.company folder structure in my repository and keep my
model classes there. It is recommended that you choose the same
folder structure for your project to avoid any pathing or import
problems.
2.1 Block.java
We will start first by listing the imports in the following code snippet:
1 package com.company.Model;
3 import sun.security.provider.DSAPublicKeyImpl; 4
5 import java.io.Serializable;
6 import java.security.InvalidKeyException;
7 import java.security.Signature;
8 import java.security.SignatureException;
9 import java.util.ArrayList;
10 import java.util.Arrays;
11 import java.util.LinkedList;
12
20
14
The field prevHash will contain the signature or, in other words, the
encrypted data from the previous block. The currHash will contain the
signature or, in other words, the encrypted data from this block,
which will be encrypted with the private key of the miner that will get
to mine this block. The timeStamp obviously will contain a timestamp
of when this block was mined/finalized. The field minedBy will contain
the public key, which also doubles as the public address of the miner
that managed to mine this block. In the process of blockchain
verification, this public address/public key will be used to verify that
the currHash/signature of this block is the same as the hash of the
data presented by this block and secondary that this block was
indeed mined by this particular miner.
21
We will touch on this topic a bit later in this section when we explain
the isVerified method of this class. Next is our ledgerId field. Since
we intend to implement a database with separate Block and
Transaction tables, this field will help us retrieve the correct
corresponding ledger for this block. You can also look at this field as
the block number. Our next fields, miningPoints and luck, will be used
to form the network consensus in regard to choosing this block’s
miner.
We will get into the details of how these fields are used in Chapter 6.
The field transactionLedger is simply an arraylist of all the
transactions contained in this block. We will explain the Transaction
class in the section “Transaction.java.”
28 this.prevHash = prevHash;
29 this.currHash = currHash;
30 this.timeStamp = timeStamp;
31 this.minedBy = minedBy;
32 this.ledgerId = ledgerId;
35 this.luck = luck;
36 }
22
43 }
44 //This constructor is used only for creating the first block in the
blockchain.
45 public Block() {
48
48
51 signing.initVerify(new DSAPublicKeyImpl(this.minedBy)); 52
signing.update(this.toString().getBytes()); 53 return
signing.verify(this.currHash); 54 }
55
23
What’s left, as shown in our next snippet, are the equals and hash
methods, the generic getters and setters, and the toString() method,
which concludes our Block.java class:
55
56 @Override
62 }
63
64 @Override
66 return Arrays.hashCode(getPrevHash()); 67 }
68
71
24
prevHash; }
currHash; }
74
return transactionLedger; }
77 this.transactionLedger = transactionLedger; 78 }
79
80 public String getTimeStamp() { return timeStamp; }
this.minedBy = minedBy; }
82
this.timeStamp = timeStamp; }
84
86
this.miningPoints = miningPoints; }
91
this.ledgerId = ledgerId; }
94
25
Chapter 2 Model: BloCkChain Core
95 @Override
97 return "Block{" +
98 "prevHash=" + Arrays.toString(prevHash) +
104 '}';
105 }
106}
107
The first thing to note here is that the equals method compares the
previous hash of the block class. We’ll use this later in Chapter 6
when we explain the consensus algorithm further. The other thing of
note is the fields contained in the toString method. We include
everything that goes into verifying the block against the current hash.
Important!
• remember that a wallet’s public key is also the wallet’s public
address/account number.
• the miner’s private key is used to encrypt the block’s data, which
creates the signature.
26
• the miner’s public key is used for other peers to verify the block by
comparing the signature’s hash against the hash of the block’s data.
• note how all of the essential fields that make certain the block is
unique are included in the toString() method.
2.2 Transaction.java
1 package com.company.Model;
3 import sun.security.provider.DSAPublicKeyImpl; 4
5 import java.io.Serializable;
6 import java.security.InvalidKeyException;
7 import java.security.Signature;
8 import java.security.SignatureException;
9 import java.time.LocalDateTime;
10 import java.util.Arrays;
11 import java.util.Base64;
12
27
Next let’s go over the class declaration and its fields, as shown in the
next code snippet:
14
24
Since this class also creates objects from which we are building our
blockchain, it will implement the interface serializable so that it’s
shareable through the network.
The fields from and to will contain the public keys/addresses of the
account that sends and the account that receives the coins,
respectively.
The value is the amount of coins that will be sent, and timeStamp is
the time at which the transaction has occurred. Signature will contain
the encrypted information of all the fields, and it will be used to verify
the validity of the transaction (it will be used the same way the field
currHash was used in the previous class).The ledgerId serves the
same purpose as in the previous class. The fields with the FX suffix
are simple duplicates formatted to String instead of byte[]. We do
this so that we can easily display them on our front end.
In this class we also have two constructors; the first one is used
when we retrieve a transaction from the database, and the second
one is used when we want to create a new transaction within our
application. Let’s observe them in the following code snippet:
28
28 String timeStamp) {
35 this.signature = signature;
36 this.signatureFX = encoder.encodeToString(signature); 37
this.ledgerId = ledgerId;
38 this.timestamp = timeStamp;
39 }
49 this.ledgerId = ledgerId;
50 this.timestamp = LocalDateTime.now().toString(); 51
signing.initSign(fromWallet.getPrivateKey()); 29
Chapter 2 Model: BloCkChain Core
52 String sr = this.toString();
.signature);
56 }
57
The first constructor simply sets the class fields according to the
retrieved data from the database and uses the Base64.Encoder class
to convert the byte[] fields safely into String.
30
To achieve this, first we set up our data by initiating our class fields
from the parameters and add a timestamp as shown on lines 44 to
50. Now once we have our data that we would like to encrypt, we set
our private key to the signing object with the statement on line 51.
This tells the signing object, when encrypting, to use the private key
we provided. On line 52
60 signing.initVerify(new DSAPublicKeyImpl(this.
getFrom()));
61 signing.update(this.toString().getBytes()); 62 return
signing.verify(this.signature); 63 }
64
This method will be used by the other peers to verify that each
transaction is valid. Before explaining the code, let’s look at Figure 2-
2 and see what our method tries to accomplish.
31
Now let’s look back at our isVerified method and explain how the
workflow from the schematic is achieved. As parameters we are
getting the Transaction object that we want to verify and the
Signature helper class object, which pre-initialized to use SHA256
with DSA algorithm the same way as before. On line 60 we are
setting the public key with which we would like to decrypt our
signature. The new DSAPublicKeyImpl(byte[]
encoded) is just a wrapper from the sun.security.provider package
that will help convert our public key information from byte[] to
PublicKey object. On line 61 we set the transaction data that we want
to verify against the signature. Finally on line
Blockchaintransaction.java 62 we provide the signature, the process
of comparison/verification gets executed and a result is returned
automatically for us.
32
We finish up the rest of the class with generic getters, setters, and
our toString, equals, and hash methods, as shown in the following
snippet: 65 @Override
67 return "Transaction{" +
68 "from=" + Arrays.toString(from) +
73 '}';
74 }
75
78
81
85
this.ledgerId = ledgerId; }
88
90
33
94
95
96 @Override
102 }
103
104 @Override
108
109}
Important!
• note how all the essential fields that make certain the transaction is
unique are included in the toString()
method.
34
EXERCISE 2-1
2.3 Wallet.java
Let’s start as always with the imports for this class located in the
following snippet:
1 package com.company.Model;
3 import java.io.Serializable;
4 import java.security. *;
35
Important!
• our blockchain wallet also won’t contain any field containing the
current balance of the wallet. We will explain how we obtain our
wallet balance in Chapter 6.
Let’s look at our first two constructors on our next snippet, which will
be used when we want to create a new wallet and assign a new key
pair to it:
15 keyPairGen.initialize(keySize); 16 this.keyPair =
keyPairGen.generateKeyPair(); 17 }
36
Our third constructor will be used to create our wallet once we have
imported an already existing key pair from our database. We can
observe it in the following snippet:
18
The code here simply receives public and private key objects and
creates a new KeyPair object with them.
23
25
keyPair.getPublic(); }
C H ON
Starch food substances, 18 13 15
Sugar, grape, 6 12 6
cane, H2O + 12 22 11
,,
Oils, aniseed, etc., 10 12 1
Acids, tartaric, 4 6 6
, citric, etc., 6 8 7
,,
Hydrocyanic, or prussic, acid, one of the strongest poisons, 1 1 1
Tannin or tannic acid, 27 22 17
Turpentine oil (composed of carbon and hydrogen only) 10 16
C HNO
Morphia, 17 19 1 3
Strychnine, 21 22 2 2
Quinine (sulphate H2SO4), 20 24 2 2
The essence of coffee and tea, caffein or thein, 8 10 4 2
The alcohols, acids, ethers, and so on, are all composed of these elements:
CHO
Alcohol, 2 6 1
CHO
Acetic acid, 2 4 2
The combinations are infinite. Volumes are filled with organic chemistry.
Mere mention only can be made, to show the wonderful power these
elements display when variously combined.
Carb. Hyd.
Light carburetted hydrogen, marsh gas, or fire-damp, is 1 4 (C1H4)
composed of
Aceteline, another product, 2 2 (C2H2)
Heavy carburetted hydrogen, olefiant gas, the gas we 2 4 (C2H4)
burn, ethelene,
Does it not seem strange that the different numerical combinations of the
same elements should have such different effects upon the animal system?
Why should starch and sugar compounds be good for the sustenance of
animal life while other compounds of the same elements prove destructive
to life? Or, why should morphia have such a peculiar effect upon the animal
tissues—especially the nervous? And why should alcohol have such a
peculiar effect upon the master tissues of the body? The difference in the
chemical composition of quinine and strychnine is not so very great, yet the
action upon the system is by no means the same. The effect upon the tissues
is not the same.
The forces and powers exercised by any compound depend on the number
and kind of elements that enter into the composition. And the influence that
bears directly upon their mutual activity again depends, when in a state of
nature, upon the presence of heat. When a seed, as of wheat or of any
starchy vegetable, is thrown into the ground, it will not germinate except in
the presence of a certain amount of moisture, and heat, the heat varying
from 50° to 80° Fahrenheit, in addition to free communication with the air.
Each group of elements that enters into the composition of any substance,
carries with it qualities and capabilities peculiar to itself, throughout the
vegetable kingdom. Its influence upon the animal economy will depend on
the various atomic elements, and the quantities of each, that enter its
combinations. For example, the atmosphere, the balance of power between
O and N, is essential to both plant and animal. So with water, O H2. And so
with those foods, starch and sugars, C18H30O15 or C6 H12O6; in each of
these substances Carbon has its complement of Hydrogen and Oxygen. That
is, the Carbon is, as it were, diluted in a sufficient quantity of water to make
it suitable for food. Rob it of its Oxygen and it becomes a poison, an active
poison. The less the quantity of Oxygen in any substance of organic origin
the more unfit it becomes as a food. And it becomes poisonous to the
animal system in proportion as the Oxygen is absent or removed from the
composition. We have representatives of poisonous substances in alcohol,
C2H6O, a mild poison; and in hydrocyanic acid, C N H, the strongest poison
known.
Food may be taken into the system for three purposes: 1. Simply for the
maintenance of health; 2. For fattening purposes; 3. For the sake of
muscular energy.
We have seen that the work done by the master tissues causes a loss, or
produces a certain amount of waste material, consisting of Carbon,
Hydrogen, Oxygen, and Nitrogen, and some mineral matter—salts. This
loss or waste has to be replaced in quantity and quality sufficient in order to
maintain a healthy condition of the body.
And, since we know the precise, or almost the precise, quantity of material
excreted, which consists of Carbon, Nitrogen, Oxygen, and Hydrogen, etc.,
we can also estimate, with considerable precision, the quantity needed to
replace it.
More than 41 per cent of the entire weight of the body is made up of
muscular tissue. The nervous tissue constitutes not quite two per cent.
The watery portion of the muscle is not mentioned. Please notice the large
quantity of Carbon and the small quantity of Hydrogen in the composition
of the solid part of the muscle.
We are aware that the muscles are always producing Carbonic Acid—that
is, C and O2—and when a muscle contracts, there is a sudden and extensive
increase of the normal production.
The blood that comes from a contracting muscle is richer in Carbonic acid
—that is, it contains one atom more of Carbon and two atoms of Oxygen
more.
The blood that has passed through the lungs changes from venous to arterial
blood. The venous discharges about 5 vols. of Carbonic acid (C O2); the
arterial carries away about 5 vols. of Oxygen (O) to the tissues.
Oz.
Starch and sugars, about 20
Meats, proteids, 15
,,
Fats, 3½
,,
Water, 52
,,
About 32 ounces of saliva converts the starch into sugar. That is, the saliva
changes starch (C18 H30 O15) into sugar (C6 H11 O5). Meats are acted upon
by the gastric juice, it requiring about ten to twenty pints to dissolve three-
quarters to one pound of meat-stuff; and the substances in the stomach are
changed into chyme. The fats are emulsified by the gall from the liver—
about 30 to 40 ounces for 3 to 4 ounces of fat. And the pancreatic juice
completes the work and still farther dissolves all three kinds of substances,
so that, with the aid of the succus entericus, the whole mass is changed into
a substance called chyle. All the carbohydrates and proteids in solution,
together with the fluids taken into the system, are taken up by the veins of
the abdominal organs and conveyed by the portal vein to the liver. Passing
through the liver, the blood is collected by the hepatic vein and emptied into
the inferior vena cava. The fatty substances are taken up by the lacteals to
the receptaculum chyli, passed up the thoracic duct, and poured into the left
subclavian vein, which empties its contents into the superior vena cava.
In the tissues the Oxygen is taken up. That is, the Oxygen passes from the
blood to the tissues and the tissues throw off the Carbonic acid, which the
veins again carry to the right side of the heart.
Alcohol is composed of Carbon two (2), Hydrogen six (6), and Oxygen one
(1) (C2 H6 O1). Alcohol, like all poisonous substances, carries a small
amount of Oxygen. In composition it resembles very much, and probably is,
a union of C2 H4 + H2 O, C2 H4 = ethane, olefiant gas, or heavy carburetted
hydrogen. It is, in fact, a constituent of the gas we burn, procured from the
destructive distillation of coal—in other words, coal gas. To make it plainer,
ethane contains two of Carbon, four of Hydrogen + one molecule of water.
Since oxidation takes place in the tissues and not in the blood, the blood,
being overcharged with heavy carburetted Hydrogen (C2 H4), unloads it
into the tissue. The extra amount of Carbon arriving at the tissue, robs it of
its Oxygen. The Oxygen arriving from the lungs being insufficient, the
tissue loses Oxygen. The presence of Oxygen is necessary for the
maintenance of irritability. From the fact that no free Oxygen is present in
the muscular tissue the tension is nil or even less than nothing.
When the Carbon of the alcohol robs the tissues of its Oxygen, the
Hydrogen is set free. What becomes of it? The muscular and nervous
tissues contain from 51 to 54 per cent of Carbon in their composition, and 6
to 7 per cent of Hydrogen. The free Hydrogen combines with the Carbon of
the tissues and forms carburetted Hydrogen, with which the blood gets
overloaded, and carries it to the other tissues. The nervous system, the
brain, not receiving the Oxygen necessary, in consequence of the blood
being overcharged with both Carbonic acid and carburetted Hydrogen, the
nervous substance is first impaired, next exhausted, and lastly its normal
activity extinguished.
The muscles meantime through having been robbed of both Oxygen and
Carbon—receiving no free Oxygen or very little—and through the presence
in the circulating fluid of Carbonic acid and carburetted Hydrogen, lose the
power to act. The cerebrum, cerebellum, medulla oblongata, with all the
other subordinate nervous centers, being impaired by the poison and the
absence of Oxygen, the nerves of volition lose control, the cerebrum has its
will power impaired or entirely subdued, and the cerebellum loses the
power of muscular coördination.
Thus, then, the master tissues become crippled. At first alcohol may have a
stimulating effect on the nervous system; next, if the indulgence be
continued, the nervous forces become exalted; finally, however, depression
sets in, and proves at last a complete extinguisher of the intellectual
faculties.
The muscles first lose the power of coördination, the irritability and tension
gradually cease, at length they refuse to act.
The brain and muscles being helpless, the body lies in a state of stupor,
motionless. The individual is temporarily deprived of his mental faculties,
incapacitated, and completely oblivious to all his surroundings. The
involuntary organs, however, may act. The stomach may eject its contents,
having lost consciousness and will power. The urine and feces may pass off
involuntarily.
All organs have to suffer, but two more than all the rest—the liver and
kidneys.
The function of the liver, as we have already seen, is the secretion of the
bile. That organ has still another important duty to perform, and that is in
converting the starchy substances, or its already converted sugars, in to
glycogen = C6 H10 O5. The metabolic activity of the hepatic cells lies in the
formation of glycogene. Glycogene is a source of heat in the body. It is
constantly present in the muscle, as a functional material no doubt. The
chief purposes this substance serves are probably for respiration and
production of animal heat.
We must bear in mind that fats are composed of C, H, and O, and that both
fats and carbohydrates serve nutritive purposes. Whether any difference
exists between the two we do not know at present, beyond the fact that in
the final combination of the two, while carbohydrates require sufficient
Oxygen only to combine with their Carbon, there being already sufficient
Oxygen in the carbohydrate itself to form water with the Hydrogen, fats
require in addition Oxygen to burn off some of their Hydrogen.
Alcohol is not convertible into glycogene. The six atoms of Carbon are
complemented by five molecules of water: C6 + 5 O H2 = C6 H{10} O5. As
already stated, alcohol (C6 H2 O) contains only one molecule of water (H2
O + C2 H4 ethane). To convert the four of Hydrogen into water, two of
Oxygen are needed—and to form Carbonic acid three of Oxygen are
wanting.
The action of the alcohol, which must pass through the liver, is certainly not
beneficial. On the contrary, the function of the organ is interfered with and
the tissues of which the liver is composed slowly but surely undergo a
degenerative process.
The alcoholic beverages differ. As for example, whisky, wine, and beer—of
the three beer is probably the least injurious. By reason of the hops it
contains it helps to allay nervous irritability. When taken continuously in
large quantities, it leads to congestion of the liver and the accumulation of
fat. Beer contains only four to five per cent of alcohol, or thereabout. The
effect of beer on some individuals is somewhat similar, in the increase of
size, to the remarkable growth of some aquatic plants, as the gourd, in
which the vegetable tissue cells are very large and increase very rapidly.
The kidneys are the next to suffer severely by the alcoholic fluids. The
whole blood is purified by the kidneys. The transit is very rapid; the
elimination of impurities must necessarily be rapid. The body under the
normal condition eliminates Nitrogen chiefly; this is the urea and uric acid
found in the diurnal excretion of urine of fifty-two ounces in the twenty-
four hours. But if instead of a man drinking the ordinary allowance of fifty-
two ounces of water, a man takes in several hundred ounces, as in the case
of some beer-drinkers, it is evident that the kidneys have a great deal more
work to perform than usual, in addition to the constant irritability the
kidneys, like the liver and other organs, are subject to.
The theories on alcohol are various. I quote some of the more important
ones, briefly stated:
Lallemand and Perrin entertained the theory that alcohol was eliminated by
the excretory organs. (That means, perhaps, that alcohol simply
promenaded through the system.)
Another theory was that alcohol is converted into acetic acid (C2 H{4} O2);
and that acetic acid is split up into carbonic acid (C O2) and water—which
is impossible, as there is not Oxygen enough for both C O2 and H2 O.
That the function of the brain is entirely suspended, for a time at least,
needs no argument, because all will power is arrested, the nerves of special
sense cease to act, all nerve-centers suspend operation, and the nerve-fibers
no longer act as conductors of either motion or sensation. And the muscular
tissues are no longer capable of irritation, stimulation, or coördination;
contraction, flexion, and extension have been temporarily annihilated; the
force, the power, and the action have succumbed to the harmful influence of
alcohol. And the cause of it all is—too much carburetted Hydrogen and the
absence of Oxygen. This has unbalanced the elements that normally enter
into the composition of the tissue both of muscle and nerve.
The master tissues, the nervous and muscular, that get drunk, they are the
first to feel the stimulation, become excited, depressed, and exhausted.
And finally let us sum up some of the effects of alcohol on the system:
4. By the veins and absorbents alcohol mixes with the blood, and
immediately acts as a stimulant on all the tissues with which it is brought in
contact.
10. The functions of the brain are at once stimulated, and all other organs
are excited, and a train of phenomena is induced partly of a chemical nature
and partly of a physical or vital.
14. The water of the urine is diminished; the chlorides are greatly lessened,
as well as the acids and bases.
Most people are concerned about themselves only to the extent of securing
the immediate satisfaction of their senses. The superficial surroundings they
utilize to cater to the enjoyment of such indulgences of acquired taste, habit,
passion, feelings or emotions, as prove most gratifying to them, never
thinking that their constitution is nothing more than a vitalized chemical
machine, temporarily passing through its terrestrial cycle of physiological
activity, beginning as a mass of protoplasm, and terminating, when it has
gone through all the phases of animal existence, in the distribution of its
chemical elements.
The deranging effect of alcohol on the nervous and muscular tissues may be
compared to the working of an ordinary battery. We know that the action
and the force depend on the elements that enter into the composition of the
battery, fluids and solids, zinc and copper, and sulphuric acid—representing
zinc, copper, sulphur, Oxygen, and Hydrogen. The action of the zinc and
copper depends upon the fluids. Other fluids, though composed of three
elements, would produce either not the same effect, or no effect at all. It
stands to reason that, since we know the kind of fluid that will set the
elements in action, we certainly should be very unwise to use another fluid
that will either derange or destroy the battery’s working capacity. The forces
or force are in this instance produced by the combination of certain
elements, and in order to continue the activity or action of these elements
one upon the other, a constant supply must be kept up. The mechanism of
muscular action, or nervous action, depends upon the supply of certain
elements; they are continually replacing elements that are used up in the
work they have to perform—that is, the function of brain or muscle. The
moment elements are introduced that do not or cannot make up the loss of
the working expenditure, that tend rather to disorganize or decompose the
tissues, the functions and the natural forces are interfered with, weakened,
or may be brought to a standstill.
The effect of alcohol is much the same on all animals. I mean, that the
master tissues of the lower animals will succumb to the influence of alcohol
as readily as those of a human being. We know with certainty what gets
drunk—where is the spiritual part of man? where is the soul? When the
brain is intoxicated, its functions are more or less suspended, its controlling
or governing action is lost over the muscular tissue, in addition to the
muscles themselves being disabled. Both tissues, having been robbed of
their elementary equilibrium, consequently cease working. The moment the
equilibrium is reëstablished, the tissues assume their functions the same as
before. If a given number of specific parts enter into the construction of any
mechanism in order to produce a certain amount of force and effect, the
number of specific parts must always be present if the same force and effect
is to be realized. Brain and muscle are made up of a specific number of
elements; these must be always present if we would have them produce the
normal force and effect. When too much Carbon and Hydrogen and too
little Oxygen are introduced into the system, as in the case of alcohol, the
derangement of these elements is felt in the poisonous effect, because
enough Oxygen cannot be supplied to keep up with the demand.
CHAPTER XXIII.
THE SOUL—WHAT IS IT?
Dry truth, real knowledge, hard facts, are less interesting, less entertaining,
than a plausible fable or a fanciful story. While the latter is listened to, with
eagerness and pleasure, the former barely receives ordinary civility and
attention. The effort requisite to understand and to think, requires
resolution, determination, and fixed attention. The senses are not
stimulated, the emotions and feelings not aroused, by mathematical
problems or astronomical calculations. The muscular tissues are much more
easily trained, disciplined, and educated than the nervous tissues. In the
former we see immediate results. There is a pleasure in the pursuit, a
palpable satisfaction in watching the muscular action and physical
development. The most agreeable part about that kind of exercise, training
—or education if you choose—is that it is easily acquired and soon put in
practice, and much admired. It has other advantages in addition. The fatigue
and exhaustion in consequence of muscular exercise, add no small amount
of enjoyment to that already experienced, by having to replenish the spent
energies, to fill the demand for new material called for. The gustatory and
olfactory nerves are stimulated by odor of the viands provided, and what is
still more important, the glandular activity that is set in motion produces an
amount of exhilaration, so satisfactory that it is recognized as one of the
principal features for every and on all occasions. “A feast is made for
laughter and wine maketh merry” (Eccles. x, 19 ).
Muscular action, however, cannot take place without nervous action. These
two tissues are dependent one on the other. Yet the muscular tissue may be
considered as subordinate to the nervous tissue. While the muscular tissue
may become totally inactive or incapacitated, or even removed, the brain
tissue may retain its activity and continue to perform its functions. The very
reverse takes place when the brain is either injured or removed. We know
by experience, experiments, that injuries or other pathological changes will
cause impairment to muscular tissue.
It is hard to conceive, and harder still to understand, that an animal—man
included—is nothing more than a vitalized machine, composed in the first
place of two distinct working parts—muscular and nervous—while all the
other portions have to perform duty in order to sustain them.
The first part of the machinery is governed and checked by the domination
of the other. That dominion, that control, is termed Volition, in other words,
will power!
1. Will power! What is it? It is a power which every animal possesses, and
every animal exercises, in accordance with its particular organization and
degree of organic development.
2. Every animal has the power, with the aid of its senses—five senses of
sight, hearing, smelling, tasting, feeling—to select substances from the
vegetable and mineral kingdom, for its immediate want, for the sustenance
of life.
4. The animal has will power to protect and defend his possessions—
through his senses the brain directs and the muscles act.
5. The animal has will power, when the organs of procreation are
developed, to choose a partner for the production of young. The senses
serve in making the selection, as regards beauty, form, size, etc.
6. It has the will power to nourish and protect its young or to destroy it.
7. Animals have the will power to build their habitation, their home, and
furnish it in a manner best suited for their comfort.
8. Animals have the power to articulate sound, and have the will to
communicate with each other if they so desire, to antagonize or to quarrel.
9. They have the will power to select from the surrounding elements. They
choose water, air, sunshine, high or low altitudes; they migrate from warm
to cold, and from cold to warm, climates.
10. They have social intercourse among themselves; have a will power to
organize as a band or body to protect themselves against the attacks of other
organized bodies, to fight and to battle.
11. Animals instruct their young—guide them and protect them, as well as
feed them. They have their code of morals. They have all such functions as
serenading, love-making, music, jealousy, pleasure, and anger. Animals
have judgment; they can compare and reflect on cold and heat, danger and
tranquillity, comfort and discomfort. They can reject or accept.
12. They have memory, perception, and understanding. Domestic and wild
animals exhibit these peculiarities. They will manifest their likes and
dislikes, hate and love, courage and cowardice.
The will power, then, is the power to act in accordance and in harmony with
the things recognized, or the selection made by any of the five senses,
discriminating between that which is good for them and that which is
injurious, or good and evil.
Animals in selecting grass for food will avoid that which is injurious to
them. The olfactory and gustatory nerves guide them. They will seek
shelter, and evidently know what to do when a thunderstorm approaches,
etc., etc.
Morality differs according to the social customs and practices, and the civil
laws regulating the same, which were made and adopted for mutual benefit
and protection. These are either crude or refined, depending on the
condition of society.
To a limited degree animals have morality. Man has it in a higher and more
refined degree, according to the progress and culture attained.
The theological soul has its origin in the Bible, no doubt (from the word
nephesh, breathing; the Greek psyche: Latin animas, chayu, breath of life).
This word gave the impulse to a vast amount of thought and reflection, both
theological and psychological. Discussion and literature followed as
extensive as there has ever been on any metaphysical topic.
What is the difference between man and animal? Articulate speech and the
susceptibility of the brain matter to a high degree of culture.
9. I may add, suggestively, on the relative quantity and quality of the gray
and white substance of the brain, etc., and perhaps on the depth of the sulci
and the size of the convolutions and the general symmetry of the different
lobes of the cerebrum, etc.
Or supposing any portion of the brain is diseased and any one of the special
senses ceases to act, as sight, hearing, or any part of the muscular tissue,
and the intellect is impaired, either partially or wholly incapacitated, then
has the soul suffered any damage, or does the soul remain intact?
Or supposing that a child is born blind, or that some one of the nerve
centers controlling certain faculties of the brain is absent, and the education
is necessarily limited to the remaining nerve centers, is the soul still
complete and perfect?
When the body is afflicted with disease, does the soul suffer?
At what period of fetal development is it that the soul enters the body? Or
does it enter at birth?
The breath of life is Oxygen. Without that element one could not live.
Without it the newly born babe is more helpless than a lower animal. Not a
single special sense is fully developed. The brain substance is not fully
developed. The babe has no power to will anything. It has no volition—
except the act of nursing, and that is not a voluntary act. The organs over
which will has no control are the first to act—an infant soils its linen
involuntarily. It imbibes nourishment, as a mass of protoplasm imbibes
moisture. It has neither will power nor desire. It cannot select. It has neither
knowledge nor conscience. Since none of the special senses is able to act, it
has no perception of any kind whatsoever. It experiences only two
sensations, pain and hunger. Young birds and other young animals do the
same.
There are what may be termed latent powers—not unlike latent heat—
capable of being evolved. You may fashion anything out of it—in the
religious line, brutal or uncivilized, etc. It will acquire any kind of speech,
from the howling of a dog to the most refined language. It will contract any
habit, from that of the lowest animal type to that of the most refined lady or
gentleman. You may make either a cannibal out of it or the most fantastic
gustatorian. It will either crawl, climb, or walk. It will live anywhere and
anyhow. It will either parade nude, be painted, or wear a breechcloth, or
wear a swell dress coat, or, if it be a female, a long trailing skirt with all
sorts of gewgaws. In religion you may make anything out of this babe. You
may make it believe the greatest nonsense. It will believe three gods in one
or twenty-five gods in one. It will be a Jew, a Christian, a Mohammedan, or
the lowest brute on the face of the earth.
The nervous tissues require teaching. The senses must be trained, educated,
cultured, refined. The impressions received through the nerve-centers by the
senses are stored up in the cerebrum. Though they are at first simple, crude,
and incomprehensible, habit, use, or repetition enables them to familiarize
us with the surrounding objects.
Hunger, cold, heat, and moisture will cause it to manifest its dissatisfaction
by crying. It sleeps twenty out of the twenty-four hours, and wakes only to
indicate its wants of either hunger or discomfort. The more regularly it is
fed, and the more cleanly it is kept, the more peacefully will it rest and the
more soundly will it sleep.
An infant has no mind, intellect, thought, idea, memory, or any other nerve
quality that nerve structure is capable of developing.
Talk of soul or spirit is absurd. It does not exist either in infant or in man
any more than it exists in a plant or an animal—unless the term is applied to
the collective functions of the great central organs, and in that case it would
certainly not be supernatural.
At the time when the books of Moses were written—we need not even go
so far back as when the fable of creation was first related—they knew
nothing of circulation or of respiration, or of the nervous system. It was not
even thought of. I believe you may search the Bible from end to beginning
and from beginning to end without finding such a thing. No such word as
brain is mentioned. What is known of the nervous system is, comparatively
speaking, of recent date.
“What seems most marvelous is, that we, in the nineteenth century, boasting
of a high grade of civilization, and, I may say, with all the modern
improvements, should accept and still hold fast to an idea that originated in
the brain of some barbarian four thousand or more years ago, away down in
Mesopotamia (now Turkey) where they are still considered uncivilized.
This is certainly very strange.
THE MIND.
All the organs in the body are capable of performing their functions the
moment the child is born. Most organs have performed their functions prior
to the child’s birth. Circulation, respiration, digestion, secretion, and
excretion—these functions are performed at once. These are involuntary,
and require no educational training. They are performed while the organism
is otherwise entirely helpless.
The nervous system is not developed. The special senses are not
responsive—neither sight, hearing, taste, nor smell.
There are no voluntary muscular movements, no coördinations of
muscles.
Nervous and muscular tissues undeveloped.
Special senses undeveloped, no recognition.
It has no mind—no faculties, morality, intellect, memory, reason,
judgment.
In short, it has nothing innate—no principle of either God, soul, or
religion.
No will power. The muscular and nervous tissues are not yet able to
perform their functions, except such as are reflex and of an involuntary
character.
No expression.
2. A few weeks after birth.—
3. Three months.—
4. Six months.—
5. One year.—
A child one year old—(a) Recognizes its parents imperfectly. Has slight
coördinate movement of the upper extremities, and beginning of
coördination of the lower extremities. Manifests its wants by making
noises, but has no articulation. Sensations of pleasure, pain, and anger are
more plainly expressed. Playfulness is greater. Fear is exhibited. (b) It has
no mind, no intellect, no will power. No God, no religion, no soul. No
thought, no idea, no conscience. No faculties, no memory, no judgment. No
knowledge of objects, or numbers. It knows nothing of comparison,
relation, liberty, morality, love, hate, shame, joy, sorrow, despair, envy,
ambition, pride, etc., etc.
6. Second year.—
At the end of the second year the child (a) recognizes its parents and others
about it. Has coördinate movements comparatively correct of both lower
and upper extremities. May manifest its wants by imperfect articulation.
The sensations of pleasure, pain, and anger are more emphatic. (b) The will
power is slight. The memory is very feeble. Discrimination begins in simple
matters.
7. Third year.—
Training progresses.
Coördination complete.
Nerve centers formed.
Will power attempted.
It depends at this age upon the surroundings—the guidance, attention,
direction given to the child.
It is more susceptible to impression.
Memory improving.
Perception manifested, but little discrimination.
Articulates more perfectly.
Imitates to some extent.
Excretion controlled.
Playful, active.
All the senses work.
More subject to discipline—obeys more readily.
Teachable in right and wrong of a simple character.
Likes and dislikes more prominent.
Recognizes objects.
Begins to pronounce.
The functions of the brain are more distinctly manifest through the organs
of special sense. The child will become just what you make it; though the
latent inherited qualities will give impulse to some directions more than
others. Thus inclinations and susceptibilities are awakened that may lead to
greater or less distinction.
All that the child thus far has developed is instinctive, checked and
modified by those in whose care it is. The animal nature predominates, and
the child at this stage will become a brute if left to itself.
Brain may exercise will power without training, culture, or education. The
muscles may exercise strength without training, culture, or education. It is
the systematic attention of the one as of the other, the frequent repetition,
steady practice, that produces skill in the one, as in the other; it is the
patient application and perseverance in the one as in the other, sustained by
constitutional endurance, that makes the expert in the one as well as in the
other.
It is the united forces of the master tissues that have produced all that is and
was, and will continue to produce all that ever will be.
There are a class of men that are interested in sustaining the delusion; these
are the priesthood.
What we want is not the salvation of souls, but the salvation of man.