Blockchain 101 - Part 2 - Public / Private Keys and Signing

Anders Brownworth
29 Dec 201708:53

Summary

TLDRThis video script delves into the mechanics of blockchain, particularly its use in financial transactions. It highlights the issue of unauthorized transaction creation and introduces public-private key pairs as a solution. The script explains how private keys are used to create unique signatures for transactions, ensuring that only the rightful owner can authorize transfers. It demonstrates the process of signing and verifying transactions, emphasizing the security and decentralization of blockchain technology, which allows for the creation of new addresses without a centralized authority.

Takeaways

  • 🔒 Blockchain transactions require a method to ensure that only the owner of the funds can create a transaction, which is where cryptographic protection comes into play.
  • 🔑 Public and private key pairs are fundamental to blockchain security. The private key must be kept secret, while the public key can be shared openly and is derived from the private key.
  • 🛡️ Digital signatures using private keys ensure that transactions are authenticated and cannot be altered without detection. The signature verifies that the person who signed the transaction had access to the corresponding private key.
  • 💻 The process of signing a message or transaction involves creating a unique signature that can be verified by anyone using the sender's public key.
  • 🤔 The inability to derive the private key from the public key is crucial for maintaining security and preventing unauthorized transactions.
  • 💼 In a blockchain, transactions are structured with a 'from' and 'to' public key, and a signature that proves the transaction was initiated by the owner of the 'from' private key.
  • 💡 The integrity of a blockchain is maintained by the fact that any alteration of a transaction's content will invalidate the signature, thus preventing tampering.
  • 🔄 The mining process in blockchain involves adding new blocks to the chain, but miners cannot alter the content of transactions within a block without invalidating the signature.
  • 🆕 Creating a new address in a blockchain does not require a central authority. It can be done by generating a new private key and deriving the corresponding public key.
  • 🌐 The script highlights the decentralized nature of blockchain technology, where transactions are validated across a distributed network without the need for a central entity.
  • 💰 The script also touches upon the financial context of blockchains, mentioning that successful blockchains use a token and operate in a financial context, similar to Bitcoin and other cryptocurrencies.

Q & A

  • What is the primary concern with the basic blockchain transaction system as described in the script?

    -The primary concern is the lack of security to prevent someone from fraudulently adding a transaction that spends someone else's money, as there seems to be no protection mechanism in place.

  • What cryptographic primitive is introduced in the script to address the security issue in blockchain transactions?

    -The script introduces the concept of public-private key pairs to address the security issue in blockchain transactions.

  • What is the significance of a private key in the context of public-private key pairs?

    -The private key is a long, unique, and random number that must be kept secret by its owner. It is used to create digital signatures for transactions, ensuring that only the owner can authorize transactions from their account.

  • How is a public key related to a private key?

    -A public key is derived from the private key and is meant to be shared openly. It does not reveal the private key and is used by others to verify the authenticity of a transaction signed with the corresponding private key.

  • What is the purpose of signing a message with a private key?

    -Signing a message with a private key creates a digital signature that can be verified by anyone using the corresponding public key. This verifies that the message came from the owner of the private key without revealing the key itself.

  • How does a message signature verify the authenticity of a transaction?

    -A message signature, when verified with the corresponding public key, confirms that the transaction was signed by the owner of the private key, ensuring the transaction's authenticity and integrity.

  • What is the role of a transaction in the context of a blockchain?

    -A transaction in a blockchain represents a transfer of value, such as money or assets, from one party to another. It includes details such as the amount, the sender's and recipient's public keys, and a digital signature to prove the sender's identity.

  • How does the blockchain ensure that transactions are only created by the rightful owner of the funds?

    -The blockchain uses digital signatures created with the sender's private key. Since only the rightful owner has the private key, this ensures that transactions can only be created by the person who owns the funds.

  • What happens if someone tries to alter a transaction in a blockchain?

    -If a transaction is altered, the digital signature will no longer match the transaction's content. This breaks the signature's integrity, and the blockchain will reject the altered transaction as invalid.

  • How does the creation of a new address in a blockchain work?

    -To create a new address, one simply generates a new private key, which is a random number. From this private key, a new public key is derived and can be shared to receive transactions on the blockchain.

  • What is the significance of the financial context in successful production blockchains?

    -Successful production blockchains, like Bitcoin and other cryptocurrencies, operate within a financial context because they use tokens to facilitate transactions and incentivize participants, such as miners, in the network.

