📌 a BlockChain Learning Blog # S3E2 ⚡ Basics of Bitcoin Transaction ⚡
Dear Community,
This is another blog post in the ongoing series of BlockChain Learning. #devdlearningblog . Todays blog is dedicated on basics of a bitcoin transaction.
📌 Bitcoin does not have account balance concept in deep core rather it works on UTXO concepts (Unspent Transaction Outputs)
📌 In short if someone sends you a bitcoin on your bitcoin address that mean he is transferring the ownership and authorizing you to claim those bitcoin.
📌 Every authorization in its core is a script instruction or you can say some lines of code.
📌 When your friend send the bitcoin to your bitcoin address that time internally authorization claim is assigned to your address.
📌 When you tries to spend assigned UTXO that time you need to prove that you are a rightful owner of this assigned and validation part is done by your private key as authorization claim is assigned to your public key by sender.
👉 Bitcoin transaction script looks like below
scriptSig: <sig> <pubKey>
scriptPubKey: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
📌 Bitcoin Scripts are simple, compact, stack-based and processed left to right, Not Turing Complete (no loops)
📌 The whole script execute in a stack and claim is only valid if the end result comes our as TRUE.
⚡ Some Interesting Bitcoin Scripts ⚡
👉 Provably un-spendable or prunable outputs
scriptPubKey: OP_RETURN {zero or more ops}
OP_RETURN is a script opcode used to mark a transaction output as invalid. Since any outputs with OP_RETURN are provably unspendable, OP_RETURN outputs can be used to burn bitcoins.
👉 Anyone-can-spend outputs
scriptPubKey: {empty}
scriptSig: OP_TRUE
Output of stack will always True without any validation so anyone can claim and spend these bitcoins assigned to this output.
👉 Freezing funds until a time in the future
scriptPubKey: <expiry_time> OP_CHECKLOCKTIMEVERIFY OP_DROP OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
scriptSig: <sig> <pubKey>
In such transaction the rightful owner can only spend this transaction when he will able to meet an additional condition for current time equals to expiry_time.
Hope this was an interesting read for you all & would have help you understand how things works under the hood. Leave a comment in case of any suggestion or questions.
👉 To view more kindly follow my blog https://steemit.com/@devrajsinghrawat
📌 Thank you in advance for your comments...
📌 Sign up nad Earn Free Bitcoin for solving simple tasks at Earn
📌 Mannabase is an online platform for the world’s first Universal Basic Income cryptocurrency. You are also welcome! https://www.mannabase.com/?ref=e7e72550c8
👉 Sign up to best Crypto to Crypto Exchanegs Binance Signup & KuCoin Signup
⚡ Best part about Kucoin Exchange is KuCoin Bonus ⚡
⚡ All your RESTEEM's always are much appreciated here, and always noticed ⚡
🚀 Stay Tuned & Keep Steeming,
Cheers 🚀
Awesome details .. thxs for sharing
@originalworks !originalworks
Excellent article. I learned a lot of interesting and cognitive. I'm screwed up with you, I'll be glad to reciprocal subscription))