CBP CBP Bitcoin Script and Protocol Development 1 — Questions and Answers
Question 1: What programming language is used to write Bitcoin transaction scripts?
- Solidity
- Python
- Bitcoin Script, a stack-based language (Correct answer)
- JavaScript
Correct answer: Bitcoin Script, a stack-based language
Bitcoin uses Script, a simple stack-based programming language that defines the conditions under which transaction outputs can be spent.
Question 2: What does 'P2PKH' stand for in Bitcoin scripting?
- Pay-to-Public-Key-Hash (Correct answer)
- Proof-to-Private-Key-Holder
- Protocol-to-Peer-Key-Hash
- Pay-to-Parallel-Key-Handler
Correct answer: Pay-to-Public-Key-Hash
P2PKH (Pay-to-Public-Key-Hash) is the most common Bitcoin script type, requiring the spender to provide a public key matching a hash and a valid signature.
Question 3: What is the purpose of OP_RETURN in Bitcoin Script?
- To return funds to the sender
- To embed arbitrary data in an unspendable transaction output (Correct answer)
- To trigger smart contract execution
- To return change to the sender's wallet
Correct answer: To embed arbitrary data in an unspendable transaction output
OP_RETURN marks a transaction output as unspendable and allows up to 80 bytes of arbitrary data to be recorded immutably on the blockchain.
Question 4: What is a UTXO in Bitcoin?
- Unverified Transaction eXchange Output
- Unspent Transaction Output (Correct answer)
- Universal Token eXchange Order
- Unsigned Transaction eXchange Operation
Correct answer: Unspent Transaction Output
A UTXO (Unspent Transaction Output) is the output of a Bitcoin transaction that has not yet been used as an input in another transaction.
Question 5: What does SegWit (Segregated Witness) separate from Bitcoin transactions?
- The sender's address from the receiver's address
- The witness data (signatures) from the transaction data (Correct answer)
- Mining fees from block rewards
- Public keys from private keys
Correct answer: The witness data (signatures) from the transaction data
SegWit separates signature (witness) data from transaction data, fixing transaction malleability and effectively increasing block capacity.
Question 6: What is 'transaction malleability' in Bitcoin?
- The ability to change transaction fees after broadcasting
- The ability to alter a transaction's ID without invalidating its signature (Correct answer)
- The flexibility of Bitcoin's scripting language
- The capacity of a transaction to carry multiple outputs
Correct answer: The ability to alter a transaction's ID without invalidating its signature
Transaction malleability was a bug allowing third parties to change a transaction's TXID without invalidating signatures, which SegWit fixed.
What programming language is used to write Bitcoin transaction scripts?