# TZIP + Feature proposal: consensus key

**URL:** <https://forum.tezosagora.org/t/tzip-feature-proposal-consensus-key/4503>\
**Category:** TZIP\
**Created:** [April 25, 2022, 7:03am UTC](https://forum.tezosagora.org/t/tzip-feature-proposal-consensus-key/4503 "2022-04-25T07:03:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicolasochem](https://forum.tezosagora.org/user_avatar/forum.tezosagora.org/nicolasochem/32/544_2.png) [@nicolasochem](https://forum.tezosagora.org/u/nicolasochem)\
**Post date:** [April 25, 2022, 7:03am UTC](https://forum.tezosagora.org/t/tzip-feature-proposal-consensus-key/4503/1 "2022-04-25T07:03:00Z")

</div>

@G_B_Fefe and myself have been working on a protocol proposal called [consensus key](https://gitlab.com/Ochem/tzip/-/blob/consensus_key/drafts/current/draft-consensus-key.md) and would like to suggest it for inclusion in protocol K.

It allows a Tezos baker to use a separate key (the consensus key) to bake and endorse blocks, and rotate it at will, enhancing their operational security.

[One version of the Florence protocol](https://forum.tezosagora.org/t/florence-ba-psflorbar/2829) was doing something like this but it did not get voted in. Our proposal has key differences. It is minimalist by design and implements nothing but the consensus key:

- it does not let smart contacts be bakers,
- it does not change the 10% ratio of self-stake to total stake, or pave the way to doing so,
- it introduces no breaking changes.

More details in the links below:

- [TZIP](https://gitlab.com/Ochem/tzip/-/blob/consensus_key/drafts/current/draft-consensus-key.md)
  - TZIP [motivation](https://gitlab.com/Ochem/tzip/-/blob/consensus_key/drafts/current/draft-consensus-key.md#motivation)
  - TZIP [Q&A](https://gitlab.com/Ochem/tzip/-/blob/consensus_key/drafts/current/draft-consensus-key.md#qa)

- [implementation](https://gitlab.com/g.b.fefe/tezos/-/commits/consensus_key_minimal)
- [testing](https://gist.github.com/nicolasochem/bdf16f37e7ae06679474256e4ed9206d)

Last time, some community members were adamant that the consensus key should be spendable ([see discussion](https://forum.tezosagora.org/t/stateful-baking-accounts/1866)). But in our proposal, the account associated with the consensus key has its own balance separate from the baker’s balance. Therefore, we introduce a new `Drain_delegate` operation that lets the consensus key transfer all the free balance of the baker to themselves. Effectively, this makes the consensus key spendable.

We also introduce a new [governance toggle](https://gitlab.com/Ochem/tzip/-/blob/consensus_key/drafts/current/draft-consensus-key.md#a-new-toggle-vote-drain-toggle-vote) to allow a majority of bakers (by stake) to disable this `Drain_delegate` operation later, shall they prefer the consensus key not being spendable.

If the community’s position has changed, we can also resubmit a simpler version of this proposal without the `Drain_delegate` operation and the governance toggle. The consensus key would be non-spendable from the get-go in this case. Please let us know.

We are attaching an invoice to this proposal. The proposed amounts are 30,000 tez to G.-B. Fefe and 20,000 tez to [MIDL.dev](http://midl.dev/) (my company), credited to our respective accounts at protocol activation, shall this proposal be part of it.

---

<div class="post-metadata">

**Author:** ![murbard](https://forum.tezosagora.org/user_avatar/forum.tezosagora.org/murbard/32/67_2.png) [@murbard](https://forum.tezosagora.org/u/murbard)\
**Post date:** [April 25, 2022, 9:29am UTC](https://forum.tezosagora.org/t/tzip-feature-proposal-consensus-key/4503/2 "2022-04-25T09:29:50Z")

</div>

Have you ensured that key rotation cannot be used in a hidden branch shorter than the no-fork point to escape slashing?

---

<div class="post-metadata">

**Author:** ![G\_B\_Fefe](https://forum.tezosagora.org/letter_avatar_proxy/v4/letter/g/57b2e6/32.png) [@G\_B\_Fefe](https://forum.tezosagora.org/u/G_B_Fefe)\
**Post date:** [April 25, 2022, 9:52am UTC](https://forum.tezosagora.org/t/tzip-feature-proposal-consensus-key/4503/3 "2022-04-25T09:52:49Z")

</div>

Consensus key updates are delayed by `PRESERVED_CYCLE + 1`.

---

<div class="post-metadata">

**Author:** ![iguerNL](https://forum.tezosagora.org/user_avatar/forum.tezosagora.org/iguernl/32/1582_2.png) [@iguerNL](https://forum.tezosagora.org/u/iguerNL)\
**Post date:** [April 28, 2022, 5:07pm UTC](https://forum.tezosagora.org/t/tzip-feature-proposal-consensus-key/4503/4 "2022-04-28T17:07:24Z")

</div>

Please, consider the analysis [Proto: allow bakers to set a consensus key (!5106) · Merge requests · Tezos / tezos · GitLab](https://gitlab.com/tezos/tezos/-/merge_requests/5106#note_927965785) for Drain\_delegate.

---

<div class="post-metadata">

**Author:** ![G\_B\_Fefe](https://forum.tezosagora.org/letter_avatar_proxy/v4/letter/g/57b2e6/32.png) [@G\_B\_Fefe](https://forum.tezosagora.org/u/G_B_Fefe)\
**Post date:** [May 11, 2022, 4:36pm UTC](https://forum.tezosagora.org/t/tzip-feature-proposal-consensus-key/4503/5 "2022-05-11T16:36:16Z")

</div>

Following your analysis, the TZIP has been updated.

---

<div class="post-metadata">

**Author:** ![chrispinnock](https://forum.tezosagora.org/user_avatar/forum.tezosagora.org/chrispinnock/32/1365_2.png) [@chrispinnock](https://forum.tezosagora.org/u/chrispinnock)\
**Post date:** [May 16, 2022, 10:53pm UTC](https://forum.tezosagora.org/t/tzip-feature-proposal-consensus-key/4503/6 "2022-05-16T22:53:12Z")

</div>

From my personal perspective, I would be interested to see this feature. If I’ve understood it correctly, one would be able to deploy a key for baking in the field (obviously still secured properly) and only sign baking blocks. Other operations (delegation, voting, funds transfer) would be done with a different key away from the baking environment. Along with the ability to rotate the key, it has to be something that bakers would like for security reasons.

---

<div class="post-metadata">

**Author:** ![nicolasochem](https://forum.tezosagora.org/user_avatar/forum.tezosagora.org/nicolasochem/32/544_2.png) [@nicolasochem](https://forum.tezosagora.org/u/nicolasochem)\
**Post date:** [September 19, 2022, 8:32am UTC](https://forum.tezosagora.org/t/tzip-feature-proposal-consensus-key/4503/7 "2022-09-19T08:32:10Z")

</div>

The consensus key feature has been merged into Octez and will be part of the next protocol proposal:

> **[A Consensus Key for Tezos Bakers](https://midl-dev.medium.com/a-consensus-key-for-tezos-bakers-16a3ac8178cf)**
>
> by Nicolas Ochem

---

<div class="post-metadata">

**Author:** ![nicolasochem](https://forum.tezosagora.org/user_avatar/forum.tezosagora.org/nicolasochem/32/544_2.png) [@nicolasochem](https://forum.tezosagora.org/u/nicolasochem)\
**Post date:** [April 11, 2023, 12:55am UTC](https://forum.tezosagora.org/t/tzip-feature-proposal-consensus-key/4503/8 "2023-04-11T00:55:56Z")

</div>

The consensus key feature is now available in Tezos and is being [used by several bakers](https://tzkt.io/update_consensus_key).

Here is an article by Oxhead Alpha about using it in a cloud KMS environment:

> **[Deploy Tezos Baker in the Cloud Using Ledger Wallet, Remote Signer, and...](https://medium.com/the-aleph/deploy-tezos-baker-in-the-cloud-using-ledger-wallet-remote-signer-and-consensus-key-9ab3ce4d14cc)**
>
> Introduction
