Taproot y Firmas Schnorr - Crypto Academy / S5W6 - Homework post for pelon53

in hive-108451 •  3 years ago 

WhatsApp Image 2021-12-26 at 2.10.32 AM.jpeg

Assalamualaikum,
Hello and welcome fellow steemians on my homework post given by Professor @pelon53. I hope that you all are good and enjoying your life. I am also good and healthy. In this homework, I am going to describe the functioning and advantages of Taproot and Schnorr signatures.

Question 1


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


In P2SH and P2PKH both can be used to generate transactions and fulfill the final objective, each of these have different ways to be executed and fulfill its function, these are also known as blocking script, it is better to say that these scripts act as smart contracts on the Bitcoin network.

P2PKH- Pay To PublicKey Hash

P2PKH is a concept on the Bitcoin network that facilitates transactions and storage on the Bitcoin network. "P2PkH" is an abbreviation for "Pay to Public Key Hash." Its use requires a public key and a digital signature. In simple, this means that the users have to avail the public key of the receiver of the funds (Bitcoin) in order to make a valid transaction.

They are non-segwit addresses, but they can be used to send funds across segwit addresses without underlying issues. users have to prove ownership of their public keys in order to receive funds, and they can then use their private addresses to withdraw the funds.

Working of P2PKH

The Pubkey Script is what owners use to send funds. In the P2PKH, only owners have access to the pubkey script. In this script function, the receiver of the funds has to ensure the ownership of both things. The private key is represented by a hash.

Suppose, pelon wants to receive BTC from musk. For this purpose, pelon needs to give the address of his BTC wallet. Once musk sent the BTC to the address given by pelon, the BTC would be sent to pelon's wallet. A PublicKeyscript is created by the system related to this transaction and the transaction will be stored on the network.

P2SH-Pay To Script Hash

The second script function of the Bitcoin network is the 'P2SH' script function. It can be abbreviated as 'Pay to Script Hash". In this type of transaction the funds are blocked in a P2SH script, but at the time of sending certain conditions must be met, these conditions can be a specific time or date of blocking, It authorizes you to lock Bitcoins to the hash of a script, and then you have to provide the original script if you want to unlock those Bitcoin.

Before the activation of P2SH, the senders had a standardized way of implementing their custom scripts, and it was possible to customize scripts, but it was difficult to write. In this script function, the multiple digital signatures are represented by a single hash code and this hash code decides whether the transaction can be initiated or not.

Working of P2SH

In P2SH, the sender locks the BTC until the receiver verifies the ownership of the Public Key script. The unlocking script and the script hash are collectively called as PubKey scripts. The P2SH is able to check the eligibility of multiple signatures represented by a single hash code and if it is valid, the transaction will be initiated. If the condition about the user's eligibility is false, the transaction cannot be initiated. Users are able to send funds to each other with the P2SH script function without knowing the underlying security establishment.

Difference between P2SH and P2PKH

  • In P2PKH the commissions are high and the transactions are faster while in P2SH transactions are slower.

  • P2SH support MULTISIG Transaction P2PKH does not support MULTISIG transactions

  • P2PHK addresses start with number 1, P2SH addresses start with number 3.

Question 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.

  • Use the ScriptSig and the ScriptPubKey to explain the steps that are followed.

  • Explain What happens if the transaction is made using Schnorr signatures?


In this question, we have to transfer 10 BTC to 3 of 5 portfolios. In this case, we must have 3 addresses out of 5, if we have less than 3 then we will not be able to transfer the BTC to our desired location. ScriptSig and the ScriptPubKey are the two steps of these transactions in which Scriptsig key used first, in which the scriptsig is responsible for unlocking the transaction through the use of the OP_CHECKMULTISIG, this is the code that is being used to check the condition that, the 3 signatures really correspond to all the keys involved in the transaction. If this confirms the signature then the script will unlock, else it will remain locked.

After the verification of signatures by the scriptsig, there comes the role of scriptPubKey. OP_CODES are programmed operations and there are different types of this type of codes, these codes contribute to security, this also allows us to generate the hash, the scriptPubKey is unlocked when the SHA-256 or script hash 256 that is generated by the OP_HASH160 matches the related ScriptSig. Then OP_HASH160 checked by OP_EQUAL code and if it's true the 10 BTC will be transferred to the other person.

Explain What happens if the transaction is made using Schnorr signatures?

Schnorr signatures will not see the details of the transaction Basically, these are unified and it will only be observed as a normal transaction of a single signature, in this way no one can know the conditions, or what happened for the transaction to be validated, even so, the process continues to be safe and more private.

Question 3


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


There are updates implemented to improve some functionalities of the Bitcoin network. The Taproot technology is the most recent update to the Bitcoin network, and it came with a new signature scheme known as the Schnorr signature. If we make use of transactions through P2SH or P2PKH, they cannot be differentiated. The technology is developed to improve the scalability of bitcoin as well as increase privacy, security, and multi-signature wallets.

Since it offers an improvement that facilitates the implementation of smart contracts, it is composed of 2 elements of Mast and Schnorr, if there is a multi-signature transaction, the signatures or data of the signers will not be seen, only a single signature of the transaction will be observed. In Schnorr Signature, the individual signatures of all the persons are merged with each other to form a single hybrid signature that is enough to initiate the transaction.

Tapscript is another update on the programming of the bitcoin blockchain where transactions are used to specify how to be performed, and with the available space in the blocks, the addition of new features and builds on the batch verifiability of Schnorr signatures.

Question 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.


In order to take a demo signature view, first we have to open Blockchain Demo and after opening, we generate a message which I used was Schnorr sign.

  • After writing the message click on Sign so that the message signature will appear. The message signature appeared was, 30450220538bf92db62456d4139527dd117ae9f4c6a8363ad28ff4afa385fb05ee7e46af022100b8239806bfb989153757e5a6e7b0a5e050268e8181ac068052950ad1eb8172fd

1.JPG
Blockchain Demo


  • After getting the message signature, we have to verify it by clicking on Verify on the top left of the screen.

2.JPG
Blockchain Demo


  • When we click on verify in the blue box, the whole color of the box changed to green, with this we can recognize that the message has obtained a totally valid signature.

3.JPG
Blockchain Demo


  • If we try to change the message, the box changes color and now it is not blue, so we will try to verify the message again.

4.JPG
Blockchain Demo


  • After pressing verify, the message marks an error which can be seen by the red color of the entire box, Red color shows the invalidity of the signature, this is because the message and the signature are not valid or do not match, therefore it marks the error.

5.JPG
Blockchain Demo


  • Now we have to re-sign on this demo blockchain to validate our new message or transaction.

CC

@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...