Enhancement: Migrate to native Ed25519 signatures and public-key address derivation
メンテナーはふだん 2 日以内に返信
@sohanjadyal がすでに取り組んでいます。
2026年10月16日 から。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- java
- 領域
- backend, cryptography
調査の方向性
Start with Main.java, Transaction.java, and Blockchain.java to trace key generation, signing, address validation, and CLI wallet handling; then review BlockchainTest.java, SignatureTamperingTest.java, and ReadmeRulesTest.java. Implementing the proposed migration spans identity, transaction validation, wallet behavior, and existing tests. Done means Ed25519 signatures verify, mismatched sender addresses are rejected, recipients can receive spendable funds, and the listed tests cover the changes.
索引モデルが issue の本文から書いたものです。
説明
Summary
The current cryptographic identity implementation in mini-chain relies on deprecated 1024-bit RSA keys and allows accounts to use arbitrary human-readable string aliases (e.g., "Alice", "Asha").
This architecture introduces two primary vulnerabilities:
- Deprecated Cryptography: 1024-bit RSA keys and signatures are bulky, slow, and cryptographically deprecated. Modern blockchains exclusively utilize Elliptic Curve cryptography (such as Ed25519 or secp256k1).
- Name Squatting & Front-Running: In
Blockchain.java, the chain associates an arbitrary username with whichever public key is submitted first inknownKeys. A malicious participant can observe a pending transaction or front-run an identity, registering another user's name with their own key.
This issue proposes migrating key pairs and digital signatures to Java 17's native Ed25519 algorithm, deriving account addresses cryptographically from public keys, and ensuring recipient wallets are automatically initialized in the CLI.
Current Behavior & Code References
- RSA-1024 Key Generation & Signatures:
Main.java(L21–22):KeyPairGenerator.getInstance("RSA")with 1024-bit key length.Transaction.java(L30, L44):Signature.getInstance("SHA256withRSA").
- Vulnerable Plaintext Key Binding:
Blockchain.java(L38–43):
BecausePublicKey known = knownKeys.get(tx.from()); if (known == null) { knownKeys.put(tx.from(), tx.senderKey()); } else if (!known.equals(tx.senderKey())) { throw new IllegalArgumentException("Transaction uses a different key..."); }tx.from()is an arbitrary string, anyone can claim and lock another user's name before that user broadcasts their first transaction.
Proposed Solution
1. Upgrade Signatures to Native Java 17 Ed25519
- Migrate key generation and signing to
Ed25519(EdDSA) with zero external dependencies:KeyPairGenerator generator = KeyPairGenerator.getInstance("Ed25519"); Signature sig = Signature.getInstance("Ed25519"); - Produces compact 32-byte public keys and 64-byte signatures natively supported in Java 17+.
2. Cryptographic Address Derivation
- Add a helper method in
Blockchain/Transaction:public static String deriveAddress(PublicKey key) { // Hex-encoded SHA-256 digest of key.getEncoded() ... } - Enforce in
Blockchain.addTransaction()that for non-network transactions:tx.from()must match the derived address oftx.senderKey().- Eliminates arbitrary username hijacking and front-running.
3. Recipient Wallet Handling in CLI (Main.java)
- Update CLI address resolution so users can continue interacting with friendly names while underlying transactions bind cryptographically:
- Map names to wallets locally in
wallets.dat. - When sending to a new recipient name, automatically generate and save their wallet key pair (
getWallet(to)) so funds sent to any user remain spendable.
- Map names to wallets locally in
4. Unit & Integration Tests
- Update all test cases in
BlockchainTest.java,SignatureTamperingTest.java, andReadmeRulesTest.javato useEd25519. - Add tests verifying:
- Valid
Ed25519signing and verification. - Rejection of transactions where
fromdoes not match the derived address ofsenderKey. - Front-running protection across accounts.
- Valid
- 主要言語
- Java
- スター
- 0
- フォーク
- 3
- 平均マージ
- 1日 22時間
- マージ済み PR(30日)
- 10
環境構築
- 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 名 ·
メンテナーはふだん 2 日以内に返信
-
README says changing Block or Transaction makes chain.dat stop loading, but adding a field or method still loads it対応中かも @tanujb03 が 7 日前に担当しました。 オープンdocumentation good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 25/100
techcsispit/mini-chain#21 ·
メンテナーはふだん 2 日以内に返信
-
Blockchain: a payment that was already mined can be submitted again, and it is accepted and mined a second time対応中かも @tanujb03 が 7 日前に担当しました。 オープンbug good first issue
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
techcsispit/mini-chain#16 ·
メンテナーはふだん 2 日以内に返信
-
A signed payment can be altered (payee and amount) and still pass signature verification対応中かも @tanujb03 が 7 日前に担当しました。 オープンadvanced bug
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
techcsispit/mini-chain#15 ·
メンテナーはふだん 2 日以内に返信
techcsispit/mini-chain の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
apache/rocketmq-dashboard#6896 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
OpenIntegrationEngine/engine#496 ·
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
SasanLabs/VulnerableApp#836 ·
メンテナーはふだん 1 日以内に返信