Script U-III
Script U-III
Bitcoin Transaction:
What Is a Transaction?
A transaction is a completed agreement between a buyer and a seller to exchange
goods, services, or financial assets in return for money.
A Bitcoin transaction is a transfer of bitcoin from one address to another. The valid
transaction must be signed by the sender.
Example:
Mark wants to send 1 BTC to Jessica. To do this, he uses his private key to 'sign' a
message with the transaction-specific details.
Inputs. This contains information about the bitcoin previously sent to Mark's
address. For example, imagine Mark previously received 0.6 BTC from Alice and
0.6 BTC from Bo
Outputs. There are two outputs. The first is 1 BTC to Jessica’s address. The
second is 0.2 BTC returned as 'change' to Mark. This second output is calculated as
the total of the inputs [0.6 + 0.6 = 1.2], minus the amount Mark wants to send [1
BTC].
If the transaction contains multiple inputs, this means the amount is coming from
different bitcoin addresses. Having multiple output means, funds are being
distributed to different wallet addresses.
A public key is derived from a wallet address and is used to facilitate transactions,
while a wallet address is used to identify a destination for cryptocurrency
transactions.
A private key is an alphanumeric code that acts similarly to a password. Private keys
are used to authorize cryptocurrency transactions. Your private key is generated by
your wallet and is used to create your public key (your wallet address) using
encryption.
Bitcoin uses public-key cryptography to create a “key pair” (a pair of keys) that controls
access to bitcoins.
Pay-to-Pubkey (P2PK)
P2PK (Pay ToPubkey) is a script pattern that locks an output to a public key.
OP_DUP
OP_DUP pops the first element, and duplicates it. Then, it adds both back to the stack
OP_HASH160:
This pops the first element and hashes it twice. The first round will hash with the SHA-256
algorithm. The SHA-256 output is then hashed with the RIPEMD-160 algorithm. The
resulting output is added back onto the stack.
OP_EQUALVERIFY:
OP_CHECKSIG:
pops them both and verifies the signature against the public key. If they match, it adds
a <1> to the stack. Otherwise, it adds a <0>.
witness: <signature><pubkey>
scriptSig: (empty)
scriptPubKey: 0 <20-byte-key-hash>
scriptPubKey:
Witness:
Usecases:
Escrow
A third party on behalf of two other parties that are in the process of
completing a transaction.
The green address is a third party trust trick and can help resolve most problems related
to the need to wait for confirmations (slow transactions).
Example:
As an example, assume website Z accepts incoming Bitcoin payments, but also trusts the green
address published by Mt. Gox. Customer C wants to withdraw funds from Mt. Gox and send
them to a payment address of website Z. A customer who does a withdrawal from Mt. Gox could
click the use green address checkbox, which will result in the payment being sent to the "green
address" derived from the special keypair as an intermediate step before forwarding the payment
to site Z. Site Z can confirm that the payment passed through Mt. Gox'skeypair and trust the
payment as confirmed immediately,
What are micropayments Bitcoin?
Micropayments are small online financial transactions that value less than a dollar,
The micropayment protocol allows one party (the client) to make repeated micropayments to
another party (the server). It works in two stages. Firstly, some value is locked up with a
multi-signature transaction that places it under the control of both parties.
This ensures that the refund won’t become valid until some period of time has passed
(currently, one day)
Downside of Bitcoin Mining
1.Volatility and Market Risk: The profitability of mining depends not only on the
amount of Bitcoin mined but also on its market value. Fluctuations in Bitcoin’s price
can affect mining profitability, potentially rendering some mining operations
unprofitable, especially during bear markets. Miners must carefully manage their
operational costs and be prepared for market uncertainties.
2.High Energy Consumption: Bitcoin mining is an energy-intensive process,
primarily due to the computational power required to solve complex mathematical
puzzles. As a result, mining operations consume significant amounts of electricity,
contributing to environmental concerns and carbon emissions. Critics argue that the
energy consumption associated with mining is unsustainable and exacerbates climate
change.
3.Cost of Equipment and Maintenance: Mining Bitcoin requires specialized
hardware, such as ASICs, which can be expensive to purchase and maintain.
Additionally, as the network difficulty increases, miners need to continually upgrade
their equipment to stay competitive. The capital expenditure and ongoing
maintenance costs can pose a barrier to entry for aspiring miners.
4.Long-Term Viability: A greater supply of coins result in a decrease in mining
rewards through a mechanism called halving. The decreased block rewards
combined with the increasing difficulty level can make mining less profitable over
time. Miners will need to rely more on transaction fees to sustain their operations
with some challenges too regarding profitability.
5.Centralization Concerns: While Bitcoin is designed to be decentralized, the reality
is that mining has become increasingly concentrated in the hands of a few large
players. Large-scale mining operations have access to more resources, allowing them
to dominate the network and potentially control the consensus process. This
concentration of power raises concerns about the centralization of Bitcoin mining
and the security of the network.