ํŠธ๋ž™์žญ์…˜ ์ถœ๋ ฅ์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์ž.

Outputs

010000000181379011acb80925dfe69b3def355fe914bd1d96a3f5f71bf8303c6a989c7d10000000
06b483045022100ed81ff192e75a3fd2304004dcadb746fa5e24c5031ccfcf2132060277457c98f02
207a986d955c6e0cb35d446a89d3f56100f4d7f67801c31967743a9c8e10615bed01210349fc4e631
e3624a545de3f89f5d8684c7b8138bd94bdd531d2e213bf016b278afeffffff02a135ef0100000000
1976a914bc3b654dca7e56b04dca18f2566cdaf02e8d9ada88ac99c39800000000001976a9141c4bc
762dd5423e332166702cb75f40df79fea1288ac19430600

Outputs: 02a135ef0100000000
1976a914bc3b654dca7e56b04dca18f2566cdaf02e8d9ada88ac99c39800000000001976a9141c4bc
762dd5423e332166702cb75f40df79fea1288
  - Output counts(Varint): 02
    - First
      - Bitcoin amounts: a135ef0100000000
      - ScriptPubKey: 1976a914bc3b654dca7e56b04dca18f2566cdaf02e8d9ada88ac
    - Second
      - Bitcoin amounts: 99c3980000000000
      - ScriptPubKey: 1976a9141c4bc762dd5423e332166702cb75f40df79fea1288

Bitcoin Amount

  • ๋น„ํŠธ์ฝ”์ธ์˜ ์–‘์„ ๋‚˜ํƒ€๋‚ธ๋‹ค.
  • ์ด์•ก์€ 2100๊ฐœ, 2100์กฐ ์‚ฌํ† ์‹œ๋ฅผ ๋‚˜ํƒ€๋‚ธ๋‹ค.
  • 2100์กฐ๋Š” ๋ณด๋‹ค ํฌ๊ธฐ ๋•Œ๋ฌธ์— 8๋ฐ”์ดํŠธ๋กœ ํ‘œํ˜„ํ•œ๋‹ค.
  • ๋ฆฌํ‹€ ์—”๋””์•ˆ์œผ๋กœ ํ‘œํ˜„ํ•œ๋‹ค.

ScriptPubKey

  • ScriptPubKey๋Š” ๋น„ํŠธ์ฝ”์ธ ํŠธ๋žœ์žญ์…˜์˜ ์ถœ๋ ฅ(Output) ๋ถ€๋ถ„์— ํ•ด๋‹นํ•˜๋Š” ์Šคํฌ๋ฆฝํŠธ์ด๋‹ค.
  • ์ฆ‰, ํŠธ๋žœ์žญ์…˜์—์„œ ๋ฐ›๋Š” ์ชฝ์ด ๋น„ํŠธ์ฝ”์ธ์„ ๋ฐ›์„ ์ˆ˜ ์žˆ๋Š” ์ฃผ์†Œ์™€ ๊ด€๋ จ๋œ ์ •๋ณด๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ๋‹ค.
  • ์ด ์ •๋ณด๋Š” ScriptSig์—์„œ ์‚ฌ์šฉ๋˜๋Š” ์„œ๋ช… ๋ฐ ์ธ์ฆ ์ •๋ณด์™€ ๋Œ€์กฐ๋˜์–ด ๊ฒ€์ฆ๋œ๋‹ค.

UTXO

  • ์ถœ๋ ฅ์— ํฌํ•จ๋˜์ง€๋Š” ์•Š์œผ๋‚˜ ์ค‘์š”ํ•œ ๊ฐœ๋…์ด๋ผ ์„ค๋ช…ํ•œ๋‹ค.
  • UTxO๋Š” Unspent Transaction Output์˜ ์•ฝ์ž์ด๋‹ค.
  • ํŠธ๋žœ์žญ์…˜์„ ๊ณต๋ถ€ํ•ด๋ดค์œผ๋‹ˆ, ํŠธ๋žœ์žญ์…˜์ด ์ž…๋ ฅ๊ณผ ์ถœ๋ ฅ์œผ๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.
  • ๊ทธ๋ ‡๋‹ค๋ฉด, ๊ฐ€์žฅ ๋งˆ์ง€๋ง‰์— ์žˆ๋Š” ์ถœ๋ ฅ๋“ค์ด ์žˆ์„ ๊ฒƒ์ด๋‹ค.
  • ์ด๋…€์„๋“ค์€ ์•„์ง ์ž…๋ ฅ์œผ๋กœ ๋“ค์–ด๊ฐ€์ง€ ์•Š์€ ์ƒํƒœ์ด๋‹ค.
  • ์ด ๋ฏธ์‚ฌ์šฉ ํŠธ๋žœ์žญ์…˜ ์ถœ๋ ฅ์˜ ์ „์ฒด ์ง‘ํ•ฉ์„ UTXO๋ผ๊ณ  ํ•œ๋‹ค.
  • ๊ฒฐ๊ตญ ์ด๊ฑด ํ˜„์žฌ ์œ ํ†ต์ค‘์ธ ๋ชจ๋“  ๋น„ํŠธ์ฝ”์ธ์„ ์˜๋ฏธํ•œ๋‹ค.
  • ๋„คํŠธ์›Œํฌ ์ƒ์˜ ํ’€ ๋…ธ๋“œ๋Š” UTXO ์ง‘ํ•ฉ์„ ํ•ญ์ƒ ์ตœ์‹ ์œผ๋กœ ์œ ์ง€ํ•ด์•ผ ํ•œ๋‹ค.
  • ์™œ๋ƒํ•˜๋ฉด ๊ฒ€์ฆ์‹œ, ๊ฒฐ๊ตญ ์‚ฌ์šฉ๊ฐ€๋Šฅํ•œ ์ฝ”์ธ์ธ์ง€ ํ™•์ธํ•˜๋Š” ๊ฒƒ์€ ์ด๊ฑธ ๋ณด๊ณ  ํ•  ์ˆ˜ ๋ฐ–์— ์—†๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค.
  • ์ด๋Š” ๊ณง ์ด์ค‘ ์ง€๋ถˆ์˜ ๋ฐฉ์ง€ ๋ฐฉ๋ฒ•์ด ๋œ๋‹ค. ๋ชจ๋‘ ์—ฐ๊ฒฐ๋˜์–ด ์žˆ๊ณ , ๊ฐ€์žฅ ๋งˆ์ง€๋ง‰ ์ถœ๋ ฅ์œผ๋กœ๋ถ€ํ„ฐ ์ง€๊ธ‰ ๊ณผ์ •์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค.

TxOut

class TxOut:
 
    def __init__(self, amount, script_pubkey):
        self.amount = amount
        self.script_pubkey = script_pubkey
 
    def __repr__(self):
        return '{}:{}'.format(self.amount, self.script_pubkey)
 
    @classmethod
    def parse(cls, s):
        '''
        Byte ์ŠคํŠธ๋ฆผ์„ ๋ฐ›์•„์„œ ํŠธ๋žœ์žญ์…˜ ์ถœ๋ ฅ์„ ํŒŒ์‹ฑํ•˜๊ณ  TxOut ๊ฐ์ฒด๋ฅผ ๋ฐ˜ํ™˜ํ•œ๋‹ค.
        '''
        # amount is an integer in 8 bytes, little endian
        amount = little_endian_to_int(s.read(8))
        # use Script.parse to get the ScriptPubKey
        script_pubkey = Script.parse(s)
        # return an instance of the class (see __init__ for args)
        return cls(amount, script_pubkey)
 
    def serialize(self):  # <1>
        '''Returns the byte serialization of the transaction output'''
        result = int_to_little_endian(self.amount, 8)
        result += self.script_pubkey.serialize()
        return result

Locktime

010000000181379011acb80925dfe69b3def355fe914bd1d96a3f5f71bf8303c6a989c7d10000000
06b483045022100ed81ff192e75a3fd2304004dcadb746fa5e24c5031ccfcf2132060277457c98f02
207a986d955c6e0cb35d446a89d3f56100f4d7f67801c31967743a9c8e10615bed01210349fc4e631
e3624a545de3f89f5d8684c7b8138bd94bdd531d2e213bf016b278afeffffff02a135ef0100000000
1976a914bc3b654dca7e56b04dca18f2566cdaf02e8d9ada88ac99c39800000000001976a9141c4bc
762dd5423e332166702cb75f40df79fea1288ac19430600

Locktime: ac19430600
  • Locktime์€ ํŠธ๋žœ์žญ์…˜์˜ ์ž…๋ ฅ์ด๋‚˜ ์ถœ๋ ฅ์— ํฌํ•จ๋˜๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ, ํŠธ๋žœ์žญ์…˜ ์ž์ฒด์— ํฌํ•จ๋œ๋‹ค.
  • ํŠธ๋žœ์žญ์…˜ ์ „ํŒŒ ํ›„ ์‹คํ–‰์„ ์ง€์—ฐ์‹œํ‚ค๋Š” ๋ฐฉ๋ฒ•์ด๋‹ค.
  • ๋งŒ์•ฝ 600,000 ๋ธ”๋ก์ด ์ง€๋‚˜๋ฉด ์‹คํ–‰๋˜๋„๋ก ์„ค์ •ํ•˜๋ฉด, 600,000 ๋ธ”๋ก์ด ์ง€๋‚˜๊ธฐ ์ „๊นŒ์ง€๋Š” ๋ธ”๋ก์— ํฌํ•จ๋  ์ˆ˜ ์—†๋‹ค.
  • โ€œ๋นˆ๋ฒˆํ•œ ๊ฑฐ๋ž˜โ€ ์ƒํ™ฉ์„ ์œ„ํ•ด ๊ณ ์•ˆ๋˜์—ˆ๋‹ค.
  • ์ด์ „์— ๋ณด์•˜๋˜ TxIn์˜ sequence์™€ ํ•จ๊ป˜ ์‚ฌ์šฉ๋œ๋‹ค.
  • 4๋ฐ”์ดํŠธ๋กœ ํ‘œํ˜„๋˜๋ฉฐ, ๋ฆฌํ‹€ ์—”๋””์•ˆ์œผ๋กœ ํ‘œํ˜„๋œ๋‹ค.
  • ์ฃผ์š” ๋ฌธ์ œ๋Š” Locktime์— ๋„๋‹ฌํ–ˆ์„ ๋•Œ, ์ˆ˜์‹ ์ž๊ฐ€ ํŠธ๋žœ์žญ์…˜์ด ์œ ํšจํ•œ์ง€ ํ™•์‹ ํ•  ์ˆ˜ ์—†๋‹ค๋Š” ์ ์ด๋‹ค.
  • ์ด๋Š” ์‹œ๊ฐ„์ด ๋งŽ์ด ์ง€๋‚˜ ๋ถ€๋„๊ฐ€ ๋‚œ ์ˆ˜ํ‘œ์™€ ๋น„์Šทํ•˜๋‹ค.

Reference