Outlines

00:00

🔒 Introduction to Blockchain Security with Public-Private Key Pairs

This paragraph introduces the concept of securing transactions in a blockchain. It discusses the issue of preventing unauthorized transactions and introduces public-private key pairs as a cryptographic solution. The explanation covers the generation of a private key, which should be kept secret, and the corresponding public key, which can be shared openly. The paragraph also explains how these keys are used to create digital signatures for transactions, ensuring that only the owner of the private key can authorize transactions, thus adding a layer of security to the blockchain.

05:02

🤝 Signing Transactions with Public-Private Keys in Blockchain

This paragraph delves deeper into the process of using public-private key pairs to sign transactions within a blockchain. It explains how a message signature is created using the private key and can be verified by anyone using the public key. The paragraph demonstrates the creation of a transaction, which includes the amount being transferred and the public keys of the sender and receiver. It emphasizes the importance of the signature in verifying the authenticity of the transaction and preventing tampering. The explanation also touches on the ease of creating new addresses in the blockchain by simply generating a new private key, thus enabling the creation of new public keys without the need for a centralized authority.

Mindmap

Keywords

💡Blockchain

A blockchain is a decentralized, distributed ledger that records transactions across multiple computers in a secure and verifiable way. In the context of the video, blockchain is the underlying technology for cryptocurrencies like Bitcoin, ensuring the integrity and security of financial transactions without the need for a central authority.

💡Transactions

Transactions in the video refer to the movements of digital assets or money from one party to another within a blockchain. They are the fundamental operations that update the ledger, and in the script, they are the basis for the discussion on how to secure these movements to prevent unauthorized access or changes.

💡Public/Private Key Pairs

Public/private key pairs are cryptographic tools used for secure communication and digital signatures. In the video, the private key is kept secret by its owner and used to sign transactions, while the public key is shared openly and used by others to verify the authenticity of the signed transactions.

💡Cryptographic Primitive

A cryptographic primitive is a basic building block in cryptography, such as encryption algorithms or hash functions. In the script, public/private key pairs and digital signatures are examples of cryptographic primitives used to secure transactions on a blockchain.

💡Signatures

Signatures in the context of the video are digital signatures created using the private key of a user. They are used to authenticate the origin of a message or transaction, ensuring that it was indeed sent by the owner of the private key associated with the public key.

💡Message Signature

A message signature is the result of signing a message with a private key. In the video, it is used to prove that the sender of a message or transaction is in possession of the corresponding private key without revealing the key itself.

💡Verify

Verification in the video refers to the process of checking the validity of a digital signature using the sender's public key. It confirms that the signed message or transaction was indeed created by someone with access to the corresponding private key.

💡Transaction

In the video, a transaction is a structured message that includes details like the amount of money being sent and the public keys of the sender and receiver. It is signed by the sender's private key to ensure its authenticity and integrity.

💡Miner

Miners, as mentioned in the script, are participants in a blockchain network who validate transactions and add them to the blockchain by solving complex cryptographic puzzles. Their role is crucial for maintaining the security and immutability of the blockchain.

💡Immutability

Immutability refers to the property of a blockchain where once data is written to it, it cannot be altered or deleted. In the video, the use of digital signatures and cryptographic techniques contributes to the immutability of the transactions recorded on the blockchain.

💡Distributed

Distributed in the context of the video means that the blockchain operates across multiple nodes or computers without a central point of control. This decentralization is key to the security and resilience of the blockchain system.

Highlights

Introduction to blockchain and the need for securing transactions.

Explanation of the issue with unauthorized transactions.

Introduction of public-private key pairs as a solution.

Description of a private key as a long, random number.

Explanation of the public key derived from the private key.

Emphasis on keeping the private key secret.

Public key can be shared without compromising security.

Demonstration of generating a private key and its corresponding public key.

Explanation of using the private key to sign messages.

Verification process using the public key and the signed message.

Example of signing a message and verifying its authenticity.

Explanation of creating a transaction using public and private keys.

Verification of a transaction signature to ensure its validity.

Discussion on the impact of altering transaction details on signature validity.

Miners can't create valid signatures without the original private key.

Public-private key pairs allow decentralized creation of new addresses.

Overview of how public-private key pairs secure blockchain transactions.

Blockchain's financial context and use of tokens.

Summary of blockchain functionality similar to Bitcoin and other cryptocurrencies.

Transcripts

play00:01

Welcome back

play00:02

Last time we looked at a blockchain, and how it works

play00:06

particularly in the financial context

play00:08

and we have these transactions that we were creating that move money from one person to another but there's a

play00:14

big problem with this and that is what's to stop somebody from just adding a

play00:20

Transaction that spends all of someone else's money to them

play00:25

There's seems to be no

play00:27

Protection here for that so what we're gonna do is we're gonna look at ways to add

play00:33

transactions to a blockchain

play00:35

that

play00:36

Keep it. So not just anyone can create these transactions in order to do this. We need to look at

play00:44

another cryptographic primitive and that is

play00:48

Public private key pairs, and then we'll use that for signatures, so let's take a look at that right now

play00:54

so here's a

play00:55

public/private key pair

play00:57

The private key here

play00:59

It's just you know

play01:00

It's a really really long number and any number is a private key right you could

play01:05

Make this be one one is a private key

play01:07

It's not a very good one lots of people have thought of the number one before

play01:11

but you could you know you could pick some really really long number and it's sort of a random number and

play01:17

We can use that as a private key. Now. You can see every time. I'm adding digits here its

play01:24

Recomputing the public key that relates to that private key, and that's why the stuff down

play01:29

Here starts changing so as the name would imply this

play01:34

Private key is to be kept private only you have this private key, and you never tell it to anyone else

play01:41

Okay, and just as the name implies

play01:45

Public key the public key here, you just tell everyone this is something that you want everybody to know

play01:52

This is something that there's no harm in letting everyone know

play01:57

There is not a way to derive from this public key

play02:00

What the private key is okay? So it's just a kind of a public

play02:06

Version of this private key that does not reveal what the private key is

play02:11

Okay, so I'm gonna hit my little ray number generator, so I get a nice really long private key

play02:16

And it's not something you know where the numbers are close together where I typed

play02:20

On the keyboard it's something a little bit more random looking and then the system has derived a public key

play02:26

From this so this is going to be my private key, and I'm gonna use this to do signatures

play02:31

So let's do that right now, so

play02:34

Here's a message signature

play02:37

So here is a message. I'm gonna type. You know hello on ders. That's me

play02:43

and I have

play02:46

My private key here six five six whatever it is is my private key only

play02:51

I have that and here's the message that only I have

play02:54

And I can hit sign and come up with a message signature here now this message

play03:02

Signature I can pass to someone else

play03:05

I'm gonna hit my little verify button I'm gonna pass this message signature to someone else to anybody else okay

play03:11

now of course they don't have my private key because I keep that private nobody else can see that but I

play03:18

Publicize my public key, and they know that everybody knows that this is my public key

play03:23

So given this message and everybody knows my public key and given the signature that I just made

play03:30

You should be able to verify this now of course if I hit verify sure enough the screen goes green

play03:36

This is a valid message

play03:37

And I have verified that whoever signed this message and came up with a signal

play03:44

Signature had access to the private key behind this public key

