Skip to content

T-ECDSA: Protocol document#282

Merged
Shadowfiend merged 55 commits into
masterfrom
tecdsa-doc
Sep 28, 2018
Merged

T-ECDSA: Protocol document#282
Shadowfiend merged 55 commits into
masterfrom
tecdsa-doc

Conversation

@nkuba
Copy link
Copy Markdown
Member

@nkuba nkuba commented Sep 3, 2018

Documentation for T-ECDSA Protocol.

Main focus on:

  1. Where are the borders between the APIs, components, and phases in the T-ECDSA implementation?
  2. What are the threat models for each component (e.g. passive vs active adversary)? What variables do we assume are private and from whom?

Based on flowdock thread

@nkuba nkuba changed the title [WIP] T-ECDSA: Protocol document T-ECDSA: Protocol document Sep 5, 2018
@nkuba nkuba requested a review from pdyraga September 5, 2018 11:25
Copy link
Copy Markdown
Member

@pdyraga pdyraga left a comment

Choose a reason for hiding this comment

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

Just a quick first pass over the high-level description of phases.

Comment thread docs/cryptography/tecdsa.adoc Outdated
Comment thread docs/cryptography/tecdsa.adoc Outdated
In this phase signers jointly generate _DSA Key_ which will be used in the Signing
phase.

Each signer generates _Secret Key Share_ and _Public Key Share_ which form
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

which together form?

Comment thread docs/cryptography/tecdsa.adoc Outdated
=== Key Generation

[.lead]
In this phase signers jointly generate _DSA Key_ which will be used in the Signing
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

which may be used or which is used sounds here better for in my opinion.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

DSA Key -> ECDSA key

Comment thread docs/cryptography/tecdsa.adoc Outdated
Paillier and broadcasts the encrypted _Secret Key Share_ along with _Public Key Share_
to other signers. +
After receiving all shares, signers combine them to get _ECDSA Key_, consisting of
_Encrypted Secret Key_ and _Public Key_.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe it's worth to add an information that the secret key is encrypted with a threshold Paillier scheme and no single player can decrypt it?

Comment thread docs/cryptography/tecdsa.adoc Outdated
After receiving all shares, signers combine them to get _ECDSA Key_, consisting of
_Encrypted Secret Key_ and _Public Key_.

This phase requires all signers in the group to produce a valid _ECDSA Key_.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually, it requires all signers to cooperate in order to produce a valid key. If malicious behavior is detected we abort the protocol. There is no threshold for Key-Gen phase - worth mentioning it.

Comment thread docs/cryptography/tecdsa.adoc Outdated

This phase requires also _ECDSA Key_ which is a result of Key Generation Phase.

To complete this round just part of signers is required. The number of signers
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The minimum number of signers ?

Comment thread docs/cryptography/tecdsa.adoc Outdated
Each signer generates _Secret Key Share_ and _Public Key Share_ which together form
_ECDSA Key Share_. +
Since _Secret Key Share_ must always be kept private, signer encrypts it with
Paillier and broadcasts the encrypted _Secret Key Share_ along with _Public Key Share_
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

with plaintext Public Key Share ?

Comment thread docs/cryptography/tecdsa.adoc Outdated
Paillier scheme in a way that no single signer is able decrypt it.

This phase requires all signers in the group to cooperate to produce a valid
_ECDSA Key_.+
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+?

Comment thread docs/cryptography/tecdsa.adoc Outdated

This phase requires also _ECDSA Key_ which is a result of Key Generation Phase.

To complete this round just part of signers is required. The minimum number of signers
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comma after To complete this round?

Comment thread docs/cryptography/tecdsa.adoc Outdated

=== Setup

==== Master Public Key
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Master Public Key looks like an orphan here. We already have: Output: Commitment Master Public Key as an output of the Setup round.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I wanted to have a subsection here for Master Public Key generation, in case we would do more things under the === Setup section.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@pdyraga is this fine?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe if we don't plan to do anything more under the === Setup section, let's remove it. WDYT?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I vote for leaving it here, so we know that this part is about Master Public Key

Comment thread docs/cryptography/tecdsa.adoc Outdated
Comment thread docs/cryptography/tecdsa.adoc Outdated

//-

. Each signer computes a set of parameters and calculates a commitment to these
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe we can just name those parameters explicitly here and say they are used to compute the final signature? Not going deep into details.

Comment thread docs/cryptography/tecdsa.adoc
Comment thread docs/cryptography/tecdsa.adoc Outdated
. Each signer computes hash of _Signature Factor Public_ parameter.

