Score:1

How to add unused public signals in circom

pa flag

In my usecase, i want to attach a public key to a proof generated by a circom circuit. If my circuit is like follows:

template Example() {
  signal input secret;
  signal input hash;
  signal input salt;

  signal output verified;

  // Hash the secret and the salt, compare it to hash and assign it to the verified output
  // Omitted for brevity
}

component main {public [hash]} = Example();

If i just generate a proof that i know the secret and the salt, and then sign it, other party can take the proof and sign it with a different key without knowing the secret, defeating the purpose.

Would it be possible to add a public key to the inputs, even though it's unused in the circuit in a way that nobody can generate a proof swapping the public key with other different key without knowing the secret?

template Example() {
  signal input secret;
  signal input hash;
  signal input salt;
  signal input publicIdentity; // Unused

  signal output verified;

  // Hash the secret and the salt, compare it to hash and assign it to the verified output
  // Omitted for brevity
}

component main {public [hash, publicIdentity]} = Example();

Do I need to add a artificial constraint like publicIdentity * 0 === 0? If so, why?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.