Bitcoin Basics - Discussion

One more question for the community.
Is the main job of the miners is to solve the POW puzzle (by guessing the Nonce)? o
Is the integrity of the transactions done automatically (programatically) by the blockchain code or manually (who is doing it)?

Non-mining nodes donā€™t propagate blocks. only mining nodes do when they found a nonce that fits the puzzle (having a hash below the target) . Non-mining full nodes just validate each transaction, blocks,ā€¦ ect.
So full non-mining nodes are important because they check and validate everything and makes the network more secure. But they donā€™t get a financial reward for it.
The more full nodes, the safer the network. Because it has more nodes who can identify a malicious one.

What exactly is your concern with time?

3 Likes

Miners are guessing a number (nonce) until some number produce a blockhash below the target. (starting with certain amounts of zeroā€™s.
The bitcoin wallet software constructs a block automatically with transactions with the highest fee. But you could construct a block manually as well and then finding the right nonce for it.

1 Like

The time in a blockā€™s header should not be before the time of the median of the last 11 blocks in the blockchain. I understand this to keep the block times moving forward.
But what I donā€™t understand is that why the time is allowed to be 2 hours ahead of the median network time. A nefarious miner can add 5 minutes to every block they create in order to influence the difficulty level in the next adjustment period. If 5 minutes can make this difference, then why allow 2 hours?

1 Like

In reference to my question about time:

My concern is the allowed range of block time:
Min: median time of previous 11 blocks
Max: median network time + 2 hours
Why is the max block time set as such?

Thanks for the reply @Fabrice but I still donā€™t get it.
Are you saying that a non-mining node propagates the blockchain for the sake of making the network secure solely? No compensation or reward is expected by them?

Bitcoin mining difficulty adjusts overtime to always have an average of 10 minute blocktime.
The 10 minute blocktime is chosen as a compromise between fast transaction clearing and the probability of a fork to occur. If a miners solves a block it needs to propagate through the whole network so all nodes have time to sync.

3 Likes

yes, non mining nodes donā€™t get a reward and syncs with the blockchain from other nodes. Itā€™s more for users to be sure they use the truth blockchain to transact without the need to trust others. If you use an SPV like mycelium, you need to trust other nodes to Transact bitcoin.

2 Likes

I just finished the wallets lesson and have a question about hardware wallets. Ivan was discussing that a HW wallet holds the PK and never gives it to the computer. Now I just happened to use my Ledger Nano S to withdraw mining funds from Nicehash. I ran Ledger Live to generate a deposit address. This address was then copied into Nicehash so the funds could be deposited. In this context, whatā€™s happening with the private / public keys and digital signatures. How are they relevant?

1 Like

in this context, your ledger will generate a new address using your private key and display the newly generated address. thatā€™s all. If you send bitcoin to another address, your ledger will sign the transaction after you confirm it on the device. This signature leaves the device. Your private key never leaves the device. The signature does leave the device and cryptographical proof that it belongs to your private key (without reveiling it) and that you can spend these particular bitcoins. your wallet basically needs to unlock bitcoins that your private key owns.

Here is a video explaining the basics of hardware wallets:
https://youtu.be/J0Rh6kt-AXY

4 Likes

Thanks, that video is good, but I guess it helped me realize what Iā€™m not understanding with bitcoin transactions in general. So my wallet (software or hardware) will use my private key to sign a transaction so that itā€™s provable that the request came from my wallet. At what point in time is my public key used (and how it is accessed, and by whom) to verify that the transaction came from me? Does this question make sense, or should I try to figure out another way to rephrase it?

It was stated that all of the TXs in an orphaned block are returned to the mempool.
Question: Is this really true, since some of the TXs in the propagated (longer) blockchain could have also been in the orphaned block. Please explaln. Thanks!

1 Like

Yes, they will go back to the mempool. some transactions could also be included in the other block wich will mark them as comfirmed once the node gets the information synced.

1 Like

The public key is used to ensure you are the owner of an address that can receive funds. The public key is also mathematically derived from your private key.

Yes, I understand that the public key is derived from my private key, but itā€™s done in my wallet. So I guess what Iā€™m asking is, at what point does my public key get transmitted to the nodes so they can verify that my tx is valid and that Iā€™m the one who really requested the transaction?

you donā€™t just transmit your public key. itā€™s used to generate an address and is also part of unlocking your bitcoins locked on that public key.
all nodes validate each transaction that is submitted to the network. but only your keys can unlock these bitcoins to spend it again.
In bitcoin programming course you will learn more about how batches of bitcoins are locked and how you can unlock this using your keys and spend it.

Watch this amazing presentation about keys and addresses in Bitcoin. (in dept)

How Bitcoin Transactions work

How Keys and addresses work

Bitcoins script

https://learnmeabitcoin.com/

3 Likes

Incredible Blockchain that delivers protection, security, and privacy. The use of cold & hot storage wallets, exchanges, tokens, applications, and coding necessary to bring decentralized methods to everyone. Iā€™m pumped! Iā€™m pumped! Go! @ivantechacademy

Its kind of like handing bank notes over at a teller in a branch is it not?

:blush:

1 Like

Hi, Iā€™d like to know when the miner gets his award in the context of orphan blocks. It seems that he canā€™t be awarded immediately after appending the block.

1 Like

you are right, the miner of a stale block wonā€™t get the blockreward. Thatā€™s also a reason that miners need to wait for 100 blocks until they can spent it.

2 Likes