Open PainterPuppets opened 2 years ago
https://github.com/PainterPuppets/learn-ckb/blob/main/src/homework/sudtTx.ts
https://github.com/PainterPuppets/learn-ckb/blob/main/src/homework/exchangeSudtTx.ts
[x] What is the minimum size of Omni Lock script args? Please explain. A: 22byte, 其中21个byte用于auth,1个byte作为Omnilock arg flag
[x] Is it possible that the witness is empty? Please explain. A: 可以的,omnilock支持acp模式,acp模式允许直接给收款方的cell增加capacity而不用收款方签名
ckb
ckb简介 slide
CKB> tx add-input --tx-hash 0xf8f103344cbb3d2f23cbe61a516583b0dca169ec53134ae26851f6fd69f2d10b --index 0 --tx-file tx.json status: success
CKB> tx add-output --capacity 100 --tx-file tx.json --to-sighash-address ckt1qyqvg2cpzfp4nn4v63zqe3rpdpw0m4je5pgspkn8ak status: success
CKB> tx info --tx-file tx.json [input] ckt1qyqvsv5240xeh85wvnau2eky8pwrhh4jr8ts8vyj37 => 89992.99757236, (data-length: 0, type-script: none, lock-kind: sighash(secp)) [output] ckt1qyqvg2cpzfp4nn4v63zqe3rpdpw0m4je5pgspkn8ak => 100.0, (data-length: 0, type-script: none, lock-kind: sighash(secp)) input_total: 89992.99757236 (CKB) output_total: 100.0 (CKB) tx_fee: 89892.99757236 (CKB)
CKB> tx add-output --capacity 89892 --to-sighash-address ckt1qyqvsv5240xeh85wvnau2eky8pwrhh4jr8ts8vyj37 --tx-file tx.json status: success
CKB> tx info --tx-file tx.json [input] ckt1qyqvsv5240xeh85wvnau2eky8pwrhh4jr8ts8vyj37 => 89992.99757236, (data-length: 0, type-script: none, lock-kind: sighash(secp)) [output] ckt1qyqvg2cpzfp4nn4v63zqe3rpdpw0m4je5pgspkn8ak => 100.0, (data-length: 0, type-script: none, lock-kind: sighash(secp)) [output] ckt1qyqvsv5240xeh85wvnau2eky8pwrhh4jr8ts8vyj37 => 89892.0, (data-length: 0, type-script: none, lock-kind: sighash(secp)) input_total: 89992.99757236 (CKB) output_total: 89992.0 (CKB) tx_fee: 0.99757236 (CKB)
CKB> tx sign-inputs --from-account ckt1qyqvsv5240xeh85wvnau2eky8pwrhh4jr8ts8vyj37 --add-signatures --tx-file tx.json Password:
CKB> tx send --tx-file tx.json 0xd821cca5d4bb6e6049f5b18be643e9ab20afe6b00dce698610f11b67ecdfae85
1,917,808.21917808 / 1800 = 1065.44901065
340.94368340943333 * (594424732800000000 / 4612388749964379586) = 43.939348761976184
(0.00100000 + 0.00001000 + 0.00001000 + 0.00001000 + 0.00039422 + 0.00003140 + 0. 00002140) * 0.6 = 0.000886212
CKB> rpc get_block --hash 0xe14fca3122ae8a6874f1f07d66891196386dbaa2f7f863894518d5456d7df5f1 proposals:
手续费
总手续费 = 1,065.44901066 + 43.93934975 + 0.00088622 + 0.00032152 = 1,109.38956815
Q: Why there is no output of cellbase in blocks 1 to 11 on ckb?
A: 因为cellbase规定区块n的 Cellbase Output 是发放给 N - 11 的区块生产者,在1-11这些区块中没有n - 11的区块生产者,所以不会有cellbase output
ckb难度提交
Q: What is the difference between the meaning of uncle in Ethereum and uncle in CKB?
ckb中挖出叔块没有奖励,但是打包叔块的矿工可以获得奖励。
以太坊中挖出叔块有奖励