From f8e5304dc6407e1a26b9334592929a84a3cf1283 Mon Sep 17 00:00:00 2001 From: danieljperry Date: Thu, 14 Mar 2024 15:43:52 +0800 Subject: [PATCH 1/3] Add new CHIP for Wallet signer BLOB subdivision --- CHIPs/chip-wallet-signer-subdivision.md | 62 +++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 CHIPs/chip-wallet-signer-subdivision.md diff --git a/CHIPs/chip-wallet-signer-subdivision.md b/CHIPs/chip-wallet-signer-subdivision.md new file mode 100644 index 00000000..8444ca57 --- /dev/null +++ b/CHIPs/chip-wallet-signer-subdivision.md @@ -0,0 +1,62 @@ +CHIP Number | < Creator must leave this blank. Editor will assign a number.> +:-------------|:---- +Title | Wallet signer BLOB subdivision +Description | A standard technique for subdividing (chunking) BLOB data used in the wallet signer protocol +Author | [Matt Hauff](https://github.com/Quexington) +Editor | [Dan Perry](https://github.com/danieljperry) +Comments-URI | < Creator must leave this blank. Editor will assign a URI.> +Status | < Creator must leave this blank. Editor will assign a status.> +Category | Process +Sub-Category | Tooling +Created | 2024-03-14 +Requires | [0027](https://github.com/Chia-Network/chips/pull/102) +Replaces | None +Superseded-By | None + +## Abstract + +[CHIP-0029](https://github.com/Chia-Network/chips/pull/104) provides a method for serializing JSON data from the APIs laid out in [CHIP-0027](https://github.com/Chia-Network/chips/pull/102) into binary large object (BLOB) data. This CHIP provides a method for subdividing BLOB data into multiple chunks. + +## Motivation + +BLOBs used in the Chia wallet signer protocol can be too large to send in one piece. Therefore, a method is needed to subdivide, or "chunk" the data into multiple pieces. For now, this method is only used with QR codes, but in the future it could be applied more broadly to other types of BLOBs. + +## Backwards Compatibility + +This CHIP does not introduce any backwards incompatibilities. + +## Specification + +The primary method is called `create_chunks_for_blob`: + +**ARGUMENTS** +```py +blob: bytes +bytes_per_chunk: int +``` + +**RETURNS** +The `blob`, broken into chunks of size `bytes_per_chunk`. + +Each chunk is appended with [`x`, `y`], where `x` is the current chunk number, and `y` is the total number of chunks. + +--- + +## Test Cases + +[todo] + +## Reference Implementation + +This CHIP is implemented in the `hsms` GitHub repository, under [byte_chunks.py](https://github.com/Chia-Network/hsms/blob/a0e6ef2752800195d61336fb0c5e6074ee394728/hsms/util/byte_chunks.py) + +## Security + +CNI has conducted an internal security audit of the code from this CHIP's reference implementation. + +## Additional Assets + +None + +## Copyright +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). From 223dce330cbb2723bbcaee619d39a062e3e15f99 Mon Sep 17 00:00:00 2001 From: danieljperry Date: Thu, 14 Mar 2024 15:49:37 +0800 Subject: [PATCH 2/3] Assign CHIP-0030 --- CHIPs/{chip-wallet-signer-subdivision.md => chip-0030.md} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename CHIPs/{chip-wallet-signer-subdivision.md => chip-0030.md} (89%) diff --git a/CHIPs/chip-wallet-signer-subdivision.md b/CHIPs/chip-0030.md similarity index 89% rename from CHIPs/chip-wallet-signer-subdivision.md rename to CHIPs/chip-0030.md index 8444ca57..1cd5885e 100644 --- a/CHIPs/chip-wallet-signer-subdivision.md +++ b/CHIPs/chip-0030.md @@ -1,11 +1,11 @@ -CHIP Number | < Creator must leave this blank. Editor will assign a number.> +CHIP Number | 0030 :-------------|:---- Title | Wallet signer BLOB subdivision Description | A standard technique for subdividing (chunking) BLOB data used in the wallet signer protocol Author | [Matt Hauff](https://github.com/Quexington) Editor | [Dan Perry](https://github.com/danieljperry) -Comments-URI | < Creator must leave this blank. Editor will assign a URI.> -Status | < Creator must leave this blank. Editor will assign a status.> +Comments-URI | [CHIPs repo, PR #105](https://github.com/Chia-Network/chips/pull/105) +Status | Draft Category | Process Sub-Category | Tooling Created | 2024-03-14 From 584667939d1c81083fcd351b6dd192ecc8b6b9b7 Mon Sep 17 00:00:00 2001 From: danieljperry Date: Fri, 6 Sep 2024 16:36:27 +0800 Subject: [PATCH 3/3] Move CHIP-30 to Review --- CHIPs/chip-0030.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/CHIPs/chip-0030.md b/CHIPs/chip-0030.md index 1cd5885e..957cd24f 100644 --- a/CHIPs/chip-0030.md +++ b/CHIPs/chip-0030.md @@ -5,7 +5,7 @@ Description | A standard technique for subdividing (chunking) BLOB data used i Author | [Matt Hauff](https://github.com/Quexington) Editor | [Dan Perry](https://github.com/danieljperry) Comments-URI | [CHIPs repo, PR #105](https://github.com/Chia-Network/chips/pull/105) -Status | Draft +Status | Review Category | Process Sub-Category | Tooling Created | 2024-03-14 @@ -42,10 +42,6 @@ Each chunk is appended with [`x`, `y`], where `x` is the current chunk number, a --- -## Test Cases - -[todo] - ## Reference Implementation This CHIP is implemented in the `hsms` GitHub repository, under [byte_chunks.py](https://github.com/Chia-Network/hsms/blob/a0e6ef2752800195d61336fb0c5e6074ee394728/hsms/util/byte_chunks.py)