nervosnetwork / ckb-explorer

CKB Explorer
https://explorer.nervos.org/
MIT License
37 stars 42 forks source link

Discussion about the `hash_type` of xUDT script on testnet #2072

Closed Flouse closed 1 month ago

Flouse commented 1 month ago

Description

The current xUDT on pudge.explorer.nervos.org

image https://pudge.explorer.nervos.org/scripts#xUDT

The latest xUDT deployment in RFC-0052 is

image

See https://github.com/nervosnetwork/rfcs/blob/abeb01be8c0b1491ac8a1ab3908416e9ab3cc432/rfcs/0052-extensible-udt/0052-extensible-udt.md#deployment

Describe the solution you'd like

Maybe both the above scripts could be interpreted as xUDT on ckb-testnet-explorer.

Describe alternatives you've considered

Revert the hash_type of xUDT back to type in the latest RFC docs. cc @XuJiandong

References

XuJiandong commented 1 month ago

The current xUDT description on pudge.explorer.nervos.org should use data1 instead of type. It's not upgradeable.

https://github.com/nervosnetwork/rfcs/pull/428#issuecomment-2232264527

Keith-CY commented 1 month ago

I noticed that only code hash and hash type were updated in the RFC while the tx hash is not(https://github.com/nervosnetwork/rfcs/commit/4c6c76284ca7c94faae23f75be4d1d81ce53e20e)

So the script is still deployed at https://pudge.explorer.nervos.org/transaction/0xbf6fb538763efec2a70a6a3dcb7242787087e1030c4e7d86585bc63a9d337f5f outputs[0]

Its data hash matches 0x50bd8d6680b8b9cf98b73f3c08faf8b2a21914311954118ad6609be6e78a1b95, but its type script is of type id and the owner lock is of secp256_k1.

How is the upgrade disabled?

XuJiandong commented 1 month ago

It's for historical reasons. When it was first deployed on the testnet, we wanted it to be upgradable to fix potential bugs. However, once this final version is deployed, it will not be upgraded.

Keith-CY commented 1 month ago

It's for historical reasons. When it was first deployed on the testnet, we wanted it to be upgradable to fix potential bugs. However, once this final version is deployed, it will not be upgraded.

Got it, the script is upgradable but won't be updated anymore.

The script can be referenced by type hash or data hash, and only data hash is suggested and mentioned in the RFC. Am I right?

Keith-CY commented 1 month ago

The reference info of type hash and data hash will be listed simultaneously

image

Because most on-chain use cases are based on type hash

Keith-CY commented 1 month ago

Updated xUDT(final_rls): https://pudge.explorer.nervos.org/script/0x25c29dc317811a6f6f3985a7a9ebc4838bd388d19d0feeecf0bcd60f6c0975bb/type xUDT: https://pudge.explorer.nervos.org/script/0x50bd8d6680b8b9cf98b73f3c08faf8b2a21914311954118ad6609be6e78a1b95/data1