Skip to content

Instantly share code, notes, and snippets.

@forthxu
Created Sep 26, 2018
Embed
What would you like to do?
BTC和USDT(OMNI)转账协议分析
--------------------
--------------------
交易:a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d
raw: https://btc.com/a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d.rawhex
01 加锁数量
输出脚本:
0010a5d4e8000000 小头,八字节,转出数量 10000.00000000
19 脚本长度
76 OP_DUP
a9 OP_HASH160
14 20字节
46af3fb481837fadbb421727f9959c2d32a36829 允许解锁这笔交易的公钥对应的公钥hash
88 OP_EQUALVERIFY
ac OP_CHECKSIG
00000000 LockTime
--------------------
--------------------
交易:cca7507897abc89628f450e8b1e0c6fca4ec3f7b34cccf55f3f531c659ff4d79
raw:https://btc.com/cca7507897abc89628f450e8b1e0c6fca4ec3f7b34cccf55f3f531c659ff4d79.rawhex
01000000018dd4f5fbd5e980fc02f35c6ce145935b11e284605bf599a13c6d415db55d07a1000000008b4830450221009908144ca6539e09512b9295c8a27050d478fbb96f8addbc3d075544dc41328702201aa528be2b907d316d2da068dd9eb1e23243d97e444d59290d2fddf25269ee0e0141042e930f39ba62c6534ee98ed20ca98959d34aa9e057cda01cfd422c6bab3667b76426529382c23f42b9b08d7832d4fee1d6b437a8526e59667ce9c4e9dcebcabbffffffff0200719a81860000001976a914df1bd49a6c9e34dfa8631f2c54cf39986027501b88ac009f0a5362000000434104cd5e9726e6afeae357b1806be25a4c3d3811775835d235417ea746b7db9eeab33cf01674b944c64561ce3388fa1abd0fa88b06c44ce81e2234aa70fe578d455dac00000000
--------------------
01000000 版本
--------------------
01 输入脚本数量
--------------------
解锁输入脚本一:P2PKH(Pay-to-Public-Key-Hash)
8dd4f5fbd5e980fc02f35c6ce145935b11e284605bf599a13c6d415db55d07a1 引用的交易哈希,32字节,小头
00 引用的交易输出索引
0000008b 脚本长度139=1长度+71签名+1类型+1长度+1版本+64公钥
签名:
48 签名和签名类型的长度
30450221009908144ca6539e09512b9295c8a27050d478fbb96f8addbc3d075544dc41328702201aa528be2b907d316d2da068dd9eb1e23243d97e444d59290d2fddf25269ee0e 签名
01 签名类型
公钥:Hash160(46af3fb481837fadbb421727f9959c2d32a36829) Address(17SkEw2md5avVNyYgj6RiXuQKNwkXaxFyQ)
41 公钥长度
04 公钥版本
2e930f39ba62c6534ee98ed20ca98959d34aa9e057cda01cfd422c6bab3667b7 公钥X
6426529382c23f42b9b08d7832d4fee1d6b437a8526e59667ce9c4e9dcebcabb 公钥Y
ffffffff 序列号
--------------------
02 输出脚本数量
--------------------
加锁输出脚本一:P2PKH(Pay-to-Public-Key-Hash)
00719a8186000000 小头,八字节,转出数量 5777.00000000
19 脚本长度
76 DUP
a9 HASH160
14 PUSHDATA(20)
df1bd49a6c9e34dfa8631f2c54cf39986027501b
88 EQUALVERIFY
ac CHECKSIG
--------------------
加锁输出脚本二:P2PK(Pay-to-Public-Key)
009f0a5362000000 小头,八字节,转出数量 4223.00000000
43 脚本长度
41 PUSHDATA(65)
04 cd5e9726e6afeae357b1806be25a4c3d3811775835d235417ea746b7db9eeab3 3cf01674b944c64561ce3388fa1abd0fa88b06c44ce81e2234aa70fe578d455d 版本+公钥XY
ac CHECKSIG
--------------------
00000000 LockTime
--------------------------------------------------------------------------
交易:
https://btc.com/9bc1e10acf8f166613500d8a210dc4d2be018dc47730f268b351f4cb89fda86e.rawhex
01000000016749664960e8cfa57abd3dce29e73c0b6b79626c0b6dd703309d7497da8939d0010000006b483045022100ad0ece657f9320045be9740abadf7cf8948ba9fd22c1ec3d48adf13a0753105102204d588f0cdf7f5262df3cfb3fb18635114c044e062d2f898a08c02171b390debb012103da5bac7b36d5aa38f531c6b9601e21bb598a4b6716ebed38b009a55dabde9440feffffff030000000000000000166a146f6d6e69000000000000001f0000048c27395000f52e7a00000000001976a914a25dec4d0011064ef106a983c39c7a540699f22088ac1c0200000000000017a914ebc6513b2e2aa73207663f613cd89a479e5f24d787f9480800
01 版本
00000001 解锁脚本数量
--------------------
解锁输入脚本一:
6749664960e8cfa57abd3dce29e73c0b6b79626c0b6dd703309d7497da8939d0 引用的交易哈希,32字节,小头
01 引用的交易输出索引
0000006b 脚本长度
48 签名长度72
3045022100ad0ece657f9320045be9740abadf7cf8948ba9fd22c1ec3d48adf13a0753105102204d588f0cdf7f5262df3cfb3fb18635114c044e062d2f898a08c02171b390debb01
21 公钥长度33
03da5bac7b36d5aa38f531c6b9601e21bb598a4b6716ebed38b009a55dabde9440
feffffff
03 输出脚本数量
--------------------
加锁输出脚本一:
0000000000000000 小头,八字节,转出数量 0
16 锁定脚本长度22
6a OP_RETURN 标记交易无效
14 长度20
6f6d6e69
000000000000001f 31USDT
0000048c27395000 50000.00000000
--------------------
加锁输出脚本二:
f52e7a0000000000 小头,八字节,转出数量 8007413
19 锁定脚本长度25
76 OP_DUP
a9 OP_HASH160
14 20字节
a25dec4d0011064ef106a983c39c7a540699f220 地址 1FoWyxwPXuj4C6abqwhjDWdz6D4PZgYRjA
88 OP_EQUALVERIFY
ac OP_CHECKSIG
--------------------
加锁输出脚本三:
1c02000000000000 小头,八字节,转出数量 540
17 锁定脚本长度23
a9 OP_HASH160
14 20字节
ebc6513b2e2aa73207663f613cd89a479e5f24d7
87 EQUAL
--------------------
f9480800 LockTime
--------------------------------------------------------------------------
交易:5bf6c71747fdfd725acc9216c1a2d633d8ae47d6a842c8f83e3b0c9e600410f2
https://btc.com/5bf6c71747fdfd725acc9216c1a2d633d8ae47d6a842c8f83e3b0c9e600410f2.rawhex
01000000016ea8fd89cbf451b368f23077c48d01bed2c40d218a0d501366168fcf0ae1c19b010000006a4730440220301a98b76c2e16640b152aba20b396c03ef3dbd13873b492489add044e2e9c58022048cfea2d818d4a632396795f1cec12a3e470da17b9d1ea6c8d7342411682721e012103da5bac7b36d5aa38f531c6b9601e21bb598a4b6716ebed38b009a55dabde9440feffffff030000000000000000166a146f6d6e69000000000000001f0000000ba43b7400291c7a00000000001976a914a25dec4d0011064ef106a983c39c7a540699f22088ac22020000000000001976a91404a94b25d962e443e95304d2de5a1bf957b9807a88acf9480800
输入8007413=8003147(输出一8002601+输出二546)+手续费4266
01 版本
00000001 解锁脚本数量
--------------------
解锁输入脚本一:
6ea8fd89cbf451b368f23077c48d01bed2c40d218a0d501366168fcf0ae1c19b 引用的交易哈希,32字节,小头 9bc1e10acf8f166613500d8a210dc4d2be018dc47730f268b351f4cb89fda86e
01 引用的交易输出索引
0000006a 脚本长度
47 签名长度71
30440220301a98b76c2e16640b152aba20b396c03ef3dbd13873b492489add044e2e9c58022048cfea2d818d4a632396795f1cec12a3e470da17b9d1ea6c8d7342411682721e01
21 公钥长度33
03da5bac7b36d5aa38f531c6b9601e21bb598a4b6716ebed38b009a55dabde9440 地址 1FoWyxwPXuj4C6abqwhjDWdz6D4PZgYRjA
feffffff
03 输出脚本数量
--------------------
加锁输出脚本一:
0000000000000000 小头,八字节,转出数量 0
16 锁定脚本长度22
6a OP_RETURN 标记交易无效
14 长度20
6f6d6e69 omni的16进制表示
000000000000001f 31USDT
0000000ba43b7400 500.00000000
--------------------
加锁输出脚本二:
291c7a0000000000 小头,八字节,转出数量 8002601
19 锁定脚本长度25
76 OP_DUP
a9 OP_HASH160
14 20字节
a25dec4d0011064ef106a983c39c7a540699f220
88 OP_EQUALVERIFY
ac OP_CHECKSIG
--------------------
加锁输出脚本三:
2202000000000000 小头,八字节,转出数量 546
19 锁定脚本长度25
76 OP_DUP
a9 OP_HASH160
1404a94b25d962e443e95304d2de5a1bf957b9807a
88 OP_EQUALVERIFY
ac OP_CHECKSIG
--------------------
f9480800 LockTime
https://www.omniexplorer.info/tx/f404e033d9a8ef815db75d5056eab9f1e09d3865c53afe5ce02884bfb4247047
BTC 0.0093566(0.00100000+0.00835660)=0.0087566(875114+546)+0.0006
01000000
02 输入数量
https://btc.com/c23495f6e7ba24705d43583edd69ff25a354c18e69fd8514c07ec6f47cb995de from 1K6JtSvrHtyFmxdtGZyZEF7ydytTGqasNc
de95b97cf4c67ec01485fd698ec154a325ff69dd3e58435d7024bae7f69534c2 大头 c23495f6e7ba24705d43583edd69ff25a354c18e69fd8514c07ec6f47cb995de
00
0000006a
47
304402200a6fef16882db2f3e07356b619121d74cf0bd42872cba57430e901b4252f7c8102202edcaa90b278d568faa55a6a9c523ff0cd09e0c916e75ea7baf4690d5747789c01
21
0382df61bad93a1211ceac5c78fd273d65e405a7e148e068ced3e40bf87cf71721
ffffffff
https://btc.com/ee1673b09b0edaf7aaf8eb0bfd53a5a2757eb3e342e731bfc960b869aa0ab6b3 from 1K6JtSvrHtyFmxdtGZyZEF7ydytTGqasNc
b3b60aaa69b860c9bf31e742e3b37e75a2a553fd0bebf8aaf7da0e9bb07316ee 大头 ee1673b09b0edaf7aaf8eb0bfd53a5a2757eb3e342e731bfc960b869aa0ab6b3
02
0000006b
48
3045022100ae11d3c92a501496381aa7eaf10ef458f4aabdd3075233ae70d9d32f6b83d812022053aa4171e3d2b58465dde42d07ba4e5f74948b2cdb01a67dfdac4e4eb24b684901
21
0382df61bad93a1211ceac5c78fd273d65e405a7e148e068ced3e40bf87cf71721
ffffffff
03 输出数量
6a5a0d0000000000 875114
19
76
a9
14
c6734676a08e3c6438bd95fa62c57939c988a17b 1K6JtSvrHtyFmxdtGZyZEF7ydytTGqasNc
88
ac
0000000000000000
16
6a
14
6f6d6e69
0000000000000002
0000000000989680
2202000000000000 546
19
76
a9
14
ee692ea81da1b12d3dd8f53fd504865c9d843f52 1Njbpr7EkLA1R8ag8bjRN7oks7nv5wUn3o
88
ac
00000000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment