Skip to content

feat: Add public key to Block Header#2128

Merged
bobbinth merged 42 commits intonextfrom
sergerad-block-header-sig
Dec 10, 2025
Merged

feat: Add public key to Block Header#2128
bobbinth merged 42 commits intonextfrom
sergerad-block-header-sig

Conversation

@sergerad
Copy link
Contributor

@sergerad sergerad commented Dec 1, 2025

Context

Canonical block headers will require signatures of their contents from the validator.

The block headers need to contain the public key of the designated validator. Block headers need to provide a means to be signed by the designated validator.

Relates to 0xMiden/node#1316.

Changes

  • Add BlockSigner trait.
  • Replace proof commitment field with public key in BlockHeader.
  • Add signature field to ProvenBlock.

@sergerad sergerad force-pushed the sergerad-block-header-sig branch 2 times, most recently from bc04ed8 to 174b16c Compare December 2, 2025 18:59
@sergerad sergerad force-pushed the sergerad-block-header-sig branch from bd0899d to 95f4ee6 Compare December 3, 2025 22:30
@sergerad sergerad changed the title feat: Add public key and signature to Block Header feat: Add public key to Block Header Dec 3, 2025
@sergerad sergerad force-pushed the sergerad-block-header-sig branch from 95f4ee6 to 51e3888 Compare December 4, 2025 02:26
@sergerad sergerad marked this pull request as ready for review December 4, 2025 08:03
Copy link
Contributor

@PhilippGackstatter PhilippGackstatter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

I left a few comments and questions.

@sergerad
Copy link
Contributor Author

sergerad commented Dec 8, 2025

@PhilippGackstatter the LocalEcdsaSigner did have the benefit of abstracting away nostd support for key generation:

    #[cfg(any(feature = "testing", test))]
    pub fn dummy() -> Self {
        use rand::SeedableRng;
        use rand_chacha::ChaCha20Rng;

        let mut rng = ChaCha20Rng::from_os_rng();
        LocalEcdsaSigner {
            secret_key: ecdsa::SecretKey::with_rng(&mut rng),
        }
    }

Thoughts on how to add a replacement for this now that we impl EcdsaSigner for SecretKey?

@PhilippGackstatter
Copy link
Contributor

Thoughts on how to add a replacement for this now that we impl EcdsaSigner for SecretKey?

Maybe an extension trait feature-gated behind testing? But if that turns out annoying, we can also add back LocalEcdsaSigner, though maybe behind testing, too?

Copy link
Contributor

@PhilippGackstatter PhilippGackstatter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@mmagician mmagician self-requested a review December 8, 2025 18:11
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you! I left some comments inline.

Also, I'm assuming we don't want to introduce the concept of a SignedBlock yet, right?

@sergerad sergerad force-pushed the sergerad-block-header-sig branch from 44a1d3f to a6b9ce7 Compare December 9, 2025 03:02
@sergerad sergerad requested a review from bobbinth December 9, 2025 19:37
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you! I left some comments inline - pretty much all of them are nits (and majority are about renaming "public key" to "validator key").

Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you! A few more minor comments inline.

Copy link
Collaborator

@mmagician mmagician left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I left some nits mostly about the comments.
One thing I'd simplify though is whether we need random_signer.rs at all

@sergerad sergerad force-pushed the sergerad-block-header-sig branch 7 times, most recently from 308ef54 to c862ba0 Compare December 10, 2025 22:10
@bobbinth bobbinth merged commit a5b4b5b into next Dec 10, 2025
57 of 62 checks passed
@bobbinth bobbinth deleted the sergerad-block-header-sig branch December 10, 2025 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants