트랜잭션의 인풋과 아웃풋
  • 트랜잭션은 여러개의 인풋과 여러개의 아웃풋으로 이루어질 수 있음
    • 예를들을 0.7코인을 지불하기 위해서 1코인을 지불하면 0.7코인은 지불 대상에게 가고, 나머니 0.3코인은 잔돈으로 돌아옴
    • 여기서 1코인은 인풋이고, 0.7코인과 0.3코인은 아웃풋이 됨. 이 경우 아웃풋이 2개임
    • 여기서 내게 돌아온 0.3 코인은 내가 다른 트랜잭션에서 사용될 인풋이 됨.
    • 이렇게 트랜잭션의 아웃풋으로 내게 돌아온 코인이나 상대에게 전달된 코인을 UTXO(Unspent Transaction Output)이라고 함.
UTXO
  • 이렇게 여러 블록에 분산된 UTXO을 모아서 다음 트랜잭션에서 사용할 수 있음
  • 다시 말해서, 어딘가에 어떤 지갑주소에 대해서 계산된 Balance값이 저장되지 않음.
블록의 구조 다시 정리

블록체인 데이터 모델
  • Transaction in the bitcoin blockchain are stored in a double-hashed form:

    • SHA256(SHA256(01000…)) = b138360800cdc72248c3ca8dfd06de85913d1aac7f41b4fa54eb1f5a4a379081
  • 트랜잭션 상세히 보기:https://live.blockcypher.com/btc/

Full breakdown of the raw transaction

Version- All transactions include information about the Bitcoin Version number so we know which rules this transaction follows.

Input Count- Which is how many inputs were used for this transaction

Data stored in Input information:

  • Previous output hash
    • All inputs reference back to an output (UTXO). This points back to the transaction containing the UTXO that will be spend in this input. The hash value of this UTXO is saved in a reverse ordered here.
  • Previous output index
    • The transaction may have more than one UTXO which are referenced by their index number. The first index is 0.
  • Unlocking Script Size
    • This is the size of the Unlocking Script in bytes.
  • Unlocking Script
    • This is the hash of the Unlocking Script that fulfills the conditions of the UTXO Locking Script.
  • Sequence Number
    • This s a deprecated feature of bitcoin Currently set to ffffffff by default.

Output Count- which tells us how many outputs were produced from this transaction.

Data stored in Output Information:

  • Amount
    • The amount of Bitcoin outputted in Satoshis (the smallest bitcoin unit). 10^8 Satoshis = 1 Bitcoin.
  • Locking Script Size
    • This is the size of the Locking Script in bytes.
  • Locking Script
    • This is the hash of the Locking Script that specifies the conditions that must be met to spend this output.

Locktime- The locktime field indicates the earliest time or the earliest block a transaction can be added to the blockchain. If the locktime is non-zero and less than 500 million, it is interpreted as a block height and miners have to wait until that block height is reached before attempting to add it to a block. If the locktime is above 500 million, it is read as a unix timestamp which means the number of seconds since the date January 1st 1970. It is usually 0 which means confirm as soon as possible.

results matching ""

    No results matching ""