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
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
@originalworks !originalworks
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit