2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CryptoBridge(BitShares)のトランザクションを解析する

Last updated at Posted at 2018-02-27

漢なら分散取引所(DEX) CryptoBridge の取引トランザクションを解析したいですよね!

やりましょう!

導入

CryptoBridge の取引履歴を取得する
https://qiita.com/syoyo/items/63fedd477c4051709923

CryptoBridge は BitShares 上で動いているので, BitShares の取引データを解析すればよいことがわかります
(この取引データはブロックチェーンベースで改ざんできないようになっているのかな?)

BitShares の API はこちらにありますが,

今回の目的はトランザクションの RAW データ(JSON)を解析することにあるので,

"asset_id"":""1.3.2481"

1.3.2481 が ZNY(BitZeny)であるとか, そういう情報を得たいのですが上の API ドキュメントだったり, BitShared ドキュメントでは, そのあたりをすんなり見つけることができませんでした.

というわけで RAW データと, cryptofresh の表示結果から, 推定してみます.
(しかし cryptofresh とかサーバー弱いっぽくてすぐエラー起こしてつらい)

執筆時点でなんとなく最新っぽいこのトランザクションを解析してみます.

asset_id 1.3.0 は BTS(BitShares), 1.3.1570BRIDGE.BTC(BitCoin), 1.3.2481BRIDGE.ZNY(BitZeny)です.
通貨は 1.3.xxx の ID を持つようです.

BitShares では, 計算をすべて整数で行うためか, 通貨の値に倍率(decimal points)が設定されています. BitZeny では decial points 6 なので, 値が 1,000,000 倍されています.

たとえば,

amount 286,182,780 は 286 ZNY に対応します.

seller などのユーザー ID は 1.2.xxxx になります(ID <-> ユーザー名のペアのデータベースはどこにあるのかな?)

operation type(id) 14 は CryptoBridge への入金(deposit), 0 は CryptoBridge から外部ウォレットへの出金(withdrawal)のようです.

1 は手数料, 4 は仮想通貨間の exchange のようですね.

TODO

ID(1.3.xxx)と通貨シンボルのルックアップを行う.

2
4
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
2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?