. Signers jointly decrypt _Encrypted Signature Unmask_ with Paillier, so each signer
receives just a part of _Signature Unmask_.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually, they receive partial decryptions, not a part of Signature Unmask. There is a difference - partial decryption is not like a public key share for instance.

Comment thread docs/cryptography/tecdsa.adoc Outdated
Comment thread docs/cryptography/tecdsa.adoc Outdated
^|_Signature.S_ partial decryption.
|===

. Signer validates received _Sign Round 6 Messages_. +
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are they really validated? I think we need to add some validation, per https://github.com/keep-network/keep-core/issues/246 but it's not covered in the Gennaro's paper and we are not currently doing it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Same as in other rounds we're checking a number of messages we've received.

Copy link
Copy Markdown
Member

@pdyraga pdyraga left a comment

Choose a reason for hiding this comment

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

Left a few comments. This looks good for me but I'd like to have an opinion of someone not involved in the T-ECDSA.

Having the protocol documented, we should now start with another section describing what are the potential threats to each phase / round.

Comment thread docs/cryptography/tecdsa.adoc Outdated

This phase requires also _ECDSA Key_ which is a result of Key Generation Phase.

To complete this round, just part of signers is required. The minimum number of signers
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this round

Which round? Did you mean phase?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ofc phase

Comment thread docs/cryptography/tecdsa.adoc Outdated

^|`signerID`
^|`string`
^|Signer's ID
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am not sure if it makes sense to include signerID here. I see two reasons for that:

  1. Now it's only signerID but it will become senderID and receiverID when we'll merge the setup PR
  2. signerID / senderID / receiverID - all of them are related to transport layer and matching messages together. I think we should focus only on T-ECDSA-specific parameters.

Thoughts?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah it's unnecessary. I was documenting the code too much, but it's more about describing the protocol.

Comment thread docs/cryptography/tecdsa.adoc Outdated

D(_encryptedSecretKeyShare_) = _secretKeyShare_

where _q_ is an order and _g_ is a generator point of an Elliptic Curve
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

... and D is a Decrypt function of a Paillier scheme?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I was wondering if D() is obvious or not. It's better to describe it :)

Comment thread docs/cryptography/tecdsa.adoc Outdated
****
+
_Public Key Share_ is published with a decommitment key used in a previous round
to produce commitment to _Public Key Share_ value.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm... I am not sure. Decommitment key is not used to produce a commitment. Rather, as a result of calling commitment function, we get both commitment string and decommitment key.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In our implementation of a commitment generation we're taking a random value r and we are using it in commitment computation commitment = g^digest + he^r.

Comment thread docs/cryptography/tecdsa.adoc Outdated
Comment thread docs/cryptography/tecdsa.adoc Outdated

D(_encryptedSecretKeyFactorShare_) = _secretKeyFactorShare_

D(_secretKeyMultipleShare_) = η * D(_secretKey_)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

and what is η here? secretKeyFactorShare?

Comment thread docs/cryptography/tecdsa.adoc Outdated

//-

. Each signer computes _Encrypted Signature_ value which next they jointly decrypt.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What if we mention which parameters are used to compute Encrypted Signature?

@nkuba
Copy link
Copy Markdown
Member Author

nkuba commented Sep 18, 2018

I combined Phases description with Rounds description.
I also updated Commitment Master Public Key section to reflect changes from PR #274 - @pdyraga please check if this section correctly describes how the Commitment Master Public Key will work.

Comment thread docs/cryptography/tecdsa.adoc Outdated
signing. +
The value is calculated by a signer for each peer signer and send to them.
The peer signer have to use received value when calculating a commitment for given
signer.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It should be rather:

Commitment master public key is generated by each signer individually and sent to all other peer signers.

When generating a commitment that will be sent to some verifier, it's required to use that verifier's commitment master public key.

Copy link
Copy Markdown
Contributor

@Shadowfiend Shadowfiend left a comment

Choose a reason for hiding this comment

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

Couple more thoughts; I like this organization a lot better!

Comment thread docs/cryptography/tecdsa.adoc Outdated
[.lead]
_Commitment Master Public Key_ is a value needed for commitment generation.
This setup needs to be performed before each of two phases: key generation and
signing. +
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In general I think we're going paragraph-heavy throughout the content here. It feels like this and the next bit can be the same paragraph without any problems. Thoughts?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I just wanted to have a general description as [.lead] and more details in next paragraph. But yes, I can fit it all into one paragraph which will be lead.

