πŸ“Œ a BlockChain Learning Blog # S3E2 ⚑ Basics of Bitcoin Transaction ⚑

in devdlearningblog β€’Β  6 years agoΒ  (edited)

1062080209.jpg
Image Source

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)

1_eAKr5SIZfWXwC9dFBOmS3Q.png
image source

πŸ“Œ 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.

#bitcoin #howto #blockchain

πŸ‘‰ 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
image.png

πŸ“Œ 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
πŸš€

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: Β 

Awesome details .. thxs for sharing

Β  Β· Β 6 years agoΒ (edited)

@originalworks !originalworks