LoginSignup
0
0

More than 5 years have passed since last update.

TIPS: Marker Outputの中身を見る

Last updated at Posted at 2016-07-08

環境

  • openassets-ruby 0.4.9
  • bitcoin-ruby 0.0.8
  • bitcoin 0.12.1

対象

以下のような"marker output"(0番目のvout)を持つOpenAssetsのトランザクションがあったとする。

 "out"=>
  [{"value"=>"0.00000000", "scriptPubKey"=>"OP_RETURN 4f410100020c1900"},
   {"value"=>"0.00000600",
    "scriptPubKey"=>
     "OP_DUP OP_HASH160 da9f81f0f7b0ff4a301106d5706556509131620f OP_EQUALVERIFY OP_CHECKSIG"},
   {"value"=>"0.00000600",
    "scriptPubKey"=>
     "OP_DUP OP_HASH160 a86c9fd47c7609cf60e9c811a42ac8c699842afa OP_EQUALVERIFY OP_CHECKSIG"},
   {"value"=>"0.99978799",
    "scriptPubKey"=>
     "OP_DUP OP_HASH160 aeb742caf08d3174d8616fdc97289eaad785ab29 OP_EQUALVERIFY OP_CHECKSIG"}]

やりたいこと

OP_RETURNのあとにある「4f410100020c1900」の中身を知りたい

MarkerOutputの中身を表示

OpenAssets::Protocol::MarkerOutput.deserialize_payload('4f410100020c1900')
# => #<OpenAssets::Protocol::MarkerOutput:0x007fd66b91e6e8 @asset_quantities=[12, 25], @metadata=""> 

12と25の配列であること確認できる。

参考

OpenAssets入門
http://qiita.com/osada/items/50fc76959e6730603417

OpenAssetsSpecification
https://github.com/OpenAssets/open-assets-protocol

OpenAssetsSpecification(日本語訳)
http://techmedia-think.hatenablog.com/entry/2015/05/03/190805

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0