[go: up one dir, main page]

Proto/Client/Signer: Add a prove_possession request for BLS keys

What

Create a prove_possession/<PKH> request in the signer, make the client call it when the user updates it consensus key and use the new client functions as well as pop_verify in the protocol.

Why

Proof of possession is required for BLS to avoid "rogue keys" attacks.

Before this merge request, this proof of possession relied on a generic operation. But bakers might use a signer which is configured to not sign generic operation, for safety reason, hence this specific request to allow it to be signed without accepting arbitrary operations to be signed.

How

By creating a signer request Prove_possession of pkh, implementing the prove_possession function in all modules implementing the Signer interface and call this prove_possession function in the client and plug it in the Client_proto_context of the protocol.

Manually testing the MR

Checklist

# Lauch sandbox L1 node
./src/bin_node/octez-sandboxed-node.sh 1 --connections 0

In a second terminal:

# Put ourself in the sandbox context (1 in previous and next commands are related. Any digit can be used).
eval `./src/bin_client/octez-init-sandboxed-client.sh 1`
# Generate a BLs key
octez-signer gen keys test_key -s bls
# See addresses known by the signer
octez-signer list known addresses
# Launch a "remote" signer which only accepts attestations
octez-signer launch http signer --magic-bytes 0x12

In a third terminal:

# Put ourself in the sandbox context.
eval `./src/bin_client/octez-init-sandboxed-client.sh 1`
# Activate protocol alpha
octez-activate-alpha
# Import secret key from signer
octez-client import secret key toto http://localhost:6732/THE_TZN_YOU_WANT_TO_IMPORT
# You can see that toto key is known by the client
octez-client list known addresses
# Fund toto (wait none is required to not have to wait for next block to come (it will never come in sandbox mode) and burn-cap is required since toto is a new address, which requires some space to be registered on chain)
octez-client --wait none transfer 200000 from bootstrap1 to toto --burn-cap 1
octez-client bake for --minimal-timestamp
octez-client --wait none set consensus key for bootstrap1 to toto

should work.

Merge request reports

Loading