Taproot and Schnorr Signatures - Crypto Academy / S5W6 - Homework post for pelon53

in hive-108451 •  3 years ago  (edited)

Hello friends. This is the 6th week at the steemit crypto academy. This week, professor @pelon53 has explained the "Taproot and Schnorr Firm". Let's start the homework of this week.

Screenshot (6609).png


Q.1) Explain in detail the P2SH and P2PKH, show the differences between both directions.


P2PKH

The bitcoin blockchain is the biggest blockchain which allow the people to conduct the BTC transaction in secure way. This provide the opportunities to the people to send or receive the BTC on the network. The assets are considered more secur in the wallet so the traders on the blockchain prefer the wallets to store their assets. But to conduct a transaction, the traders need to unlock the wallet . On the BTC blockchain, user first need to sign the transaction before conducting it. They need to use the private key to the wallet for this purpose and the wallet get unlocked.

The bitcoin is advancing day by day to solve the blockchain triemma. The scalability of the network has been compromised because of the blockchain trilemma. To colve theis problem, the Bitcoin Script has been introduced. This script make the system secure and fast. The P2PKH and the P2SH are the scripts which are use on the btc blockchain.


P2SH

P2PS stand for Pay to script hash. This is a type of signature. Here to confirm the funds which you have received, you need to show ownership. Here total three signatures are use to sign to confirm a transaction. All three signatures need to get match for confirmation of the transaction which make the system more secure. This is a bitcoin address which was introduced in 1- April 2012 when the block 173805 mined on the btc blockchain.

The P2SH has made the blockchain more secure. Here each transaction is now encrypted in form of the script. This script is a series of the instruction to instruct the users how to spend their funds. This has solve the security problem in blockchain and solve the scalability problem too. The system become more secured because of this script.

The P2SH enable the users to lock their transaction in a script hash which is unlocked only by using the origional script which the sender have use to lock it. If the receiver have the that script, he can unlock the funds. This require more than one signatures(Multi Sig) to authorize a transaction. The P2SH script hash which is use to conduct the transactions on the blockchain network usually start with the numeric digit three

When a transaction is conducted in P2SH, the funds get blocked from the hash script and the out put script is shared on the network which is check by the minors. The minors run the broadcasted out put and check is it true or not. If the output script is true, then this is send to the receiver. The receiver will use the same script which the sender use to create the hash for unlock the funds. This make the system more secure. If the output script is not true, the transaction get fail.

This script usually contain on two scripts which are known as the ScriptSIg and ScriptPubKey. ScriptPubKey is the locking script which is use to lock the transaction and code it into a script hash. The ScriptSig is the unlocking script which is use to unlock the funds on the blockchain.


P2PKH

The bitcoin blockchain is now changing by the team behind this blockchain. New updations are being introduced to improve the working of the bitcoin blockchain. The Pay to Public Key Hash is the script which is use on the blockchain network to conduct a transaction. This is the created in 2009 when the first btc was mined.

This script is known as the locking script as it use to lock the funds into the script hash. The P2PKH addresses start with the numeric digit 1 and here the hash is visible on the network. In P2PKH, the private and public keys are use to provide the signature which after then get ,match with the public key. If the match is done, the funds are transacted to the receiver otherwise the transaction get cancel.

For example i want to transfer 1 BTC to the professor @sapwood. I will first ask him his address and then will send him the fund. The transaction output will be broadcast on the blockchain which will be run by the minors to verify the transaction. If the transaction is true, the funds will send to the receiver which need to show his ownership for the funds. He can withdraw the assets only if he able to provide the proof of his ownership. For this, the reciver need to create the multisig.


Difference between P2SH and P2PKH

P2SHP2PKH
This was introduced in 2012This was introduced in 2009
The P2SH Addresses start with digit 3. The P2PKH addresses start with 1.
Hash of script use to lock the funds Hash of public key use to lock the funds.
Support Multisig transactions The transaction fee is not as expensive as that of when P2PKHDo not support multi sig transactions. The transaction done with P2PKH is more expensive.
Compatible with Segwit feature Incompatible with segwit feature
The address format in P2SH start with 3The address format in P2PKH Start with 1
Less costly More costly
It consume the less gas fee to conduct transactionIt consume more gas fee to perform transaction.

23.jpg
Q. 2. It is required to transfer 10 BTC that belong to a 3 of 5 multi-signature portfolio, to the MTC company, for the purchase of some equipment.


