Feature: Implement Digital Signatures (Public/Private Key Cryptography) for Transactions

クローズ
#13 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

2026年10月9日 から。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java

調査の方向性

Start by reading Transaction.java, Blockchain.java, and BlockchainTest.java to understand transaction creation, validation, and existing test patterns. Then check how chain.dat is serialized and how its compatibility is handled. Done means wallets can generate key pairs, transactions can be signed and verified, invalid or unsigned transactions are rejected, and tests cover valid and forged transactions.

索引モデルが issue の本文から書いたものです。

説明

Description:
Currently, our mini-chain relies entirely on a trust-based system where users manually type in the sender's name when creating a transaction. This means there is no concept of ownership or authentication, and anyone can easily spend someone else's coins by simply typing in their name.

To make this project behave like a real-world blockchain, I believe we should introduce cryptographic authentication to verify the sender of every transaction.

Proposed Solution:
Implement Public/Private key cryptography (e.g., using Java's built-in java.security.KeyPairGenerator with RSA or ECDSA).

  1. Wallets: Create a Wallet concept where every user generates a PrivateKey (used for signing) and a PublicKey (which acts as their network address).
  2. Transaction Signing: When sending coins, the Transaction class should include a new method to generate a digital signature using the sender's PrivateKey.
  3. Transaction Verification: The Transaction class should include a method to verify the signature using the sender's PublicKey.
  4. Validation Logic: Update Blockchain.java so that addTransaction() and isValid() refuse any transactions that do not contain a valid cryptographic signature.
  5. (Optional) Update Main.java to simulate creating a wallet on startup if one doesn't exist.

Acceptance Criteria:

  • A Wallet class (or similar logic) exists to generate KeyPairs.
  • Transaction class stores a digital signature and the sender's Public Key.
  • Transaction has signTransaction(PrivateKey) and verifySignature() methods.
  • Blockchain.java rejects unsigned or improperly signed transactions.
  • BlockchainTest.java includes tests verifying that forged transactions are rejected and valid signatures are accepted.

Additional Context:
This will require a minor change to the Transaction model, which will likely break backward compatibility with older chain.dat files. We should increment the serialVersionUID or warn users to delete their existing .dat files when this is merged.

主要言語
Java
スター
0
フォーク
3
平均マージ
2日 5時間
マージ済み PR(30日)
15

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

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

techcsispit/mini-chain のほかの issue

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

似ている issue

Java の issue をもっと見る

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

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