Godwoken 存款请求(deposit-lock)约束Godwoken deposit request (deposit-lock) Constraints
来源:godwokenrises/godwoken @c2b1f85 / gwos/contracts/deposit-lock/src/entry.rs · 部署:godwoken-info @8ce6390 mainnet_v1 / testnet_v1_1Source: godwokenrises/godwoken @c2b1f85 / gwos/contracts/deposit-lock/src/entry.rs · deployments: godwoken-info @8ce6390 mainnet_v1 / testnet_v1_1
Godwoken
- 官网Websitegodwoken.com
- 文档Docsdocs.godwoken.io
- GitHubGitHubgithub.com/godwokenrises
- XXx.com/godwokenrises
来源:Source: godwoken repo homepage + README; website and X from the godwokenrises GitHub org profile
0 → 1发起存款Request deposit
Inputs 输入Inputs
input[0] 用户 cellinput[0] user cellCell{
capacity: ≥ amount,
lock: user lock (hash = owner_lock_hash),
type: null | sUDT,
data: …
}
➜
Outputs 输出Outputs
output[0] deposit celloutput[0] deposit cellCell{
capacity: CKB to deposit,
lock: { DEPOSIT_LOCK, hashType: type, args: rollup_type_hash ‖ DepositLockArgs },
type: null | sUDT,
data: 0x | sUDT amount
}
// creating a lock runs no script
args = rollup_type_hash ‖ DepositLockArgs(molecule table)args = rollup_type_hash ‖ DepositLockArgs (molecule table)
rollup_type_hash32B
owner_lock_hash32B
layer2_lockScript
cancel_timeout8B LE
registry_id4B LE
- rollup_type_hash 32B 目标 rollup cell 的 type hashtype hash of the target rollup cell ≥ 32B (5)
- owner_lock_hash 32B L1 所有者 lock hash(取消时需此 lock 的输入)L1 owner lock hash (cancel needs an input under it) (8)
- layer2_lock Script 存入后 L2 账户的 lock 脚本lock script of the L2 account to credit
- cancel_timeout 8B LE since 值:超过后用户可取回since value after which the user may cancel since flags 相同且 ≥same since flags and ≥ (6)
- registry_id 4B LE L2 地址注册表 idL2 address registry id
rollup_type_hash0x40d73f0d…(32B)
DepositLockArgs0xa900000014000000… ← total size 169, 4 offsets
cancel_timeout0xc000000000093a80 ← relative timestamp 604800 s (7 d)
限制Constraints
- —:: 创建时不执行;规则在花费时与 state-validator 中检查not run at creation; checked when spent and by state-validator (—)
1 → 0被 rollup 收录Collected by the rollup
Inputs 输入Inputs
input[0] rollup cellinput[0] rollup cellCell{
capacity: R,
lock: rollup lock (mainnet: omni_lock deployment),
type: { codeHash: STATE_VALIDATOR, hashType: type, args: type_id 32B },
data: GlobalState (190B)
}
// type hash == args[0..32]
input[1] deposit cellinput[1] deposit cellCell{
capacity: D,
lock: DEPOSIT_LOCK(rollup_type_hash ‖ args),
type: null | sUDT,
data: …
}
➜
Outputs 输出Outputs
output[0] rollup cell′output[0] rollup cell′Cell{
capacity: R,
lock: rollup lock (mainnet: omni_lock deployment),
type: { codeHash: STATE_VALIDATOR, hashType: type, args: type_id 32B },
data: GlobalState (190B)
}
output[…] custodian celloutput[…] custodian cellCell{
capacity: D,
lock: CUSTODIAN_LOCK(…deposit_lock_args),
type: same,
data: same
}
cell_depscell_deps
cell_dep:DEPOSIT_LOCK 代码cell_dep: DEPOSIT_LOCK codecode cell (see deployments)
// needed by CKB to run the script
限制Constraints
- args ≥ 32 字节且后续为合法 DepositLockArgs≥ 32 bytes, then a valid DepositLockArgs (5)
- 路径 1path 1:: 输入中有 type hash = rollup_type_hash 的 cell → 通过(其余由 state-validator 检查:26)an input with type hash = rollup_type_hash → pass (the rest is state-validator: 26) (0)
1 → 0超时取消Cancel after timeout
Inputs 输入Inputs
input[0] deposit cellinput[0] deposit cellCell{
since: same flags as cancel_timeout, value ≥ it,
capacity: D,
lock: DEPOSIT_LOCK(rollup_type_hash ‖ args),
type: any,
data: any
}
input[1] 所有者 cellinput[1] owner cellCell{
capacity: any,
lock: lock hash == owner_lock_hash,
type: any,
data: any
}
➜
Outputs 输出Outputs
outputsoutputsany
witnesses(WitnessArgs)witnesses (WitnessArgs)
witnesses[owner 输入]witnesses[owner input]owner lock signature (deposit-lock reads no witness)
限制Constraints
- since:: GroupInput[0] 的 since flags = cancel_timeout flags,且值 ≥GroupInput[0] since has cancel_timeout’s flags and value ≥ (6)
- owner:: 有输入 lock hash = owner_lock_hashan input with lock hash = owner_lock_hash (8)
部署与来源Deployments & source 未核验unverified
源码source godwokenrises/godwoken@c2b1f850 · gwos/contracts/deposit-lock/src/entry.rs · gwos/contracts/gw-utils/src/error.rs (exact commit read (default-branch HEAD, 2024-01-12). Deployment constants from godwokenrises/godwoken-info @8ce6390133ddfffe9d40d51b7be191418b54958c (mainnet_v1, testnet_v1_1 scripts-deploy-result.json).)
二进制核验binary check 未核验unverified no binary or checksum at the recorded commit matched the deployed data hash (reproducible build not attempted)
| 网络network | code_hash | cell_dep | type_id args | 数据哈希data hash | 部署交易deploy tx |
|---|---|---|---|---|---|
| mainnet | 0xff602581f07667eef54232cce850cbca2c418b3418611c132fca849d1edcd775 type | 0x61e576a7e5…68d805b2:0 code | 0x5c6ca761d4…7f64fd35 | 0xf4a3b28cf0…52a766ec | 0x61e576a7e5…68d805b2 #7469198 |
| testnet | 0x50704b84ecb4c4b12b43c7acb260ddd69171c21b4c0ba15f3c469b7d143f6f18 type | 0x9caeec735f…ba6404a2:0 code | 0x86d24e5cb1…6bc6594d | 0xf4a3b28cf0…52a766ec | 0x9caeec735f…ba6404a2 #5292883 |
链上数据核对于 on-chain data checked 2026-10-21
⚠ 状态:官方已宣布 Godwoken 退役(2025-06-01 起,Nervos Talk “Sunset of Force Bridge and Godwoken”);冻结期限延至 2026-01-01 23:59:59 UTC,之后网络冻结、桥前端下线,v0/v1 RPC 节点已关闭。本页仅作历史 / 审计参考。⚠ Status: Godwoken was officially sunset (from 2025-06-01, Nervos Talk “Sunset of Force Bridge and Godwoken”); the freeze deadline was extended to 2026-01-01 23:59:59 UTC, after which the network froze, the bridge UI went offline and v0/v1 RPC nodes were shut down. This page is for historical / audit reference.
错误码(gw-utils/src/error.rs):1 IndexOutOfBound,2 ItemMissing,3 LengthNotEnough,4 Encoding,5 InvalidArgs,6 InvalidSince,7 InvalidOutput,8 OwnerCellNotFound,9 RollupCellNotFound,10 RollupConfigNotFound,11 ProofNotFound,13 MerkleProof,14 AmountOverflow,15 InsufficientAmount,16/17 Insufficient{Input,Output}FinalizedAssets,18 SMTKeyMissing,19 InvalidStateCheckpoint,20 InvalidBlock,21 InvalidStatus,22 InvalidStakeCellUnlock,23 InvalidPostGlobalState,24 InvalidChallengeCell,25 InvalidStakeCell,26 InvalidDepositCell,27 InvalidWithdrawalCell,28 InvalidCustodianCell,29 InvalidRevertedBlocks,30 InvalidChallengeReward,32 InvalidChallengeTarget,33 InvalidWithdrawalRequest,34 UnknownEOAScript,39 InvalidTypeID,41 WrongSignature,43 RegistryAddressNotFound,45 NotFinalized。Error codes (gw-utils/src/error.rs): 1 IndexOutOfBound, 2 ItemMissing, 3 LengthNotEnough, 4 Encoding, 5 InvalidArgs, 6 InvalidSince, 7 InvalidOutput, 8 OwnerCellNotFound, 9 RollupCellNotFound, 10 RollupConfigNotFound, 11 ProofNotFound, 13 MerkleProof, 14 AmountOverflow, 15 InsufficientAmount, 16/17 Insufficient{Input,Output}FinalizedAssets, 18 SMTKeyMissing, 19 InvalidStateCheckpoint, 20 InvalidBlock, 21 InvalidStatus, 22 InvalidStakeCellUnlock, 23 InvalidPostGlobalState, 24 InvalidChallengeCell, 25 InvalidStakeCell, 26 InvalidDepositCell, 27 InvalidWithdrawalCell, 28 InvalidCustodianCell, 29 InvalidRevertedBlocks, 30 InvalidChallengeReward, 32 InvalidChallengeTarget, 33 InvalidWithdrawalRequest, 34 UnknownEOAScript, 39 InvalidTypeID, 41 WrongSignature, 43 RegistryAddressNotFound, 45 NotFinalized.
错误码(gw-utils/src/error.rs):1 IndexOutOfBound,2 ItemMissing,3 LengthNotEnough,4 Encoding,5 InvalidArgs,6 InvalidSince,7 InvalidOutput,8 OwnerCellNotFound,9 RollupCellNotFound,10 RollupConfigNotFound,11 ProofNotFound,13 MerkleProof,14 AmountOverflow,15 InsufficientAmount,16/17 Insufficient{Input,Output}FinalizedAssets,18 SMTKeyMissing,19 InvalidStateCheckpoint,20 InvalidBlock,21 InvalidStatus,22 InvalidStakeCellUnlock,23 InvalidPostGlobalState,24 InvalidChallengeCell,25 InvalidStakeCell,26 InvalidDepositCell,27 InvalidWithdrawalCell,28 InvalidCustodianCell,29 InvalidRevertedBlocks,30 InvalidChallengeReward,32 InvalidChallengeTarget,33 InvalidWithdrawalRequest,34 UnknownEOAScript,39 InvalidTypeID,41 WrongSignature,43 RegistryAddressNotFound,45 NotFinalized。Error codes (gw-utils/src/error.rs): 1 IndexOutOfBound, 2 ItemMissing, 3 LengthNotEnough, 4 Encoding, 5 InvalidArgs, 6 InvalidSince, 7 InvalidOutput, 8 OwnerCellNotFound, 9 RollupCellNotFound, 10 RollupConfigNotFound, 11 ProofNotFound, 13 MerkleProof, 14 AmountOverflow, 15 InsufficientAmount, 16/17 Insufficient{Input,Output}FinalizedAssets, 18 SMTKeyMissing, 19 InvalidStateCheckpoint, 20 InvalidBlock, 21 InvalidStatus, 22 InvalidStakeCellUnlock, 23 InvalidPostGlobalState, 24 InvalidChallengeCell, 25 InvalidStakeCell, 26 InvalidDepositCell, 27 InvalidWithdrawalCell, 28 InvalidCustodianCell, 29 InvalidRevertedBlocks, 30 InvalidChallengeReward, 32 InvalidChallengeTarget, 33 InvalidWithdrawalRequest, 34 UnknownEOAScript, 39 InvalidTypeID, 41 WrongSignature, 43 RegistryAddressNotFound, 45 NotFinalized.