This mean that at least three signatures are required to perform a transaction successfully. In simple word, if 5 people or wallet addresses want to send 10 BTC to a MTC company, then 3 among those 5 should be verified and sign. If at 3 among those 5 cannot sign, the transaction get cancel.

For example there are five people, let say P1, P2, P3, P4, P5, who want to transact the 10 BTC to an MTC company. To perform the transaction, three among them require to sign the transaction. The Multisig will then come into the screen. This will then verify the transaction and then will unlock the assets. This is actually consist of the three signatures which are required to unlock the assets. This confirm that the users who have signed the transaction have the keys which are related to the transaction keys

After this verification, the funds get unlocked. Then next step is confirmation that the public key hash is corresponding to the scriptsig. This comparison is done by the SHA-256 and after verification, the transaction get completed and the 10 BTC will be transacted successfully to the company.23.jpg


Using Schnorr Signature

This make the transaction process more easy and secure. Here if it is required to transfer 10 BTC to the MTC company, then the private key of the of all the five senders will be collected and a new key will be generated which will be use to conduct the transaction. Transaction will be signed using this single key. Here no need of three signatures to sign the transaction. Here the security get enhanced. No one able to see the private key. These keys keep hidden.. Instead, a single key which is generated using the 5 private keys of the 5 addresses will be used to withdraw the assets.
23.jpg

Question 3- Why do you think that Taproot and Schnorr firms will help the privacy of the Bitcoin network? Explain.


The bitcoin is the largest and first blockchain in the world. This blockchain provide multiple features to the users. There are million of users on this network. This blockchain has gained huge popularity and the people use this blockchain from all across the world. There are some dark sides of this blockchain too. There were some security issues in the btc blockchain but to solve these issues, the management team work hard. They introduce the new technologies to improve the working of this blockchain.

One such technology is the Taproot and Schnorr firm. The taproot is the recent updation on the blockchain network. We know that the blockchain world face the blockchain trilemma problem. Where the developers need to compromise on one of the three main and key blockchain features. These features are the decentralization, scalability and security. The btc blockchain has compromised on the scalability. The taproot technology was a step to impove the scalability problem of the btc blockchain. It is efficient and effective to enhance the scalability and security of the network.

In taproot signature, when a transaction is done on the sender side, the sender use the wallet address of the receiver to send him the funds. Then the transaction is broadcasted on the network which is verified by the minors using the public key of the sender. But if there are multiple addresses related with the transaction, those addresses need to sign the transaction using the multi signatures which is time taking process and make the network slow.

To solve this speed problem, the Schnorr is use along with the Taproot. Here a schnorr key is generated by combining all the keys related to the transaction. This is a single key which will be required to withdraw the assets. In result, the system will get fast and the scalability will be improved to great extend.

The Taproot and the schnorr, both are excellent to solve the security problems and to enhance the scalability of the network. 23.jpg

Q. 4. Using the Blockchain Demo, write exactly the following message: Schnorr Signatures, generate the message signature and verify the message. Then delete the first character from the message signature and check again. What happened? Explain. Screenshots required.


  • There a new page will be appeared. You can write any message there. I wrote the Schnorr Signatures there.
  • Then click on the Sign Button
  • The Signature of your message will be shown below.

Screenshot (6608).png

Screenshot (6607).png

Screenshot (6606).png


Verify the Message

  • To verify the message, click on the verify option.
  • Then click on the verify button.
  • The verification will be done. The page color will turn into green. This is the sign that the transaction has been verified. The signature is matched with input.

Screenshot (6605).png

Screenshot (6604).png

Screenshot (6602).png


Deleting First Character

I deleted the first character of the message which i typed. Now the message is chnorr Signatures.

I clicked on the verify button

The page color turned into red

This indicate that the transaction is not true The signature is not metched with input.

Screenshot (6600).png

Screenshot (6599).png


Conclusion

The taproot and schnorr firm is a new updation which has bring on the blockchain network to solve the scalability problem. This improve the system security and increase the scalability too. I have learned about the P2SH and P2PKH. Both these work to enhance the network security. These are the scripts which are being used on the bitcoin blockchain.

There is no need of all the script related to the transaction. The script which sign the transaction is required and thus the system become more fast. This also will work to improve the security of the blockchain.

@pelon53

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  
Loading...