Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why do we give out validator signing keys via the RPC? #3270

Open
hrxi opened this issue Feb 5, 2025 · 0 comments
Open

Why do we give out validator signing keys via the RPC? #3270

hrxi opened this issue Feb 5, 2025 · 0 comments

Comments

@hrxi
Copy link
Contributor

hrxi commented Feb 5, 2025

I think it's not considered good practice to provide cryptographic material via some RPC method, but we currently do it:

async fn get_signing_key(&mut self) -> RPCResult<String, (), Self::Error> {
Ok(hex::encode(self.validator.signing_key.read().private.serialize_to_vec()).into())
}
async fn get_voting_key(&mut self) -> RPCResult<String, (), Self::Error> {
Ok(hex::encode(
self.validator
.voting_keys
.read()
.get_current_key()
.secret_key
.serialize_to_vec(),
)
.into())
}
async fn get_voting_keys(&mut self) -> RPCResult<Vec<String>, (), Self::Error> {
Ok(self
.validator
.voting_keys
.read()
.get_keys()
.into_iter()
.map(|key| hex::encode(key.secret_key.serialize_to_vec()))
.collect::<Vec<String>>()
.into())
}

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

No branches or pull requests

1 participant