Saturday, October 29, 2016

Replika

Watch out for Replika.
"When we tested it recently with 1,000 people, the average user sent 46 messages a day to their personal bots to train them. By comparison, an average U.S. smartphone user age 18 to 34 sends about 50 texts a day in total.

We ran out of training conversations. We hope to be able to release it as a free standalone app sometime in the next few months."
The website.

I already wrote a post about this.

---

Update: I have now registered with Replika. They ask you to nominate a name for your 'replika'.

I asked Clare, "If I hadn't have been called Nigel, what would have been the best choice of name for me?"

She replied sardonically, "Bede, as in 'The Venerable Bede'."

So Bede it is.

Friday, October 28, 2016

Death's End (The Three-Body Problem) - Liu Cixin

In "The Three-Body Problem" we were introduced to the Trisolarans, the highly-advanced inhabitants of the Alpha Centauri system who had designs upon the Earth.


Amazon link

I wrote about it here.

The second volume, "The Dark Forest", posed the problem: how can you defend yourself against an incoming alien invasion force of overwhelming technical superiority with perfect intelligence of your every move, but one which will not arrive for hundreds of years. Here is my fan-review.

Amazon link

Amazingly, Liu Cixin finds a way, but one which is dangerously unstable.

Now the final volume has been released, "Death's End". To those who were wondering how Liu Cixin would surpass volume two, I'm pleased to confirm that he has shifted up to the whole universe, if not the metaverse. Yes, big ideas in science-fiction are back!

Amazon Link

The author's characters exemplify moral choices, as in a mediaeval Morality play.

As a purist, I'm a little irritated by the scientific faux pas, including  the classic seeing incoming entities travelling at the speed of light before they arrive, and the idea that a spherical space station with spin-induced internal 'gravity' has a 'gravity' vector everywhere normal to its surface ('the skyscrapers near the spin axis experienced reduced gravity as their spires rose like needles towards the light at the centre of the sphere').

Perhaps we can blame the translator?

'Death's End' (in line with current Chinese views) satirises Western Europe's 'decadent, feminised welfare state model' as incapable of taking tough decisions. This, along with his explicit gender roles, has earned him the wrath of at least one American academic who wants literature to function as agitprop.

If you like intelligent, classic pulp-SF with a Chinese cultural spin you need to get this trilogy.

Wednesday, October 26, 2016

The Alpha Centauri party in May 2028

"Were you planning to stay around until 2028?"

"I'd be 77. Why, something worth waiting for?"

"The star Alpha Centauri A, you know, the one which is 4 light years from Earth and maybe has planets, will be coming in front of a distant red giant star. It will act as a microlens, flaring the red giant into an Einstein ring."

"Sounds pretty. What's the red star?

"It's called 2MASS 14392160-6049528 but they seem to have named it S5 for short. It's roughly 10,000 light years away."

"And the possible Centauri planets?"

"Microlensing again. Planetary effects will be discernable as fluctuations in the extended image of the red giant."



An enlargement of the conjunction that will occurs in 2028, with the Einstein ring
caused by Alpha Cen A represented in cyan color. Credit: Pierre Kervella.

There are currently no reported planets around Alpha Centauri A. There is a suspected planet in tight orbit around its close binary partner, Alpha Centauri B.

Meanwhile there is better evidence of a planet around the more distant (from A/B) Alpha Centauri C, better known as Proxima - the nearest extrasolar star to Earth.

The Proxima planet, "lies in the habitable zone of Proxima Centauri, but it is possible that the planet is tidally locked to the star," It's a possible target for the super-laser-powered  Breakthrough Starshot initiative to send interstellar nanocraft to Alpha Centauri within the next fifty years.

---

Something no-one discussed. If we wanted (for some reason) to communicate with the red giant star S5, the Centauri microlensing event would be the perfect way to do it via communications amplification through gravitational lensing.

The only problem is that we'd need to fire up the lasers in 2019 - and they won't be ready.

---

Hat tip Centauri Dreams.

Tuesday, October 25, 2016

"Start lifting weights to fight onset of dementia"

From The Times today:
"People with mild memory loss should start lifting weights to help stave off dementia, a study suggests.

"Researchers have found that building up muscle strength helps to improve brain function in adults over the age of 55 with mild cognitive impairment (MCI).

"People with MCI have a slight but noticeable decline in memory, reasoning and thinking skills and are more likely to develop Alzheimer’s and others forms of dementia.

"Between 5 and 10 per cent of over-65s in Britain are thought to have the condition and up to 15 per cent of these will develop dementia."
I thought at first this might be a typical confounding of correlation with causation - that in reality, people who go to all the effort of weight training are simply a little smarter and more conscientious than their more demented brethren. But no:
"The study published in the Journal of American Geriatrics measured the effect of different exercise programmes on the brain of 100 people aged 55 to 86 with MCI. It found that those who took part in twice-weekly weight-training sessions for six months, in which they were made to work to at least 80 per cent of their peak strength, had significantly improved brain function."
OK, so they measured it.
"Yorgi Mavros, a research associate at the University of Sydney in Australia, and lead author of the study, said: “What we found is that the improvement in cognition function was related to their muscle strength gains. The stronger people became, the greater the benefit for their brain.

“The more we can get people doing resistance training like weightlifting, the more likely we are to have a healthier ageing population. The key, however, is to make sure you are doing it frequently, at least twice a week, and at a high intensity so that you are maximising your strength gains. This will give the maximum benefit for your brain.”

The findings reinforce research from a trial this year in which MRI scans showed an increase in the size of areas of the brain among those who took part in a weight-training programme. The brain changes were linked to the cognitive improvements after weight lifting.

Maria Fiatarone Singh, a geriatrician at the University of Sydney and the co-author of the study, said: “The next step now is to determine if the increases in muscle strength are also related to increases in brain size that we saw."

Clare has taken it all on board with her new 1kg "beauty bells".




So far, it all seems to be working, as far as I can tell.

Sunday, October 23, 2016

Languages which mess with your head

Ian Watson now languishes in Spanish obscurity. He wrote, however, some wonderful science-fiction including the unsettling "The Embedding".


Extract from this review.
"The novel opens in a British research institute, where the linguist Chris Sole teaches a rare form of language to four children living in an artificial environment. The language is English, but grammatically restructured by a computer: an English "auto-embedded" that no person regularly socialized can speak. The aim of the experiment is to discover if the grammar is inherent in the human brain, or if you can train individuals to think in more complex grammars, which would open new possibilities for the mind."
Here's an example of the auto-embedded language: 'This is the malt that the rat that the cat that the dog worried killed ate.' A computer system translates the researchers' conversation into this embedded form and plays it to the children - so this is the grammatical form in which they are forced to acquire language. On the assumption the brain is plastic enough that this could happen.
"Meanwhile, in Brazil, a friend of Chris Sole is studying an Indian tribe known as xemahoa. A flood threatens the territory of the xemahoa because of a large dam built by the Brazilian military government with the financial and technical assistance from the United States. Anthropologist Pierre Darriand is proud to have discovered that xemahoa speak two kinds of language: everyday language and a second language, rhapsodic, employed under the influence of a drug. This "xemahoa B" is a language "autoembedded" with a seemingly incomprehensible syntax, very similar to the artificial language Sole teaches the four children in England.

"A third element appears in the story. An alien spaceship arrives, and Chris Sole is sent to the United States to try to communicate with the occupants of the ship. The aliens call themselves sp'thra and learn English very quickly. Sole discovers that languages ​​are its main concern: they want to exchange technology for live human brains, "programmed" to speak different languages ​​on Earth and grow greatly excited by the discoveries of Pierre Darriand in the Amazon basin and ask for some live xemahoa brains."
It does not end well.

---

There is a category of programming languages which are intentionally beyond difficult. They are know as esoteric programming languages (sometimes shortened to esolangs).

The class includes the mellifluously-named 'brainf**k' but my favourite is Malbolge, invented by Ben Olmstead in 1998 and named after the eighth circle of hell in Dante's Inferno.
"Malbolge was specifically designed to be almost impossible to use, via a counter-intuitive 'crazy operation', base-three arithmetic, and self-altering code." *
In fact the author of Malbolge was unable himself to write a program in it.

In the end it required an AI system to write the first program, using a form of 'best-first' search in the space of all possible programs.

Here is the "Hello World!" program in Malbolge.

 (=<`#9]~6ZY32Vx/4Rs+0No-&Jk)"Fh}|Bcy?`=*z]Kw%oG4UUS0/@-ejc(:'8dc

Don't ask!

---

* Malbolge design trivia.
After each instruction is executed, the guilty instruction gets encrypted so that it won't do the same thing next time, unless a jump just happened. Right after a jump, Malbolge will encrypt the innocent instruction just prior to the one it jumped to instead.
And here's a picture of one of the denizens of the Malbolge.


Seems like a typical programmer to me ..

Friday, October 21, 2016

A deep dive into Pi

1. Contact



In 1985, Carl Sagan wrote a liberal-utopian novel called 'Contact'. Ellie (Jodie Foster in the film) traverses a wormhole where she meets wise, benevolent aliens. Returning to Earth there is a wormhole malfunction, all records are erased and she is not believed.

A discredited and broken women, she holes up in an apartment, recalling the confirmatory information she received from the alien,
"Ellie works on a program to compute the digits of π to heretofore-unprecedented lengths. [...] When Ellie looks at what the computer has found, she sees a circle rasterized from 0s and 1s that appear after 1020 places in the base 11 representation of π. This gives her a way to convince the world of something greater—that intelligence is built into the universe itself."
When I read this my suspension of disbelief collapsed entirely. As a matter of mathematics, the value of π is fixed, it's not a variable which can be programmed by any passing alien!

I was right .. but also wrong.

---

2. Dystopias

I prefer my alien first-contacts to be more dystopian:

  1. His Master's Voice
  2. The Mote in God's Eye
  3. The Three-Body Problem (The Dark Forest)
---

3. How Deep to Dive?

Suppose you have a conventional six-sided die. On average, how many trials do you need to throw a three (or any other number)?

The answer is six.

If you have any sequence of trials where the probability of success per trial is p (1/6 in the die example) then on average you need 1/p trials to get the first success.

This is not entirely obvious.

Take a coin. Keep tossing it. How many throws on average before you get a head? Here are some possible sequences: H, TH, TTH, TTTH, and so on. The longer sequences have lower probability. On average you need two throws - one divided by a half.

The number of trials is a random variable and its distribution is called the Geometric distribution.*

As apparently a normal number, the decimal representation of π is believed to have the features of a random sequence. We imagine producing the digit-sequence of π from the set {0, .., 9} essentially by choosing at random - there is no systematic pattern.

If we consider any particular digit, for example 7, 'on average' how deep do we need to search to find it in the π-sequence?

The probability of a digit of π being 7 is 1/10 so 'on average' we should expect to search down 10 digits before finding a 7.

Here are the first fifty digits of π. We start counting after the decimal point.

3. 14159 26535 89793 23846 26433 83279 50288 41971 69399 3751

And here are the depths of the different digits

0 -> 32  1 -> 1  2 -> 6  3 -> 9  4 -> 2

5 -> 4  6 -> 7  7 -> 13  8 -> 11  9 -> 5

Average = 9 deep.

Suppose we want to find a longer digit sequence in π. For example, 42. On average, how deep do we need to dive? Here's how to think about it. The probability of a digit at a given location in π being 4 is 1/10, but then the next digit, 2, also needs to match. So the combined probability of a two-digit match at any point in π is 1/100. So on average we need to search to a depth of 100 digits.

Here's the interesting site I'm using - The Pi-Search Page - and it tells me that:
"The string 42 occurs at position 92. This string occurs 2 000 419 times in the first 200M digits of Pi counting from the first digit after the decimal point. The 3. is not counted."
For three digits, you would expect to search 1,000 digits of π deep. The Pi-Search Page lets you search to 200 million digits of π, which is ~ 108, so strings of eight digits then.

You can have a lot of fun searching for meaningful numbers buried deep within π. Take a naive coding where a=1, b=2, c=3, ..., z=26. Then

Clare = 3 12 1 18 5:
"The string 3121185 occurs at position 1 785 482. This string occurs 21 times in the first 200M digits of Pi"
Nigel = 14 9 7 5 12:
"The string 1497512 occurs at position 21 024 008. This string occurs 24 times in the first 200M digits of Pi."
My wife and myself each get our names encoded in 7 digits so we would expect an average search depth in π of around 10 million. We both kind of straddle that depth (see note at end).

Enough of this vanity! People tend to put in their birthdates (ddmmyy = one million depth) but be aware, web sites and apps allow this to be reverse-engineered.

---

4 Circles in π

Let's take the simplest possible raster image of a circle. Each pixel is white (0) or black (1) and we have three rows of three bits. This can be written 010 101 010 or in octal, 252.



As we have three digits which we choose to interpret as base 10, how deep should we expect to look in π for this sequence, this three bit by three bit raster of a circle?

Obviously 1,000 digits.

Back to the Pi-Search Page.
"The string 252 occurs at position 822. This string occurs 200 446 times in the first 200M digits of Pi."
OK, the aliens have spoken - the circle is there. They truly exist. I was wrong.

This is a pretty pathetic circle, though. In 'Contact' it was described as 'a circle rasterized from 0s and 1s that appear after 1020 places in the base 11 representation of π'.

Let's handwave here a little. Assume that in base 10 this might be 1021 or thereabouts decimal digits. How long was the raster sequence to be found at such a depth? Around 21 decimal digits (which we could interpret as octal without too much effort). Multiple by three to get bits and we have 63-64 bits encoding the raster sequence.

So Ellie (Jodie Foster) gets to see an 8-bit by 8-bit picture of a circle. I think that would look very pretty and would definitely convince me that aliens (or God) exists.

By a suitable encoding any information can be mapped into a decimal digit string. If the length of the string is n digits, then on average we have to search to a depth of 10n digits in π to find said string.

But with probability 1 it's in there somewhere (.. it is generally believed but there is no proof!).

---

5. Searching π on your own device

I thought for one self-indulgent moment that it would be cute to write a program in Prolog (weird choice!) to compute π to zillions of digits and search for longer and more interesting digit-sequences. I even researched it a bit.

But it's all been done.

I downloaded the 'RealPi Benchmark' app onto my Nexus 10 and it computed ten million digits of π in about five minutes - which I was then able to search.

*Humbled*

---

* Statistics Note

The variance of the Geometric distribution is (1-p)/p2.

For the long digit strings we have been considering, p is very small so (1-p)/p2 is approximately 1/p2, and the standard deviation is just 1/p which is the same as the mean.

So revisiting the depth of Clare's and my names above, (7 digits), the mean number of trials to find our codes was ten million, and the standard deviation was also 10 million. So a +/- confidence interval of 1 std. dev. would be from zero to twenty million. Quite wide, but consistent with the values we actually saw.

I think that's why the Pi-Search Page computes 200 million digits of π.

Wednesday, October 19, 2016

The Book of the Way and its Power

This post is for J. and A. on their special day.

---

The word Tao means 'way' or 'path'. For a reductive materialist it could be identified with the spacetime block-universe. But this fails to capture the relationship of the Tao to agency as well as physics.

Te means 'power', not in the sense of a fifth-generation fighter aircraft, but in the old-fashioned sense of 'virtue'.

Ching means 'classic', or 'canon' or 'book': an authoritative statement.

People argue about the best translation of the Tao Te Ching. Perhaps the most accessible is that due to Ursula K. Le Guin, the most prominent contemporary Taoist in the philosophical tradition. I like many of her chapters (see below) which render Lao Tzu's thoughts into a contemporary idiom.

But there's always the danger of over-processing. My real favourite is Arthur Waley's peerless text, which presents the Taoist work in its original cultural setting, allowing the reader space to engage and to seek the relevance in his or her own situation

Amazon link

Amazon link

To oxymoronically take a chapter almost at random. Here's Ursula Le Guin's Chapter 16.
Be completely empty.
Be perfectly serene.
The ten thousand things arise together;
in their arising is their return.
Now they flower,
and flowering sink homeward,
returning to the root.
The return to the root
is peace.
Peace: to accept what must be,
to know what endures.
In that knowledge is wisdom.
Without it, ruin, disorder.
To know what endures
is to be openhearted,
magnanimous,
regal,
blessed,
following the Tao,
the way that endures forever.
The body comes to its ending,
but there is nothing to fear.
In her note she comments, "To those who will not admit morality without a deity to validate it, or spirituality of which man is not the measure, the firmness of Lao Tzu's morality and the sweetness of his spiritual counsel must seem incomprehensible, or illegitimate, or very troubling indeed."

And here is how Arthur Waley translates the same chapter 16.
Push far enough towards the Void,
Hold fast enough to Quietness,
And of the ten thousand things none but can be worked on by you.
I have beheld them, whither they go back.
See, all things howsoever they flourish
Return to the root from which they grew.
This return to the root is called Quietness;
Quietness is called submission to Fate;
What has submitted to Fate has become part of the always-so.
To know the always-so is to be Illumined;
Not to know it, means to go blindly to disaster.
He who knows the always-so has room in him for everything;
He who has room in him for everything is without prejudice.
To be without prejudice is to be kingly;
To be kingly is to be of heaven;
To be of heaven is to be in Tao.
Tao is forever and he that possesses it,
Though his body ceases, is not destroyed.
So there you are: two interpretations of the same 2,400 year old text.

The Tao Te Ching, with its 81 chapters, is mystical and allusive. It's easy to let the eyes glaze over the stanzas which seem to require too much intellectual hard work.

A hard core materialist, who believes we - along with the other 'ten thousand things' - are 'just atoms' may simply walk away. I am basically just such a materialist, but learned long ago that the map is not the territory, and that an effective theory of agency and consciousness is not identical to being an agent and experiencing consciousness.

It's only when you examine your own self, abstracting a little from the busy personas of everyday role-playing, that the moral framework of the Tao Te Ching comes into focus. It's not for everyone, and it's not for every day. Sometimes, though, you should lift your head up if you can and try to engage with the biggest picture.

Cheng Man-Ch'ing used to say that Taoism was for the sage on his mountain, not for practical folk. But then, he was a Confucian.

---

Here's a short link to this post: https://goo.gl/X2Rd7q using the Google URL shortener.

Tuesday, October 18, 2016

“The Business Blockchain” by William Mougayar

Amazon link

Bitcoin emerged on the scene in 2009, the first digital currency to achieve lift-off. Satoshi Nakamoto's brilliant innovation was to make the transaction the central concept. The Blockchain is a complete record of every Bitcoin transaction ever carried out. The wallet containing ‘your Bitcoins’ is a secondary construct, computed from scanning the public Blockchain on the Internet and adding up all the ‘unspent transaction outputs’ which have one of your Bitcoin addresses as a recipient.

The Blockchain is public, duplicated on all full Bitcoin nodes (i.e. computers), and the transactions, organised in blocks, are unencrypted. Yet transactions are still sufficiently secure and anonymous – the architecture and protocol design to accomplish this is both complex and amazing. It soon occurred to people that the Blockchain concept could be repurposed to support other services across the public Internet: the management of contracts, the administration of digital identity, healthcare records.

Just as the public Internet spawned private Intranets and business-ecosystem Extranets, Blockchain technology has begun to interest companies looking to exploit a robust, decentralised ‘smart database’ function internally, or with their customers/suppliers. We are in the earliest days of this new network technology and many, even basic, questions of architecture, design, implementation and operation are deeply unclear. It’s timely then, to have a book explaining the ‘Business Blockchain’.

Chapter 1 of William Mougayar’s book aims to explain what the Blockchain is all about. He uses a great many metaphors intermixed with appropriate tech buzz-words, but I don’t think the reader will be much the wiser after reading it. Saying endlessly that the Blockchain is like a decentralised database, like a shared accounting ledger, like a transaction platform, it’s a peer-to-peer network and a trust services layer is all sort of true, but leaves the reader ignorant as to how the Blockchain manages to accomplish all these marvels. It was at this point, I decided to read Andreas M. Antonopoulos's excellent “Mastering Bitcoin: Unlocking Digital Cryptocurrencies” which made everything a lot clearer (the book is accessible to non-developers).

Chapter 2 focuses on the Blockchain’s role in distributing trust. In Bitcoin, trust is about ensuring that someone who pays you has a right to the Bitcoin they’re sending you, and that they can’t spend that amount twice. There are specific mechanisms involving digital certificates and the Blockchain mining protocols (producing ‘confirmations’) which implement the trust relationship. The author doesn’t engage with these issues, however. Instead we get lots of cotton wool marketing speak, essentially hand-wavy boosterism for how wonderful the Blockchain model is, leading to further and rather vague excitement about Ethereum-style smart contracts (no details). The ratio of useful-ideas to words-expended is particularly low in this chapter.

Chapter 3 is a simple ‘innovator’s dilemma’ style essay on Blockchain acceptance. We are in the earliest stages of take-up, mostly because Blockchain architectures and implementations are very new and there are plainly many issues in adapting these ideas to other application areas, and up-scaling the platforms. This is entirely normal – most new technologies go through a phase where the technical guys have to link up with the business strategy guys to research possible new solutions. I think I just summarised that chapter.

Chapter 4 is entitled, ‘Blockchain in Financial Services’ and starts with an overview of the Banking and Financial Services industries’ responses to the Internet (less than impressive). There then follows a list of financial services where you could imagine Blockchain technologies having an impact with a few summary examples of exploratory prototypes. Regulation is correctly identified as a major constraint for Blockchain-type architectures. The chapter ends with a little more boosterism, although the truth is that all major financial institutions have already set up task forces to research this area. As before, there is no real content to this chapter.

The short chapter 5 looks at some more far-out examples of Blockchain-powered applications, specifically the ‘Distributed Autonomous Organisation’ (DAO) based on smart contracts and pioneered by Ethereum: again, very hand-wavy and speculative, with no depth.

Chapter 6, ‘Implementing Blockchain technology’, advises your organisation to appoint a “Blockchain Czar” to get things moving, and then lists all the requirements for a successful software project - which would apply to any new development programme: statements of the blindingly obvious, really.

The final chapter, ‘Decentralization as the way forward’, is an unashamedly utopian vision of 2025, when Blockchain-powered, decentralised crypto-services will have transformed the world.

No they won’t.

In summary, this book is superficial boosterism expressed in crass marketing-speak. The reader, far from being enlightened, will end up more confused than ever. My advice is to find a text which explains – in conceptual outline – how the Blockchain (and its main application, Bitcoin) actually works (Wikipedia is not bad). You will then be in a position to assess whether this model has any application for your business. Unless you are a disruptive, entrepreneurial innovator or a company operating in a specialist niche, you will probably correctly conclude that it is too early to tell. Ask the strategy guys to keep an eye on it. And save your money on this book.

Monday, October 17, 2016

Inferno (film, 2016)

Reviews of Inferno have veered between 'excellent' and 'rubbish'. Let me take the median position - it was an OK popcorn movie, hyperkinetic tourism with a ludicrous plot. I looked at my watch twice; Clare said she enjoyed it.


The bad guy, billionaire Bertrand Zobrist,  kicks the film off with a long rant that the only way to save the world from the consequences of rampant overpopulation is to wipe out a large proportion of the human race. Naturally he has a virus which will kill one in every two people infected, and of course triggering this virus is going to involve following a long and tortuous series of clues linked to Dante's Inferno.

I thought Zobrist was given fair space to make his point and his concerns about overpopulation are well-founded  - his solution, not so much.

Sunday, October 16, 2016

The Bitcoin Transaction Process Model

The process of setting up and validating a Bitcoin transaction is complex and seems under-explained in the literature. For what it's worth, here is my own attempt to figure it out.

Some caveats. I have oversimplified, not taking account of transaction fees. I have not tried to be faithful to the syntactic format of a transaction; I'm after maximum conceptual clarity.

As is traditional, Alice is going to pay Bob 12 milliBitcoins, which I estimate today is worth £6.36.

The idea of Bitcoin is that everything is transactions. For Alice to pay Bob, someone else must have already paid her. I'm going to make it real easy and assume Alice has already received a single payment (from someone else) of 12 mBTC - this is called an 'unspent transaction output - UTXO', and she is merely going to 'pass along' that 12 mBTC to Bob.

---


This is how Alice got her 12 milliBitcoins

The transaction I'm calling TX: Pre was set up by someone else to pay Alice 12 mBTC. The payment was to Alice's Bitcoin address, a designator (like a bank account), which was constructed by hashing one of Alice's Public Keys and encoding it into an alphanumeric format (Base58). There are no security issues here, Alice published this Bitcoin address freely to accept payments. It all worked.

---


Alice constructs a transaction to pay Bob 12 mBTC

So TX: A2B (my name for the purposes of this post, not a Bitcoin term) is a new transaction. Alice (Alice's wallet software in fact) first inserts a pointer to TX: Pre, to its location on the public Blockchain - recall this is the source of Alice's 12 mBTC.

Secondly, she combines (most of) the fields in TX: Pre along with Bob's Bitcoin address to produce a hash code. This is then encrypted with her Private Key (corresponding to the already mentioned Public Key) to produce a digital signature. Only Alice can produce this digital signature as only Alice knows her own secret private key.

She then adds Bob's Bitcoin address as the destination, the amount of 12 mBTC to pay, and some other stuff (of course!) and the transaction is now ready to be launched onto the Bitcoin peer-to-peer network. Every node that receives it will check the transaction for validity (there are many checks in fact).

---

How can the Bitcoin network ensure Alice is the only one who can spend that 12 mBTC on prominent public display on the Blockchain as TX: Pre? Note that like all transactions on the Blockchain, TX: Pre is read only and cannot be altered. To do so would constitute a successful attack on the Blockchain - the 'confirmations' mechanism is one way this risk is mitigated.




The transaction validation  process model (carried out by all full nodes) 

A validating node (including Bob, who has perhaps the greatest interest in determining that Alice is legitimately able to pay him) first repeats Alice's hash.

TX: A2B has a pointer to TX: Pre so this can be retrieved from the public Blockchain and concatenated with Bob's Bitcoin address which is stored in the 'output locking script' part of TX: A2B. So these two items of data are hashed.

At the same time, Alice's public key (in the 'input unlocking script' of TX: A2B) is used to decrypt Alice's digital signature, uncovering Alice's original hash. If the two hashes are equal, this proves that Alice originated this transaction.

We finally make sure that Alice's Public Key (which we know to be valid because it unlocked Alice's digital signature) matches Alice's Bitcoin address (the latter is a hash of the former) from TX: Pre. Once this is done we are assured that the Alice who was the recipient of 12 mBTC in TX: Pre is the same Alice as the one who has originated (and signed) TX: A2B.

Bob can breathe a sigh of relief.

Note that formally, the above validation procedure is a concatenation of the 'input unlocking script' from TX: A2B and the 'output locking script' from TX: Pre.

And once TX: A2B has been lodged on the public Blockchain, transaction TX: Pre will be 'chained' to it, so will now be considered 'spent'. No-one else can spend it.

---

If anyone sees an error in this account which is more than just sloppy over-simplification, I'd be grateful if you could put something in the comments and I will fix it.

You may also be interested in my review of "Mastering Bitcoin: Unlocking Digital Cryptocurrencies" by Andreas M. Antonopoulos, and the diagram (from Satoshi Nakamoto's original paper) there.