play03:50

Okay, and if I have kept that private key secret that must be me okay

play03:56

So that's a message signature

play03:58

And how you can sign something and verify it now instead of just using this freeform text box

play04:04

Let's put some structure around this. I'm gonna make a transaction here instead all right. This is similar to what we saw before

play04:13

the message I'm gonna say is I'm gonna send twenty dollars from this happens to be my

play04:21

public key to

play04:24

Somebody else's public key whoever whoever this is that I'm sending money to okay? I

play04:30

Of course because I'm Simon smashes. I have my private key

play04:33

I never tell anybody the private key, but I can use this private key to sign this message

play04:38

Which consists of these three things up here?

play04:41

And if I hit sign I get a message signature great all right now

play04:46

I send this whole thing out I send out my message and my signature to to

play04:53

somebody else and

play04:55

They know that I'm trying to send twenty dollars from my public key to this somebody else's public key

play05:01

You'll notice this little blue box around the from public key that

play05:07

suggests that

play05:08

You can check this signature against this public key to see whether or not the private key behind, this public key

play05:17

actually sign this message

play05:18

so let's hit verify sure enough it verifies so I know that the person in possession with the

play05:26

Private key behind this public key must only beyonders is sending twenty dollars

play05:32

To some other public key, okay, now, let's use this in the blockchain

play05:40

Let's go back to the blockchain case where we were that we're looking at before now

play05:44

You'll notice a couple of different things here all right first of all

play05:49

There's not names here anymore right there

play05:52

There are just public keys in the from and the two and you'll also notice that that I added a signature

play05:59

section here, okay, so

play06:03

In this case this is this

play06:07

Public key sending two dollars to this public key

play06:11

And here's a message signature that says that it is well

play06:14

What happens if I change this to you know 25 dollars okay?

play06:19

Of course it broke the block

play06:20

But it also broke the signature the signature is not verified and that's why the signature is turning red so Wow?

play06:29

we couldn't press the little mine button you know a miner could take this altered block and

play06:36

Remind this block

play06:38

They're gonna end up with something where the block is signed

play06:43

which should eventually happen and

play06:46

there we go and

play06:48

the signature though is still

play06:51

invalid because the the minor has no they don't have my

play06:56

Private key, they only have my public key, so they can't come up with the right signature. Okay, so that's the way

play07:02

We can make sure that

play07:04

The message this transaction here was posed

play07:08

By the person that had the money and only that person not just anyone else on on the Internet

play07:15

So that's how public private key pair

play07:19

Message signing is used to protect

play07:22

transactions and make sure that they are

play07:25

from the people that they

play07:27

proposed that they're from

play07:30

Now if you think about it it actually works really well because in order to create a new

play07:36

address a new public key the only thing you have to do is go back and

play07:42

Come up with a new private key a new random number. You didn't have to go to a centralized Authority to

play07:51

come up with a

play07:54

Public/private key pair, you know you just make up a private key

play07:58

And you use it you derive the public key from it and you put that out there

play08:02

And and that's how people can pay you so

play08:06

That's a blockchain and again. It's it's a financial context all successful production block chains that are

play08:14

Distributed use a token of some sort so they did they're all they'll have a financial

play08:20

context so that's

play08:22

You know how a blockchain?

play08:24

Will will work I mean I have glossed over a couple of

play08:29

the details

play08:30

But for the most part the the overall idea here that you're looking at is is very similar to the way that

play08:38

Bitcoin works

play08:39

And many other cryptocurrencies as well, so that's a blockchain. I hope it's helpful to you

play08:45

please leave me some notes down below and let me know what you think of this and

play08:50

I hope to see you next time in the next video

Rate This

5.0 / 5 (0 votes)

Ähnliche Tags
BlockchainSecurityCryptographyTransactionsPublic KeyPrivate KeyDigital SignatureVerificationCryptocurrencyBitcoin
Benötigen Sie eine Zusammenfassung auf Englisch?