From 4698ba94c9fb648965448cbe2455486571058bee Mon Sep 17 00:00:00 2001 From: EthanYuan Date: Tue, 11 Jun 2024 23:53:20 +0800 Subject: [PATCH 1/6] update spv lib to support signet --- Cargo.lock | 4 ++-- checksums.txt | 2 +- contracts/ckb-bitcoin-spv-type-lock/Cargo.toml | 4 ++-- tests/Cargo.toml | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6d46aab..043fd8d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -233,7 +233,7 @@ checksum = "8b3b72a38c9920a29990df12002c4d069a147c8782f0c211f8a01b2df8f42bfd" [[package]] name = "ckb-bitcoin-spv-prover" version = "0.1.0" -source = "git+https://github.com/ckb-cell/ckb-bitcoin-spv?rev=a13477b#a13477bd12840fc2cd3e606ceea18d52f9c78e9a" +source = "git+https://github.com/EthanYuan/ckb-bitcoin-spv?rev=b81fd00#b81fd00d4b1db127d84ce4c4caed687f126a3234" dependencies = [ "bitcoin", "ckb-bitcoin-spv-verifier", @@ -253,7 +253,7 @@ dependencies = [ [[package]] name = "ckb-bitcoin-spv-verifier" version = "0.1.0" -source = "git+https://github.com/ckb-cell/ckb-bitcoin-spv?rev=a13477b#a13477bd12840fc2cd3e606ceea18d52f9c78e9a" +source = "git+https://github.com/EthanYuan/ckb-bitcoin-spv?rev=b81fd00#b81fd00d4b1db127d84ce4c4caed687f126a3234" dependencies = [ "bitcoin", "bitcoin_hashes", diff --git a/checksums.txt b/checksums.txt index 2183e1a..5f9cf2c 100644 --- a/checksums.txt +++ b/checksums.txt @@ -1,2 +1,2 @@ 6bbea4820329050e1fc65f9c15cab5948b824c73aa3430d7d92b793c53ca66b6 build/release/can-update-without-ownership-lock -037b7d66cbe8fcea2d13a3da6693e2fc14d6510a075dce20ebb7289647077a5e build/release/ckb-bitcoin-spv-type-lock +ac70b097ec5727499adb930e6ae8317c117682b78944e42dc779916e9ef9c4f5 build/release/ckb-bitcoin-spv-type-lock diff --git a/contracts/ckb-bitcoin-spv-type-lock/Cargo.toml b/contracts/ckb-bitcoin-spv-type-lock/Cargo.toml index 4266a1a..b2af72b 100644 --- a/contracts/ckb-bitcoin-spv-type-lock/Cargo.toml +++ b/contracts/ckb-bitcoin-spv-type-lock/Cargo.toml @@ -14,7 +14,7 @@ ckb-hash = { version = "0.112.1", default-features = false, features = ["ckb-con [dependencies.ckb-bitcoin-spv-verifier] version = "0.1.0" -git = "https://github.com/ckb-cell/ckb-bitcoin-spv" -rev = "a13477b" +git = "https://github.com/EthanYuan/ckb-bitcoin-spv" +rev = "b81fd00" default-features = false features = ["no-std"] diff --git a/tests/Cargo.toml b/tests/Cargo.toml index a3c3a95..965a3d3 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -16,10 +16,10 @@ walkdir = "2.4" [dev-dependencies.ckb-bitcoin-spv-prover] version = "0.1.0" -git = "https://github.com/ckb-cell/ckb-bitcoin-spv" -rev = "a13477b" +git = "https://github.com/EthanYuan/ckb-bitcoin-spv" +rev = "b81fd00" [dev-dependencies.ckb-bitcoin-spv-verifier] version = "0.1.0" -git = "https://github.com/ckb-cell/ckb-bitcoin-spv" -rev = "a13477b" +git = "https://github.com/EthanYuan/ckb-bitcoin-spv" +rev = "b81fd00" From bb01e7a723c27e85489e6ab3ce20b874e75a575c Mon Sep 17 00:00:00 2001 From: EthanYuan Date: Wed, 12 Jun 2024 13:08:13 +0800 Subject: [PATCH 2/6] update spv lib dependency. --- Cargo.lock | 4 ++-- contracts/ckb-bitcoin-spv-type-lock/Cargo.toml | 4 ++-- tests/Cargo.toml | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 043fd8d..9e7eeae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -233,7 +233,7 @@ checksum = "8b3b72a38c9920a29990df12002c4d069a147c8782f0c211f8a01b2df8f42bfd" [[package]] name = "ckb-bitcoin-spv-prover" version = "0.1.0" -source = "git+https://github.com/EthanYuan/ckb-bitcoin-spv?rev=b81fd00#b81fd00d4b1db127d84ce4c4caed687f126a3234" +source = "git+https://github.com/ckb-cell/ckb-bitcoin-spv?rev=bfc71d7#bfc71d7daf17e96f34e8e287f45254e512383330" dependencies = [ "bitcoin", "ckb-bitcoin-spv-verifier", @@ -253,7 +253,7 @@ dependencies = [ [[package]] name = "ckb-bitcoin-spv-verifier" version = "0.1.0" -source = "git+https://github.com/EthanYuan/ckb-bitcoin-spv?rev=b81fd00#b81fd00d4b1db127d84ce4c4caed687f126a3234" +source = "git+https://github.com/ckb-cell/ckb-bitcoin-spv?rev=bfc71d7#bfc71d7daf17e96f34e8e287f45254e512383330" dependencies = [ "bitcoin", "bitcoin_hashes", diff --git a/contracts/ckb-bitcoin-spv-type-lock/Cargo.toml b/contracts/ckb-bitcoin-spv-type-lock/Cargo.toml index b2af72b..e2db34f 100644 --- a/contracts/ckb-bitcoin-spv-type-lock/Cargo.toml +++ b/contracts/ckb-bitcoin-spv-type-lock/Cargo.toml @@ -14,7 +14,7 @@ ckb-hash = { version = "0.112.1", default-features = false, features = ["ckb-con [dependencies.ckb-bitcoin-spv-verifier] version = "0.1.0" -git = "https://github.com/EthanYuan/ckb-bitcoin-spv" -rev = "b81fd00" +git = "https://github.com/ckb-cell/ckb-bitcoin-spv" +rev = "bfc71d7" default-features = false features = ["no-std"] diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 965a3d3..fd4959a 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -16,10 +16,10 @@ walkdir = "2.4" [dev-dependencies.ckb-bitcoin-spv-prover] version = "0.1.0" -git = "https://github.com/EthanYuan/ckb-bitcoin-spv" -rev = "b81fd00" +git = "https://github.com/ckb-cell/ckb-bitcoin-spv" +rev = "bfc71d7" [dev-dependencies.ckb-bitcoin-spv-verifier] version = "0.1.0" -git = "https://github.com/EthanYuan/ckb-bitcoin-spv" -rev = "b81fd00" +git = "https://github.com/ckb-cell/ckb-bitcoin-spv" +rev = "bfc71d7" From 6891e15aec2fa8773819da6b74871bbf8aa9b784 Mon Sep 17 00:00:00 2001 From: EthanYuan Date: Wed, 12 Jun 2024 13:13:41 +0800 Subject: [PATCH 3/6] update ckb-bitcoin-spv-type-lock to v0.2.0 --- Cargo.lock | 2 +- checksums.txt | 2 +- contracts/ckb-bitcoin-spv-type-lock/Cargo.toml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9e7eeae..7d2b124 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -243,7 +243,7 @@ dependencies = [ [[package]] name = "ckb-bitcoin-spv-type-lock" -version = "0.1.0" +version = "0.2.0" dependencies = [ "ckb-bitcoin-spv-verifier", "ckb-hash", diff --git a/checksums.txt b/checksums.txt index 5f9cf2c..3d25bfd 100644 --- a/checksums.txt +++ b/checksums.txt @@ -1,2 +1,2 @@ 6bbea4820329050e1fc65f9c15cab5948b824c73aa3430d7d92b793c53ca66b6 build/release/can-update-without-ownership-lock -ac70b097ec5727499adb930e6ae8317c117682b78944e42dc779916e9ef9c4f5 build/release/ckb-bitcoin-spv-type-lock +eaa9e3aeb1205e611078a819e960c33f4934ea49029aab3445a241955e696ee1 build/release/ckb-bitcoin-spv-type-lock diff --git a/contracts/ckb-bitcoin-spv-type-lock/Cargo.toml b/contracts/ckb-bitcoin-spv-type-lock/Cargo.toml index e2db34f..7bd11d6 100644 --- a/contracts/ckb-bitcoin-spv-type-lock/Cargo.toml +++ b/contracts/ckb-bitcoin-spv-type-lock/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ckb-bitcoin-spv-type-lock" -version = "0.1.0" +version = "0.2.0" authors = ["Boyu Yang "] edition = "2021" license = "MIT" @@ -17,4 +17,4 @@ version = "0.1.0" git = "https://github.com/ckb-cell/ckb-bitcoin-spv" rev = "bfc71d7" default-features = false -features = ["no-std"] +features = ["no-std"] \ No newline at end of file From ee4d11ae440660582e53965217864511b1f03590 Mon Sep 17 00:00:00 2001 From: EthanYuan Date: Wed, 12 Jun 2024 14:04:25 +0800 Subject: [PATCH 4/6] update readme, add flags description --- contracts/ckb-bitcoin-spv-type-lock/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contracts/ckb-bitcoin-spv-type-lock/README.md b/contracts/ckb-bitcoin-spv-type-lock/README.md index 6c304d7..f9f0c34 100644 --- a/contracts/ckb-bitcoin-spv-type-lock/README.md +++ b/contracts/ckb-bitcoin-spv-type-lock/README.md @@ -45,6 +45,11 @@ A Bitcoin SPV instance contains two types of cells: **SPV info cell** and **SPV - tip client cell id ``` +- Flags + + Flags is the last part of `args` and takes up one byte. The highest two bits + are used to indicate different btc chain types. see [btc chain type] for details. + ### Operations There are 4 kinds of operations in the Bitcoin SPV type script: @@ -239,3 +244,5 @@ To verify a transaction using the Bitcoin SPV Client cell, follow these steps: [Section "Code Locating"]: https://github.com/nervosnetwork/rfcs/blob/v2020.01.15/rfcs/0022-transaction-structure/0022-transaction-structure.md#code-locating [CKB RFC 0032]: https://github.com/nervosnetwork/rfcs/blob/dff5235616e5c7aec706326494dce1c54163c4be/rfcs/0032-ckb-vm-version-selection/0032-ckb-vm-version-selection.md#specification [CKB RFC 0051]: https://github.com/nervosnetwork/rfcs/blob/dff5235616e5c7aec706326494dce1c54163c4be/rfcs/0051-ckb2023/0051-ckb2023.md#ckb-vm-v2 + +[btc chain type]: https://github.com/ckb-cell/ckb-bitcoin-spv/blob/bfc71d7daf17e96f34e8e287f45254e512383330/verifier/src/constants.rs#L3 \ No newline at end of file From 555868ff120185b23e79f42875ef25dfae5366cc Mon Sep 17 00:00:00 2001 From: EthanYuan Date: Wed, 12 Jun 2024 14:17:17 +0800 Subject: [PATCH 5/6] update readme. --- contracts/ckb-bitcoin-spv-type-lock/README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/contracts/ckb-bitcoin-spv-type-lock/README.md b/contracts/ckb-bitcoin-spv-type-lock/README.md index f9f0c34..4fd9c1c 100644 --- a/contracts/ckb-bitcoin-spv-type-lock/README.md +++ b/contracts/ckb-bitcoin-spv-type-lock/README.md @@ -48,7 +48,13 @@ A Bitcoin SPV instance contains two types of cells: **SPV info cell** and **SPV - Flags Flags is the last part of `args` and takes up one byte. The highest two bits - are used to indicate different btc chain types. see [btc chain type] for details. + are used to indicate different btc chain types. The supported chain types are: + + - Mainnet + - Testnet + - Signet + + see [BTC chain type] for details. ### Operations From e76b9c63d35821d0d9507556d0f111fae9dcb78d Mon Sep 17 00:00:00 2001 From: Chengxing Yuan Date: Wed, 12 Jun 2024 14:30:26 +0800 Subject: [PATCH 6/6] Update contracts/ckb-bitcoin-spv-type-lock/README.md Co-authored-by: Flouse <1297478+Flouse@users.noreply.github.com> --- contracts/ckb-bitcoin-spv-type-lock/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/ckb-bitcoin-spv-type-lock/README.md b/contracts/ckb-bitcoin-spv-type-lock/README.md index 4fd9c1c..3fe4a44 100644 --- a/contracts/ckb-bitcoin-spv-type-lock/README.md +++ b/contracts/ckb-bitcoin-spv-type-lock/README.md @@ -47,7 +47,7 @@ A Bitcoin SPV instance contains two types of cells: **SPV info cell** and **SPV - Flags - Flags is the last part of `args` and takes up one byte. The highest two bits + [Flags](https://github.com/ckb-cell/ckb-bitcoin-spv/blob/bfc71d7daf17e96f34e8e287f45254e512383330/verifier/schemas/types.mol#L58) is the last part of `args` and takes up one byte. The highest two bits are used to indicate different btc chain types. The supported chain types are: - Mainnet