一笔 CKB 转账长这个样子
%{
"cell_deps" => [
%{
"dep_type" => "dep_group",
"out_point" => %{
"index" => "0x0",
"tx_hash" => "0xbd864a269201d7052d4eb3f753f49f7c68b8edc386afc8bb6ef3e15a05facca2"
}
}
],
"hash" => "0x154c8159d6854b41189cc1e09ff018789e5d7f64403f86cf6b67c75196df22b6",
"header_deps" => [],
"inputs" => [
%{
"previous_output" => %{
"index" => "0x1",
"tx_hash" => "0xba2d9e2b1759c619655440c2fe1dc8a2acb1582de65be717898995847b5b51bc"
},
"since" => "0x0"
}
],
"outputs" => [
%{
"capacity" => "0x52b391e00",
"lock" => %{
"args" => "0xcd65e9ba47cc61dd34b3c7957e6c86600bf44764",
"code_hash" => "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8",
"hash_type" => "type"
},
"type" => nil
},
%{
"capacity" => "0x5db0e82af5",
"lock" => %{
"args" => "0x8d25c59dc8010dc710be66db45cc5232054a1431",
"code_hash" => "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8",
"hash_type" => "type"
},
"type" => nil
}
],
"outputs_data" => ["0x", "0x"],
"version" => "0x0",
"witnesses" => ["0x55000000100000005500000055000000410000005d810c10712e84d6c47dbee1da0b64e9909ea753c4fa3ce9da039d64aee2b8e707238e68154d5d1b518362859ab48397cde8b3c47cfbdb86cbabb6513963086200"]
}
如果是 UDT 的话,结构会有什么不同吗?
(缺少足够的 CKB 发行自己的 UDT,但是链上也没有找到 UDT 交易,只好在这里问了)
目前可以想到的是,对于普通地址的 CKB 转账,最严格的校验是:
- CKB 转账 type == nil
- code_hash 为 secp256k1_blake160_sighash_all_type_hash
- hash_type == “type”
- cell_deps 中有 secp256k1_dep
这样验证是否正确?
哪位大佬能发一个 UDT 转账的 txid 出来就更好了~