Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Enhancement: Implement binary Merkle tree root in Block header

オープン
#27 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@sohanjadyal がすでに取り組んでいます。

2026年10月13日 から。

  • #28 @sohanjadyal による — オープン

評価

難易度
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 の本文から書いたものです。

説明

advanced feature

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:
    1. Header size scales with the number of transactions instead of remaining constant.
    2. Mining has to hash the full transaction list across every nonce attempt.
    3. Blocks cannot support lightweight verification (SPV) without downloading the entire transaction list.
  • Proposed Solution:
    1. Implement a binary Merkle tree computation (Block.computeMerkleRoot(List<Transaction>)) with odd-leaf duplication, returning a 32-byte SHA-256 root.
    2. Store merkleRoot in the Block header and include it in computeHash().
    3. Verify Merkle root integrity in Blockchain.isValid().
    4. Bump Block.serialVersionUID from 2L to 3L to prevent silent deserialization issues with older chain.dat files, and document this in README.md.

Action Items

  • Implement Block.computeMerkleRoot(List<Transaction>) handling empty lists, single items, and odd-leaf duplication.
  • Add merkleRoot field to Block and replace transactions in computeHash().
  • Verify merkleRoot matches computed transaction root in Blockchain.isValid().
  • Bump Block.serialVersionUID to 3L and document in README.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 ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

techcsispit/mini-chain のほかの issue

techcsispit/mini-chain の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。