Live data from Hacker News

Programming Zero Knowledge Proofs: From Zero to Hero

zkintro.com

121–130 of 170 posts

Re: Programming Zero Knowledge Proofs: From Zero to Hero

#121

Earlier quoted context omitted.

Same thing. In my example the function only knows whether the provided hash equals the one on file. Yours is essentially the same - is the provided DOB This is also accomplished by just properly scoping the function. Considering the widespread availability of solutions to this well-known* problem, I wonder why anyone would "use ZKPs" - and what does that even mean? What npm should I install - and why? * where my ACME…

The hash check is binary, you can only check if a password is correct or not. The ZK proof can prove anything, like that the password has enough special symbols and numbers that it's secure. There's no way to check that someone's age is old enough with just a hash unless you break the hash. The most common but painful way to write ZK circuits is with Circom. Better more modern ways are with Noir or using SP1 which ca…

> ZK proof can prove anything

Apparently not, isn't it designed specifically such that it's scoped to a particular "proof"?

You guys always say "without it linking you to your identity" as if identity is built into JavaScript or something. How does using a password hash inherently leak my PII? What problem does ZKP solve?

Using conventional development you can also do the trivial stuff you mentioned like running password through regexp.

Re: Programming Zero Knowledge Proofs: From Zero to Hero

#122

Earlier quoted context omitted.

Only some kinds of ZKPs have that drawback; others don’t. There are many examples of such systems with transparent setup that are used in practice. Even for some ZKP scheme that do require trusted setup, you can perform the setup in a multi-party way that allows anybody to contribute randomness, and as long as even one person is honest, the whole thing is private.

The multiparty setup is better than a singular-party setup, but it burdens its deployment. How can users be confident of at least one party they can trust whose preferences vary? Further, how can deployment be made so that a malicious party does not sabotage the setup process or is sabotaged by the organiser or network failures? In other words, who would need to be blamed? Doing these things properly makes the proces…

There are logarithmic-sized proofs with transparent setup for arbitrary computation. These are much better for practically-minded people than ZKPs for ad-hoc computations because you don’t have to be a cryptographer to figure out how to use them

Re: Programming Zero Knowledge Proofs: From Zero to Hero

#123

Earlier quoted context omitted.

The hash check is binary, you can only check if a password is correct or not. The ZK proof can prove anything, like that the password has enough special symbols and numbers that it's secure. There's no way to check that someone's age is old enough with just a hash unless you break the hash. The most common but painful way to write ZK circuits is with Circom. Better more modern ways are with Noir or using SP1 which ca…

> ZK proof can prove anything Apparently not, isn't it designed specifically such that it's scoped to a particular "proof"? You guys always say "without it linking you to your identity" as if identity is built into JavaScript or something. How does using a password hash inherently leak my PII? What problem does ZKP solve? Using conventional development you can also do the trivial stuff you mentioned like running pass…

What do you mean scoped to a particular proof? There are different proof types like there are different hashing algorithms, they can all prove any data just like sha256 and md5 can hash any data.

How do you verify the password meets certain requirements sever side without getting that user data? Client side input can't always be trusted as anyone can modify that regex check.

Here's a project doing passport verification for services without needing to send them a photo of your passport: https://github.com/zk-passport/openpassport

With something like TLS notary you can prove anything signed by a https certificate, so you can prove there are enough funds in your bank to get a mortgage without revealing how much money you have.

Re: Programming Zero Knowledge Proofs: From Zero to Hero

#124
post #53

Can I prove that I'm a part of an org and use this as SSO?

Yea you can prove you're some set of users without revealing which one.

This is useful in the case of whistle blowing you can prove you do work at a company, or say a US Senator can show the government is up to no good and prove they are a senator without revealing who they are.

Re: Programming Zero Knowledge Proofs: From Zero to Hero

#125
post #3

> We can take a digital identity card and prove that we are over 18 years old > Without revealing anything else, like your full name or address If you are in this articles audience you would simply state the producer of the ID card signs a statement that the person is over 18. No ZKP needed. The article like many others would be improved with a better example.

A more complex way they are currently used is for proving arbitrary computation.

One of the most obvious flaws of blockchains is that every node needs to re-run every transaction to know that the block is valid, leading to the same computation being run thousands of times.

Instead of having to do this there are new Layer2 chains like Polygon zkEVM or zkSync that post a compressed blob of transaction data and a ZK proof that all transactions in that data are valid according to the rules of the EVM. This makes the chain 1000x more efficient as the computation only needs to be run once and verified 999 times.

The proving is still slow and expensive which is why this isn't fully rolled out, but it's getting faster very quickly with both software improvements and custom ASICs for proving.

Re: Programming Zero Knowledge Proofs: From Zero to Hero

#126

Earlier quoted context omitted.

> ZK proof can prove anything Apparently not, isn't it designed specifically such that it's scoped to a particular "proof"? You guys always say "without it linking you to your identity" as if identity is built into JavaScript or something. How does using a password hash inherently leak my PII? What problem does ZKP solve? Using conventional development you can also do the trivial stuff you mentioned like running pass…

What do you mean scoped to a particular proof? There are different proof types like there are different hashing algorithms, they can all prove any data just like sha256 and md5 can hash any data. How do you verify the password meets certain requirements sever side without getting that user data? Client side input can't always be trusted as anyone can modify that regex check. Here's a project doing passport verificati…

Re: scoped

In response to your comment The ZK proof can prove anything, like that the password has enough special symbols and numbers - you definitely do not need "ZKPs" to do this trivial task.

and

> There's no way to check that someone's age is old enough with just a hash

Yeah you can, you log them in then link them to that userData with an identifier - typically an email address or unique user ID. You can easily write the login API to know nothing but hashes, or you can write it to respond with - to use your example that user's age - if the password is correct (without ever actually knowing the password).

Re: Passport verification

Anybody can verify any document with enough identifying information about the document and a registry to match it up to. You don't need a private/public key library wrapped around any functions to accomplish that, but the government probably requires the photo for a reason. Maybe you can verify the document, but a lot of services are going to require photo identification regardless of what your library can do without a photo. Again trying to find what problem this solves. Would have been way cooler if you said it verified faces with passport photos - that's the hardest part.

Re: Programming Zero Knowledge Proofs: From Zero to Hero

#127

Earlier quoted context omitted.

I think you both 1) didn't read the article 2) went into the comments assuming it's about cryptocurrency and brought your baggage on that subject with you. The article mentions them in an offhand way, ZKPs are independent of anything cryptocurrency related.

Can you provide a single example of their actual use outside of cryptocrap?

The general takeaway is that you can prove you know something without revealing what it is, or how you know!

If you can't think of the possibilities that unlocks beyond the examples others have already discussed(none of which were crypto related), that's a limitation on your end.

Re: Programming Zero Knowledge Proofs: From Zero to Hero

#128

Earlier quoted context omitted.

I can also enter a password without revealing my identity, how is it fundamentally different? If I use an authentication provider, am I now "using ZKPs" because I can log people in without knowing who they are? Or if I use any identity verification provider (example: Clear), am I using ZKPs since my app doesn't actually see your identity? We just get the OK from Clear?

Like I said, I'm not sure the simple password scenario is a very good example, because the app doesn't really care about the details of the secret itself, ie your password. Only that it's the same as you presented when you signed up. I found the Sudoku example more illustrative, where you want to share your knowledge of the solution without sharing the solution itself. In that case, others do indeed care about the de…

> You can't just provide a hash of the solved board

Wait, why not? You could represent the Sudoku board as matrices, here's an example of one block:

    [

      [9, 5, 7]

      [4, 8, 3]

      [6, 1, 2]

    ]
(same idea for 9x9)

Imagine a "Sudoku Online" where we all have our own private boards, but we have a shared public chat like an online game. Any of us can click "Check Solution" which hashes our Suduku board and sends it to the chat. A message might look like:

    *magicalhippo is checking a hash... f3ghziiv × Failed*

    *bschmidt1 is checking a hash... 242eef7z × Failed*

    *magicalhippo is checking a hash... zzw4zq3x  Passed*
All players see the hash activity in the public chat, but none of us can see each others' boards - we only have insight to whether or not the solution was valid.

The validity check could run on a central trusted server, like where the game is hosted, or in a peer-to-peer setup a condition of passing could be that a peer machine must validate it. So no client can validate their own hash. It could even be in an "Unverified" state until some threshold % of players have validated it - could do anything you want, but I don't see how "ZKPs" offer any solutions.

Most of the libraries are either utils that have like generateUUID functions in them, or they're private/public key libraries that let you wrap functions in an additional encrypted layer. Haven't seen a goto ZKP npm yet or heard anything about what it improves/solves.

Re: Programming Zero Knowledge Proofs: From Zero to Hero

#129

Earlier quoted context omitted.

How will the circuit determine that you are actually you? How will it make a query to the police database to look for warrants?

The ID would need to have some government digital signature for the ZK circuit to work. The proof would be "this digital ID that has this valid government signature shows XYZ". The verifier would need the government public key and then can see "This ID that has been signed by the governments private key shows XYZ"

And the next question is: why bother? We have well-established protocols for the ID card: a police scanner creates a nonce and sends it to the card, the card signs it with its private key, and provides a certificate signed by the government.

The police scanner then verifies the signature and checks that the certificate is correctly signed by the government's public key.

No need for ZKP.

Re: Programming Zero Knowledge Proofs: From Zero to Hero

#130
post #91

Earlier quoted context omitted.

Again, this is exactly the cryptocrap-derived nonsense I meant. "Goldman Sachs could..." but they do NOT. Like they don't use blockcrap for interbank settlements, asset tracking, notary, etc. So basically, no actual uses so far. And it's not even clear _why_ I would want to use ZKP.

ZKPs have only become cheap and easy enough to do in the last few years, so of course Goldman Sachs doesn't use them yet. They'll be using them in a decade, for now look at startups. https://github.com/zk-passport/openpassport is one that is working today, worldcoin ID verification is another.

> They'll be using them in a decade

No, they won't.

> worldcoin ID verification is another.

In other words: cryptocrap.

Post reply on HN