(Ebook) Beginning Ethereum Smart Contracts Programming: With Examples in Python, Solidity, and JavaScript by Lee, Wei-Meng ISBN 9781484250860, 1484250869 2024 Scribd Download
(Ebook) Beginning Ethereum Smart Contracts Programming: With Examples in Python, Solidity, and JavaScript by Lee, Wei-Meng ISBN 9781484250860, 1484250869 2024 Scribd Download
com
DOWLOAD EBOOK
ebooknice.com
ebooknice.com
https://ebooknice.com/product/sat-ii-success-
math-1c-and-2c-2002-peterson-s-sat-ii-success-1722018
ebooknice.com
(Ebook) Beginning Swift Programming by Lee & Wei-Meng;
https://ebooknice.com/product/beginning-swift-programming-38073604
ebooknice.com
ebooknice.com
ebooknice.com
https://ebooknice.com/product/beginning-iphone-sdk-programming-with-
objective-c-2322220
ebooknice.com
https://ebooknice.com/product/beginning-swift-programming-6808572
ebooknice.com
Beginning Ethereum
Smart Contracts
Programming
With Examples in Python,
Solidity and JavaScript
Wei-Meng Lee
Beginning Ethereum Smart Contracts Programming:
With Examples in Python, Solidity and JavaScript
Wei-Meng Lee
Ang Mo Kio, Singapore
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub via the book’s product page, located at www.apress.com/9781484250853. For more
detailed information, please visit http://www.apress.com/source-code.
Contents
Introduction�����������������������������������������������������������������������������������������������������������xvii
Index��������������������������������������������������������������������������������������������������������������������� 289
Introduction
Welcome to Beginning Ethereum Smart Contracts Programming!
This book is a quick guide to getting started with Ethereum Smart Contracts
programming. It first starts off with a discussion on blockchain and the motivations
behind it. You will learn what is a blockchain, how blocks in a blockchain are chained
together, and how blocks get added to a blockchain. You will also understand how
mining works and discover the various types of nodes in a blockchain network.
Once that is out of the way, we will dive into the Ethereum blockchain. You will
learn how to use an Ethereum client (Geth) to connect to the Ethereum blockchain and
perform transactions such as sending ethers to another account. You will also learn how
to create private blockchain networks so that you can test them internally within your
own network.
The next part of this book will discuss Smart Contracts programming, a unique
feature of the Ethereum blockchain. Readers will be able to get jumpstarted on Smart
Contracts programming without needing to wade through tons of documentation. The
learn-by-doing approach of this book makes you productive in the shortest amount
of time. By the end of this book, you would be able to write smart contracts, test them,
deploy them, and create web applications to interact with them.
The last part of this book will touch on tokens, something that has taken the
cryptocurrency market by storm. You would be able to create your own tokens and
launch your own ICO and would be able to write token contracts that allow buyers to buy
tokens using Ethers.
This book is for those who want to get started quickly with Ethereum Smart
Contracts programming. Basic programming knowledge and an understanding of
Python or JavaScript are recommended.
I hope you will enjoy working on the sample projects as much as I have enjoyed
working on them!
CHAPTER 1
Understanding Blockchain
One of the hottest technologies of late is Blockchain. But what exactly is a blockchain?
And how does it actually work? In this chapter, we will explore the concept of blockchain,
how the concept was conceived, and what problems it aimed to solve. By the end of this
chapter, the idea and motivation behind blockchain would be crystal clear.
Hold on tight, as I’m going to discuss a lot of concepts in this chapter. But if you
follow along closely, you’ll understand the concepts of blockchain and be on your way to
creating some really creative applications on the Ethereum blockchain in the upcoming
chapters!
Placement of Trusts
All these boil down to one key concept – placement of trust. And that is, we place our
trust on a central body. Think about it, in our everyday life, we place our trusts on banks,
and we place our trusts on our governments.
Even for simple mundane day-to-day activities, we place our trusts in central bodies.
For example, when you go to the library to borrow a book, you trust that the library
would maintain a proper record of the books that you have borrowed and returned.
The key theme is that we trust institutions but don’t trust each other. We trust our
government, banks, even our library, but we just don’t trust each other. As an example,
consider the following scenario. Imagine you work at a cafe, and someone walks up
to you and offers you a US ten-dollar bill for two cups of coffee. And another person
who offers to pay you for the two cups of coffee using a handwritten note saying he
owes you ten dollars. Which one would you trust? The answer is pretty obvious, isn’t it?
Naturally you would trust the US ten-dollar bill, as opposed to the handwritten note.
This is because you understand that using the ten-dollar bill, you can use it elsewhere
to exchange for other goods or services, and that it is backed by the US government. In
contract, the handwritten note is not backed by anyone else (except perhaps the person
who wrote it), and hence it has literally no value.
2
Chapter 1 Understanding Blockchain
Now let’s take the discussion a bit further. Again, imagine you are trying to sell
something. Someone comes up to you and suggests paying for your goods using the
currencies as shown in Figure 1-1.
Would you accept the currencies as shown in the figure? Here, you have two different
currencies – one from Venezuela and one from Zimbabwe. In this case, the first thing
you consider is whether these currencies are widely accepted and also your trust in these
governments. You might have read from the news about the hyperinflation in these two
countries, and that these currencies might not retain its value over time.
And so, would you accept these currencies as payment?
T rust Issues
Earlier on, I mentioned that people trust institutions and don’t trust each other. But even
established economies can fail, such as in the case of the financial crisis of the United
States in 2007–2008. Investment bank Lehman Brothers collapsed in September 2008
because of the subprime mortgage market. So, if banks from established economies can
3
Chapter 1 Understanding Blockchain
collapse, how can people in less developed countries trust their banks and governments?
Even if the banks are trusted, your deposits may be monitored by the government, and
they could arrest you based on your transactions.
As we have seen in the example in the previous section, there are times when people
don’t trust institutions, especially if the political situation in that country is not stable.
All these discussions bring us to the next key issue – even though people trust
institutions, institutions can still fail. And when people lose trust in institutions, people
turn to cryptocurrencies. In the next section, we will discuss how we can solve the trust
issues using decentralization, a fundamental concept behind cryptocurrency.
E xample of Decentralization
To understand how decentralization solves the trust issue, let’s consider a real-life example.
Imagine a situation where you have three persons with DVDs that they want to share
with one another (see Figure 1-2).
4
Chapter 1 Understanding Blockchain
The first thing they need to do is to have someone keep track of the whereabouts
of each DVD. Of course, the easiest is for each person to keep track of what they have
borrowed and what they have lent, but since people inherently do not trust each other,
this approach is not very popular among the three persons.
To solve this issue, they decided to appoint one person, say B, to keep a ledger, to
hold a record of the whereabouts of each DVD (see Figure 1-3).
5
Chapter 1 Understanding Blockchain
This way, there is a central body to keep track of the whereabouts of each DVD. But
wait, isn’t this the problem with centralization? What happens if B is not trustworthy?
Turns out that B has the habit of stealing DVDs, and he in fact could easily modify the
ledger to erase the record of DVDs that he has borrowed. So, there must be a better way.
And then, someone has an idea! Why not let everyone keep a copy of the ledger
(see Figure 1-4)? Whenever someone borrows or lent a DVD, the record is broadcast to
everyone, and everyone records the transaction.
6
Chapter 1 Understanding Blockchain
We say that the record keeping is now decentralized! We now have three persons
holding the same ledger. But wait a minute. What if A and C conspire to change the
records together so that they can steal the DVDs from B? Since majority wins, as long
as there is more than 50% of the people with the same records, the others would have
to listen to the majority. And because there are only three persons in this scenario, it is
extremely easy to get more than 50% of the people to conspire.
The solution is to have a lot more people to hold the ledger, especially people who
are not related to the DVDs sharing business (see Figure 1-5).
7
Chapter 1 Understanding Blockchain
Figure 1-5. Getting a group of unrelated people to help keep the records
This way, it makes it more difficult for one party to alter the records on the ledger,
and that in order to alter a record, it would need to involve a number of people altering
the record all at the same time, which is a time-consuming affair. And this is the key idea
behind distributed ledger, or commonly known as blockchain.
8
Chapter 1 Understanding Blockchain
Figure 1-6. Transactions form a block, and then blocks are then chained
Based on what we have discussed, we can now summarize a few important points:
9
Chapter 1 Understanding Blockchain
Figure 1-7. Every blockchain has a beginning block known as the genesis block
The blocks are connected to each other cryptographically, the details in which we
will discuss in the sections ahead. The first block in a blockchain is known as the genesis
block.
So, the next important questions is – how do you chain the blocks together?
We are now ready to discuss how blocks in a blockchain are chained together. To
chain the blocks together, the content of each block is hashed and then stored in the next
block (see Figure 1-8). That way, if any transactions in a block is altered, that is going to
invalidate the hash of the current block, which is stored in the next block, which in turn
is going to invalidate the hash of the next block, and so on.
11
Chapter 1 Understanding Blockchain
Observe that when hashing the content of a block, the hash of the previous block is
hashed together with the transactions. However, do take note that this is a simplification
of what is in a block. Later on, we will dive into the details of a block and see exactly how
transactions are represented in a block.
Storing the hash of the previous block in the current block assures the integrity of the
transactions in the previous block. Any modifications to the transaction(s) within a block
causes the hash in the next block to be invalidated, and it also affects the subsequent
blocks in the blockchain. If a hacker wants to modify a transaction, not only must he
modify the transaction in a block but all other subsequent blocks in the blockchain. In
addition, he needs to synchronize the changes to all other computers on the network,
which is a computationally expensive task to do. Hence, data stored in the blockchain
is immutable, for they are hard to change once the block they are in is added to the
blockchain.
Up to this point, you have a high-level overview of what constitutes a blockchain and
how the blocks are chained together. In the next section, you will understand the next
important topic in blockchain – mining.
M
ining
Whenever you talk about blockchain or cryptocurrencies, there is always one term that
comes up – mining. In this section, you will learn what is mining, and what goes on
behind the scene.
Mining is the process of adding blocks to a blockchain. In a blockchain network,
such as the Bitcoin or Ethereum network, there are different types of computers known
as nodes. Computers on a blockchain that add blocks to the blockchain are known as
miner nodes (or mining nodes, or more simply miners).
We will talk about the different types of nodes later on in this course, but for now, we
want to talk about a particular type of node, known as the miner node. The role of the
miner node is to add blocks to the blockchain.
But how are blocks added?
B
roadcasting Transactions
When a transaction is performed, the transaction is broadcasted to the network (see
Figure 1-9).
12
Chapter 1 Understanding Blockchain
Figure 1-9. Transactions are broadcasted to mining nodes, which then assemble
them into blocks to be mined
Each mining node may receive them at different times. As a node receives
transactions, it will try to include them in a block. Observe that each node is free to
include whatever transactions they want in a block. In practice, which transactions get
included in a block depends on a number of factors, such as transaction fees, transaction
size, order of arrival, and so on.
At this point, transactions that are included in a block but which are not yet added
to the blockchain are known as unconfirmed transactions. Once a block is filled with
transactions, a node will attempt to add the block to the blockchain.
Now here comes the problem – with so many miners out there, who gets to add the
block to the blockchain first?
13
Chapter 1 Understanding Blockchain
Figure 1-10. Hashing the block to meet the network difficulty target
In order to successfully add a block to the blockchain, a miner would hash the
content of a block and check that the hash meets the criteria set by the difficulty target.
For example, the resultant hash must start with five zeros and so on.
As more miners join the network, the difficultly level increases, for example, the
hash must now start with six zeros and so on. This allows the blocks to be added to the
blockchain at a consistent rate.
But, wait a minute, the content of a block is fixed, and so no matter how you hash it,
the resultant hash is always the same. So how do you ensure that the resultant hash can
meet the difficulty target? To do that, miners add a nonce to the block, which stands for
number used once (see Figure 1-11).
14
Chapter 1 Understanding Blockchain
Figure 1-11. Adding a nonce to change the content of the block in order to meet
the network difficulty target
The first miner who meets the target gets to claim the rewards and adds the block to
the blockchain. It will broadcast the block to other nodes so that they can verify the claim
and stop working on their current work of mining their own blocks. The miners would
drop their current work, and the process of mining a new block starts all over again.
The transactions that were not included in the block that was successfully mined will be
added to the next block to be mined.
In the case of Bitcoin, the block reward initially was 50 BTC and will halve every 210,000
blocks. At the time of writing, the block reward is currently at 12.5 BTC, and it will eventually
be reduced to 0 after 64 halving events. For Ethereum, the reward for mining a block is
currently 2 ETH (Ether).
15
Chapter 1 Understanding Blockchain
For Bitcoin, the network adjusts the difficulty of the puzzles so that a new block is being mined
roughly every 10 minutes. For Ethereum, a block is mined approximately every 14 seconds.
Proof of Work
The process in which blocks are mined and added to the blockchain is known as the
Proof of Work (PoW). It is difficult to produce the proof but very easy to validate. A good
example of Proof of Work is cracking a combination lock – it takes a lot of time to find the
right combination, but it is easy to verify once the combination is found.
Proof of Work uses tremendous computing resources – GPUs are required, while
CPU speed is not important. It also uses a lot of electricity, because miners are doing the
same work repeatedly – find the nonce to meet the network difficulty for the block.
A common question is why you need to use a powerful GPU instead of CPU for
mining? Well, as a simple comparison, a CPU core can execute 4 32-bit instructions per
clock, whereas a GPU like the Radeon HD 5970 can execute 3200 32-bit instructions per
clock. In short, the CPU excels at doing complex manipulations to a small set of data,
whereas the GPU excels at doing simple manipulations to a large set of data. And since
mining is all about performing hashing and finding the nonce, it is a highly repetitive
task, something that GPU excels in.
Tip When a miner has successfully mined a block, he earns mining fees as well
as transaction fees. That’s what keeps miners motivated to invest in mining rigs
and keep them running 24/7, thereby incurring substantial electricity bills.
Immutability of Blockchains
In a blockchain, each block is chained to its previous block through the use of a
cryptographic hash. A block’s identity changes if the parent’s identity changes. This in
turn causes the current block’s children to change, which affects the grandchildren, and
so on. A change to a block forces a recalculation of all subsequent blocks, which requires
enormous computation power. This makes the blockchain immutable, a key feature of
cryptocurrencies like Bitcoin and Ethereum.
16
Chapter 1 Understanding Blockchain
Tip In general, once a block has six or more confirmations, it’s deemed infeasible
for it to be reversed. Therefore, the data stored in the blockchain is immutable.
• A block header
17
Chapter 1 Understanding Blockchain
• Timestamp
• Merkle root
• Nonce
Figure 1-13. A block contains the block header, which in turns contains the
Merkle root of the transactions
18
Chapter 1 Understanding Blockchain
T ypes of Nodes
Before we address the rationale for storing the Merkle root in the block header, we need
to talk about the types of nodes in a blockchain network. Figure 1-14 shows the different
types of nodes in a blockchain network.
Tip Note that full nodes are not necessarily mining nodes. However, mining
nodes need to be a full node.
The purpose of a full node is to ensure the integrity of the blockchain and people
running full nodes do not get rewards. On the other hand, mining nodes are rewarded
when they add a block to the blockchain.
19
Chapter 1 Understanding Blockchain
And so, we can summarize the types of nodes that we have discussed thus far:
• Full node
• Visit the following sites to see the current number of full nodes for
the following blockchains:
• Bitcoin – https://bitnodes.earn.com
• Ethereum – www.ethernodes.org/network/1
20
Exploring the Variety of Random
Documents with Different Content
through a tragedy, on one occasion, which he found “tragicall”
indeed, because there was no time to have any supper. And then,
but six months after Wentworth’s arrival, there came the first hint of
the trouble about Lady Cork’s black marble tomb in St Patrick’s.
Mr. Bagwell has pointed out[31] how, to the old Elizabethan, whose
“Protestantism was not of the Laudian type,” there was nothing
amiss in the fact of a Communion-table standing detached in the
middle of the Church. The Earl, in erecting his monument, had
indeed improved the Chancel of St. Patrick’s, which had been
earthen-floored, and often in wet weather “overflown.” He had
raised it, with three stone steps and a pavement of hewn stones,
“whereon,” the Earl wrote to Laud, “the communion-table now
stands very dry and gracefully.” Laud himself had found it hard to
interfere, in the face of general opinion supported by two
Archbishops.[32] But Wentworth was obdurate, and the King himself
was appealed to. It was considered a scandal that the Cork tomb
should remain “sett in the place where the high altar anciently
stood.”[33] In the end, the great black marble monument was taken
down, stone by stone; and in March 1635 Wentworth was able to
write to Laud: “The Earl of Cork’s tomb is now quite removed. How
he means to dispose of it I know not; but up it is put in boxes, as if
it were marchpanes or banqueting stuffs, going down to the
christening of my young master in the country.”
The reference to “my young master” is evidently to Lady Kildare’s
baby, whose birth—and the fact that it was a boy—was the event of
the moment in the Cork household: indeed, the old Earl had a bet on
with Sir James Erskine, on the subject. In November 1635 the tomb
had been re-erected where it now stands, in the south side of the
Choir, and outwardly, at least, after a long struggle, the matter was
ended. Lord Cork knew nothing of that sneer in Wentworth’s letter to
Laud about the marchpanes and the banqueting stuffs; and when
Wentworth arrived at the Earl’s house one evening in December
1635—he was rather fond of dropping in unexpectedly—and joined
the Earl and his family at supper, the diary records that the Lord
Deputy “very nobly and neighbourlyke satt down and took part of
my super without any addicon.” But between July 1633 and that
December evening of 1635, many things had happened in the Cork
family.
The captain of the Ninth Whelp had been obliged to report that
Lewis, my Lord Kynalmeaky, had run badly into debt at Bristol.
Dungarvan had been recalled, and sent to England with his tutor,
about “thaffair” of his marriage with Mrs. Elizabeth Clifford. George
Goring had been assisted with money to buy a troop of horse; and
“our colonel”—and poor Lettice after him—had sailed for the
Netherlands, and soon settled at The Hague. Little Peggie, her
prospective jointure and husband provided, had been put
meanwhile, with Mary, under the care of Sir Randall and Lady
Clayton at Cork; and Mr. Perkins, the London tailor, had sent the Earl
his new Parliament robes of brocaded satin and cloth of gold.
Dorothy Loftus’s first baby had been born at Rathfarnham, and
Katherine Jones’s first baby at Athlone Castle. Both were girls;
hence, that wager of the Earl’s that his daughter Kildare’s next baby
would be a boy. The Earl of Kildare, with his dice and cards, had
been causing everybody anxiety; and there was a quarrel about
family property going on between the Digby and Offaley family and
the “Faerie Earle.” Wentworth had interfered, and in the autumn of
1634 Kildare, having taking offence, had “stolen privately on
shipboard,” leaving his wife and children and a household of about
sixty persons “without means or monies.” The delinquent was very
soon to come home again; but late in 1634 the old Earl had broken
up the Kildare establishment and settled his daughter and her
children in his own newly built house at Maynooth, riding there with
her, and dining with her “for the first time in the new parlour”, and
sending her two fat oxen “to begin her housekeeping there.”
Dick, “my Lord Dungarvan,” on the other hand, had been proving
himself a very satisfactory son: not very clever, perhaps, but
eminently good-natured and sensible. He had acquitted himself
admirably in England, writing comfortable letters to his father, who
was much gratified to hear that his boy had taken part in the Royal
Masque. It must have been the great Royal Masque in Whitehall, on
Shrove Tuesday night, February 18th, 1634: the Cælum Britannicum,
which followed on the still greater Masque of the Inns of Court. The
words were by the poet Carew, the music by Henry Lawes, who had
set Milton’s Comus; and the scenery was by Inigo Jones. The King
himself and fourteen of his chief nobles were the Masquers, and the
juvenile parts were taken by ten young lords and noblemen’s sons.
No wonder that the old Earl was proud of “Dick”.
And Dungarvan had made such good progress with his wooing
that in July a pretty little letter, neatly wax-sealed on floss-silk, had
come to the Earl of Cork, beginning: “My Lord,—Now I have the
honour to be your daughter.” In September 1634 the indefatigable
Ninth Whelp brought Dungarvan and his bride to Ireland. The Earl
met them at their landing, and drove them back in triumph—three
coaches full—to his town house in Dublin. All the available members
of the family, little Robert Boyle included, were gathered to welcome
the new sister-in-law. It was a great alliance, in which Wentworth
himself, by marriage a kinsman of the Cliffords, had lent a hand. For
the time being, it was to draw the Lord Deputy into the circle of the
Earl’s family, though the personal relations between the Deputy and
the Earl were to become even more strained.
CHAPTER III
SCHOOLDAYS AT ETON
“Where the Provost at that time was Sir Henry Wotton, a person that was not
only a fine gentleman himself, but very well skilled in the art of making others
so.”—Robert Boyle’s Philaretus.
After the boys went to Eton, the Earl had very unpleasant things
to think about. Wentworth was pressing him hard. It is true that the
little dinner-parties and card-parties and private theatricals at the
Castle were going on as if there were no Star Chamber behind them.
In January 1636 the Lord Deputy was inviting himself to supper at
the Earl’s Dublin house, and bringing Lady Wentworth with him.
Lady Dungarvan’s baby was born in March, a “ffair daughter”, to be
christened Frances, and to figure in the old Earl’s diary as “lyttle
ffranck”; and the Lord Deputy himself stood sponsor, though he had
just lost his own little son, and the Dungarvan christening had been
postponed till the Wentworth baby had been buried. But the Lord
Deputy’s “sharp pursuit” of men was going on all the same. In
February, before the death of Wentworth’s child and the Dungarvan
christening, Lord Mountmorris had been degraded from the office of
Vice-Treasurer, “tried by a Commission and sentenced to be shot, for
no other crime than a sneer” against Wentworth’s government.[50]
The sentence was not to be carried out; but it became every day
more evident that “whatever man of whatever rank” opposed
Wentworth, or even spoke disrespectfully of his policy, “that man he
pursued to punishment like a sleuth-hound”.[51]
At the beginning of that year, the Earl of Cork had made his “Great
Conveighance,” by which he entailed all his lands upon his five sons.
Wentworth had taken exception to the conveyance of some of these
lands to the Earl’s eldest son, Lord Dungarvan; and in February a
“sharp and large discourse” had taken place between the Lord
Deputy and the Earl. In April the Star Chamber Bill against the Earl,
dealing with his titles to the churchlands of Youghal, was still under
discussion; and Wentworth was now pressing for the payment of
money, by way of ransom, which was at first to be £30,000, but was
afterwards reduced to £15,000.
The Earl was still asserting his right to his lands, and unwilling to
compound—no-one had ever heard the Earl of Cork, he said,
“enclyned to offer anything.” Things were at this pass when at the
end of April Lady Dungarvan, six weeks after her baby’s birth, fell
sick; and the next day, “the smallpockes brake owt uppon her.” On
that very day, under pressure from his friends and from his son
Dungarvan, who went down on his knees before his father, the Earl
of Cork gave way. Very unwillingly, on May 2, he agreed to pay the
£15,000 “for the King’s use,” and for his own “redemption out of
Court”—though his “Innocencie and Intigritie” he declared, writing in
his own private diary, were “as cleer as the son at high noon.” The
old Royalist, even then, believed that if his King only knew how
undeservedly the mighty fine had him imposed, “he would not
accept a penny of it.” The Earl was hard hit, though his great
Conveyance was at last signed and sealed, and he could talk of
drinking a cup of sack “to wash away the care of a big debt.”[52] It is
comforting to note that he had meantime cash in hand not only to
tip Archie Armstrong, the King’s Jester, who seems to have passed
through Dublin, but to pay for two knitted silk waistcoats for his own
“somer wearings.”
While all this was going on, Kynalmeaky and Broghill were
enjoying what the Earl called their “peregrination.” A tutor had been
found to accompany them on their foreign travels; a M. Marcombes,
highly recommended to the Earl by Sir Henry Wotton, as a man
“borne for your purpose.” Sir Henry wrote from London, where he
had been spending a week or two, and was returning next day “to
my poore Cell agayne at Eton”;[53] but he gave the Earl a careful
account of Marcombes, whom he had seen in London. He was “by
birthe French; native in the Province of Auvergne; bredd seaven
years in Geneve, verie sounde in Religion, and well conversant with
Religious Men. Furnished with good literature and languages,
espetially with Italian, which he speaketh as promptly as his owne.
And wilbe a good guide for your Sonns in that delicat Piece of the
Worlde. He seemeth of himself neither of a lumpish nor of a light
composition, but of a well-fixed meane.”
M. Marcombes had already won golden opinions in the family of
Lord Middlesex, a former Lord Mayor of London; and was well
known to the then Lord Mayor, Mr. Burlamachy, who also wrote to
the Earl about him. And Mr. Perkins, the tailor, seems to have put in
a word; for there had been a meeting in the “fumie citie” between
Sir Henry Wotton and M. Marcombes and Mr. Perkins, at which Sir
Henry had found the French tutor’s conversation “very apposite and
sweet.”
So in the early spring of 1636 Kynalmeaky and Broghill, with their
governor M. Marcombes, had set out from Dublin on their foreign
travels, stopping long enough in London to kiss the King’s and
Queen’s hands, and obtain the royal licence and passport to travel;
and they took letters also to Sir Henry Wotton at Eton, and to Frank
and Robyn, and poor unmeriting Carew.
The Earl of Cork himself, in the early stages of his struggle with
Wentworth, had thought of going to London, to “justify himself”
once again, as he had done when he was a young man, and
Elizabeth was Queen. But he was no longer a young man, and
Charles I was not Queen Elizabeth, and the Lord Deputy, when he
found it out, had objected strongly to the Earl’s little plan. On the
contrary, the Lord Deputy had gone to England himself, in the
summer of 1636; and though Sir Henry Wotton was under “a kind of
hovering conceypt” that the Earl of Cork was coming over, and there
was even a rumour that he was to be offered the Lord
Chancellorship of England, the old Earl was to remain for two more
years in Ireland. He was busy as usual, moving about, on assize and
other duties, between Dublin and Lismore and Cork; paving the
terrace at Lismore with hewn stones, dedicating the free schools and
almshouses there, setting up an old servant in Dublin in a “tobacko”
business, and paying Mr. Perkins’s bill for those little scarlet suits and
cloth-of-silver doublets that Frank and Robyn were wearing in their
Whitsuntide holidays. Sir Henry Wotton was able to tell the Earl that
Lady Lettice would see Frank in better health and strength than he
had been in either kingdom before, while Robert would “entertayne
her with his pretie conceptions, now a greate deale more smoothely
than he was wonte.”
The Earl had not given up his English project; on the contrary, it
was to mature into the purchase of a little bit of England for his very
own; and his choice had fallen on a “capitall howse, demesne, and
lands” in Dorsetshire. Accordingly in the autumn of 1636 he bought
the Manor of Stalbridge, and sent over a steward, Thomas Cross, to
take possession. At Stalbridge the Earl would be a near neighbour of
the Earl of Bristol—his son-in-law Digby’s uncle—at Sherborne
Castle.
The year 1636 had been a trying year; and one of the first
expenses in the New Year 1637 was a fee to Mr. Jacob Longe, of
Kinsale, “my Jerman physician,” for plaisters and prescriptions, “to
stay the encrease of the dead palsy which hath seized uppon all the
right side of my boddy (God helpe me) £5.” And though the returns
for the year shewed a “Lardge Revenew,” and the diary record for
the year ended in a note of triumph, with a triple “Amen, Amen,
Amen,” there was yet sorrow in store that no revenue, however
large, could avert. For Peggie, the Earl’s youngest daughter, was ill.
The Earl had paid £5 to Mr. Higgins, the Lismore doctor, to give her
“phisick, which he never did”; and either because of this, or in spite
of this, Little Peggie did not get well. She died in June 1637, in Lady
Clayton’s house in Cork, where she and Mary had lived all this time
together. The Lady Margaret Boyle, youngest daughter of the Earl of
Cork—eight years old when she died—was buried in the family tomb
at Youghal.
It was not till Midsummer 1638, when the last instalment of the
mighty fine had been paid, that the Earl began his preparations for a
prolonged visit to England. He revoked all other wills, and again
made a last will and testament; and at the end of July he actually
set out for England, taking with him his daughter Mary, Lord and
Lady Barrymore, and several of the grandchildren.
The parting was a sad one between Mary Boyle and Lady Clayton,
who had just lost her husband, and, a childless woman herself, had
been a real mother to “Moll” and “Peggie.” But the Earl had a grand
marriage in view for his daughter Mary; and he had yet to discover
that Lady Mary had a will of her own: that of all his daughters it was
she who had inherited his own indomitable pride. Hitherto, she had
been a child, brought up away from him; to be gladdened from time
to time by a happy visit or a New Year’s gift. But even these are
indications of the little lady’s tastes and character. It was to Mary the
Earl gave the “ffether of diamonds and rubies that was my wive’s,”
long before he could have known how defiantly she would toss that
little head of hers. She must have been a fair horsewoman already
at nine years old; for it was to her that the Earl sent the dead
mother’s saddle and saddle-cloth of green velvet, laced and fringed
with silver and green silk; and it is certain she inherited the Earl’s
love of fine dressing, from the choice of various small gowns of
figured satins and rich stuffs of scarlet dye. Of even more
significance is the old Earl’s gift of Sir Philip Sidney’s Arcadia, “To my
daughter, Mary Boyle,” when this imperious young creature was only
twelve years old. Do little girls of twelve read Sir Philip Sidney’s
Arcadia to-day? There was to come a moment when, if the Earl had
ever read it himself, he must have heard in “Moll’s” voice, as she
answered him, some echo of Sidney’s teaching—
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebooknice.com