๐ 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))