Comment thread docs/cryptography/tecdsa.adoc Outdated
Output::
* _Commitment Master Public Key_ for each peer signer

//-
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It feels like it would be good to have an explicit heading for these rather than the //- trick; perhaps Description or Procedure?

Comment thread docs/cryptography/tecdsa.adoc Outdated

//-

. A signer generates _Commitment Master Public Key_ for each peer signer and publishes it to them in _CommitmentMasterPublicKeyMessage_:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Though “publish” implies in the clear, it may be good to clarify whether this needs to be confidential or not.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Actually the implementation changed a little. A signer calculates one Commitment Master Public Key and broadcasts it to all other peer signers. The value is not confidential.

Comment thread docs/cryptography/tecdsa.adoc Outdated
the plaintext _ECDSA Public Key Share_ to other signers. +
After receiving all shares, signers combine them to get the _ECDSA Key_, consisting
of the _Encrypted ECDSA Private Key_ and the _ECDSA Public Key_.
The _ECDSA Private Key_ is created by combining the Paillier-encrypted _ECDSA
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This feels like maybe it should be a numbered list? I'm unclear on the relationship between this section and the one after the “Output” block; both seem to describe the protocol, but they describe different components of it. Should they be combined somehow?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This remained from the previous version of the document where phases were described separately from rounds. Much of information here duplicates those in rounds. I combined the two parts.

Comment thread docs/cryptography/tecdsa.adoc Outdated
This setup needs to be performed before each of two phases: key generation and
signing. +
The value is calculated by a signer for each peer signer and send to them.
The peer signer have to use received value when calculating a commitment for given
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

“has to use the received value…” “for a given…”

Comment thread docs/cryptography/tecdsa.adoc Outdated
Paillier and this encrypted value is published along with Zero Knowledge Proof
Π~i~, which states that:
+
****
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This defines a sidebar, which means technically it's outside of the flow of text. It may make more sense to use a standard ==== block, perhaps with a custom role like [proof]?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point. For now I used [NOTE] role. It can be updated later if we want use some custom formatting.

@nkuba
Copy link
Copy Markdown
Member Author

nkuba commented Sep 27, 2018

It's ready for a next round, gents!

Copy link
Copy Markdown
Contributor

@Shadowfiend Shadowfiend left a comment

Choose a reason for hiding this comment

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

One tiny note, and let's also go ahead and merge master. Then I'm good to go :shipit:

Comment thread docs/cryptography/tecdsa.adoc Outdated
@nkuba
Copy link
Copy Markdown
Member Author

nkuba commented Sep 28, 2018

Thank you @Shadowfiend and @pdyraga for your valuable comments!
I'm ready with the updates.

Copy link
Copy Markdown
Member

@pdyraga pdyraga left a comment

Choose a reason for hiding this comment

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

Just three small comments, the rest looks very good.

Comment thread docs/cryptography/tecdsa.adoc Outdated
|Decommitment key for _ECDSA Public Key Share_

|`secretKeyProof`
|`zkp.DsaPaillierKeyRangeProof`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

zkp.DsaPaillierKeyRangeProof -> zkp.EcdsaPaillierKeyRangeProof

Comment thread docs/cryptography/tecdsa.adoc Outdated
|Decommitment key for a commitment to _ECDSA Private Key Factor Share_ and _ECDSA Private Key Multiple Share_

|`secretKeyFactorProof`
|`zkp.DsaPaillierSecretKeyFactorRangeProof`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

zkp.DsaPaillierSecretKeyFactorRangeProof -> zkp.EcdsaPaillierSecretKeyFactorRangeProof

Comment thread docs/cryptography/tecdsa.adoc Outdated

|`signatureFactorShareCommitment`
|`commitment.MultiTrapdoorCommitment`
|Commitment to parameters from <<sign_round_3>>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe we should be explicit here? Commitment to signature factor public share and signature unmask share ?

@nkuba
Copy link
Copy Markdown
Member Author

nkuba commented Sep 28, 2018

@pdyraga updates are ready

@pdyraga
Copy link
Copy Markdown
Member

pdyraga commented Sep 28, 2018

I am good to go 👍 Waiting for a green light from @Shadowfiend

Copy link
Copy Markdown
Contributor

@Shadowfiend Shadowfiend left a comment

Choose a reason for hiding this comment

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

Rock 'n roll 🎸

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.

3 participants