Enhancement: Implement binary Merkle tree root in Block header
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- java
調査の方向性
Start with Block.java, Transaction.java, Blockchain.java, and Main.java to trace how transaction data is hashed, addresses are assigned, and RSA keys sign transactions. Then review BlockchainTest.java and Storage.java for the affected behavior. Done means transaction hashes include all listed fields, blocks use a Merkle root, addresses derive from public keys, and signing uses Ed25519 with updated tests and storage.
索引モデルが issue の本文から書いたものです。
説明
Summary
Currently, Block hashes transactions by directly concatenating the transaction list string representation (+ transactions) into the header hash string:
String content = index + "|" + timestamp + "|" + previousHash + "|" + nonce + "|" + transactions;
This means the block header size grows linearly with the number of transactions, proof-of-work mining re-hashes the entire transaction text on every nonce attempt, and transactions are not organized into a cryptographic accumulator tree.
This issue proposes introducing a standard binary Merkle tree to summarize block transactions into a fixed 32-byte merkleRoot stored directly in the block header.
Current Problem & Proposed Solution
1. Merkle Tree Root in Block Header
- Location:
Block.java&Blockchain.java - Current Behavior: Block hashing relies on raw list string concatenation.
- Problem:
- Header size scales with the number of transactions instead of remaining constant.
- Mining has to hash the full transaction list across every nonce attempt.
- Blocks cannot support lightweight verification (SPV) without downloading the entire transaction list.
- Proposed Solution:
- Implement a binary Merkle tree computation (
Block.computeMerkleRoot(List<Transaction>)) with odd-leaf duplication, returning a 32-byte SHA-256 root. - Store
merkleRootin theBlockheader and include it incomputeHash(). - Verify Merkle root integrity in
Blockchain.isValid(). - Bump
Block.serialVersionUIDfrom2Lto3Lto prevent silent deserialization issues with olderchain.datfiles, and document this inREADME.md.
- Implement a binary Merkle tree computation (
Action Items
- Implement
Block.computeMerkleRoot(List<Transaction>)handling empty lists, single items, and odd-leaf duplication. - Add
merkleRootfield toBlockand replacetransactionsincomputeHash(). - Verify
merkleRootmatches computed transaction root inBlockchain.isValid(). - Bump
Block.serialVersionUIDto3Land document inREADME.md. - Add unit tests verifying Merkle tree calculations across different transaction counts and tamper detection.
- 主要言語
- Java
- スター
- 0
- フォーク
- 3
- 平均マージ
- 16時間 38分
- マージ済み PR(30日)
- 7
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
techcsispit/mini-chain のほかの issue
-
Enhancement: Deterministic transaction hashing across all record fields対応中かも @sohanjadyal が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
techcsispit/mini-chain#29 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Tests: no test covers a payment of 0 or the genesis block meeting the difficulty対応中かも @tanujb03 が 6 日前に担当しました。 オープンgood first issue tests
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
techcsispit/mini-chain#23 ·
メンテナーはふだん 1 日以内に返信
-
README says changing Block or Transaction makes chain.dat stop loading, but adding a field or method still loads it対応中かも @tanujb03 が 6 日前に担当しました。 オープンdocumentation good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 25/100
techcsispit/mini-chain#21 ·
メンテナーはふだん 1 日以内に返信
-
BlockchainTest: signature tampering tests pass on the hash check; Block.mine() is a no-op so signature verification is not tested対応中かも @tanujb03 が 6 日前に担当しました。 オープンgood first issue tests
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
techcsispit/mini-chain#19 ·
メンテナーはふだん 1 日以内に返信
-
Blockchain: a payment that was already mined can be submitted again, and it is accepted and mined a second time対応中かも @tanujb03 が 6 日前に担当しました。 オープンbug good first issue
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
techcsispit/mini-chain#16 ·
メンテナーはふだん 1 日以内に返信
techcsispit/mini-chain の issue をすべて見る
似ている issue
-
Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
MinecraftForge/MinecraftForge#10902 · コメント 1 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
refinedmods/refinedstorage2#1421 ·
-
StepExamBenchmarkTest runs a loop and prints a timing but asserts nothing対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンjules
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
open-learning-exchange/myplanet#18199 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
Scheme-less stream URLs throw NullPointerException instead of URISyntaxException対応中かも @blihio が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
pedroSG94/RootEncoder#2218 ·
メンテナーはふだん 3 日以内に返信