feat: Dilithium signatures#1
Open
czareko wants to merge 7 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dilithium (ML-DSA-87, NIST FIPS 204) post-quantum signature support for access keys in NEAR
Protocol feature: Introduce
ProtocolFeature::DilithiumSignaturesenabled from protocol version 202.core/crypto – Cryptographic layer (key types, signatures, verification) - Implemented Dilithium public keys, secret keys, and signatures via
qp-rusty-crystals-dilithium.core/primitives – Transaction and action validation at protocol level - Transactions validated with Dilithium keys based on protocol version (allow only when DilithiumSignatures is enabled).
runtime – Verifying transaction signatures during block execution - Dilithium signatures verified in the verifier.
rosetta-rpc – Rosetta-compatible API (blockchain indexing) - Support
CurveType::DilithiumandSignatureType::Dilithiumin models.tools/mirror – Migration tool between networks - Dilithium keys mapped during migration.
integration-tests – End-to-end tests (transactions, blocks, runtime) - Added
create_runtime_node_with_dilithium()helper with protocol 202, and teststest_add_key_dilithium_runtimeandtest_transfer_signed_by_dilithium_runtime.RuntimeUser – User abstraction for signing and sending transactions - Added
new_with_protocol_version()and pass protocol version from genesis, so tests run with protocol 202.Protocol version: No change to
NIGHTLY_PROTOCOL_VERSION; Dilithium remains in the "not yet in Nightly" bucket (202); tests use explicitprotocol_version = 202.Run tests:
cargo test --package integration-tests --features test_features -- dilithium --show-outputTODO (Optional)
derive_dilithium_implicit_account_id,AccountType::DilithiumImplicitAccount, runtime handling inaction_implicit_account_creation_transfer. Requires format for account ID (e.g. prefix0d+ hex).public_key_kind = 2) in the ETH-style wallet contract ABI and verification logic.Commands for local run:
Init: cargo run --profile dev-release -p neard -- init
Start: cargo run --profile dev-release -p neard -- run