TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

POW Captcha: a lightweight, self-hosted proof-of-work captcha

116 pointsby wchar_tover 3 years ago

18 comments

woadwarrior01over 3 years ago
Reminds me of Adam Back&#x27;s hashcash[1], which was originally devised for similar purposes and was cited in Satoshi&#x27;s Bitcoin paper[2]. Bitcoin&#x27;s PoW scheme is a sightly embellished version of hashcash. I wish this work cited it too.<p>[1]: <a href="http:&#x2F;&#x2F;www.hashcash.org&#x2F;papers&#x2F;hashcash.pdf" rel="nofollow">http:&#x2F;&#x2F;www.hashcash.org&#x2F;papers&#x2F;hashcash.pdf</a><p>[2]: <a href="https:&#x2F;&#x2F;bitcoin.org&#x2F;bitcoin.pdf" rel="nofollow">https:&#x2F;&#x2F;bitcoin.org&#x2F;bitcoin.pdf</a>
评论 #28490357 未加载
thinkmassiveover 3 years ago
I would prefer to see 2 options in browsers:<p>1. LSAT[1] support for micropayments (recently mentioned on HN[2])<p>2. RandomX[3], mining XMR for the site owner<p>Both provide something useful, replacing advertising and&#x2F;or subscriptions for the site owner, rather than solely wasting energy. Let&#x27;s eliminate captchas and advertising together.<p>[1]: <a href="https:&#x2F;&#x2F;lsat.tech&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lsat.tech&#x2F;</a> [2]: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=28459713" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=28459713</a> [3]: <a href="https:&#x2F;&#x2F;xmrig.com&#x2F;docs&#x2F;miner" rel="nofollow">https:&#x2F;&#x2F;xmrig.com&#x2F;docs&#x2F;miner</a>
评论 #28487718 未加载
评论 #28487648 未加载
评论 #28488099 未加载
评论 #28495446 未加载
评论 #28490759 未加载
xg15over 3 years ago
Correct me if I&#x27;m wrong, but wouldn&#x27;t this keep the endpoint accessible for any bot&#x2F;script that is willing to &quot;invest the work&quot;? E.g. if I only plan to query the endpoint a few times per day, the captcha won&#x27;t be an obstacle.<p>I mean, if that&#x27;s an intentional exception for personal scripts, that&#x27;s awesome, but it doesn&#x27;t really seem to serve the expectations of a CAPTCHA then.<p>Also, while I like the idea, I fear this could stop working in the long term.<p>With cryptocurrencies, PoW works because the &quot;good guys&quot; (miners) and the &quot;bad guys&quot; (double spenders) have equal access to computing power: If the difficulty increases, both can simply add more mining hardware and stay in the game. If the &quot;bad guys&quot; threaten to get an advantage, the system can always increase the difficulty without risking to lock out the &quot;good guys&quot;.<p>With CAPTCHA, the situation is different: Here, the &quot;bad guys&quot; (spammers) still have as much computing power available as they can buy and stuff in their data center. However, the &quot;good guys&quot; (regular users) have hard constraint: They have to use whatever hardware the browser runs on (which might just be a smartphone) and they can&#x27;t spend more than a few minutes to solve the puzzle - otherwise, the user will probably grow impatient and give up.<p>This means, you can&#x27;t easily increase the difficulty of the puzzle without locking out regular users. If the captcha grows popular, there can easily be a situation where you&#x27;d make the captcha unsolvable for all regular users ling before it would become unsolvable for spammers.
评论 #28490978 未加载
评论 #28491097 未加载
评论 #28491057 未加载
wackgetover 3 years ago
So now instead of annoying users with image or audio challenges, websites can annoy users by running up their electricity bills (CPU work aint cheap) and&#x2F;or denying them access if they [selectively] disable JavaScript and&#x2F;or block web workers in their browser.
评论 #28487275 未加载
评论 #28487245 未加载
评论 #28487800 未加载
评论 #28487309 未加载
评论 #28488971 未加载
评论 #28487246 未加载
评论 #28487504 未加载
noxerover 3 years ago
CAPTCHA are meant to exclude computers. PoW does not do this at all. This is completely missing the point.<p>An attacker can easily an cheaply generate way more PoW than a legitimate user by optimizing their system.<p>This is just an &quot;unskippable&quot; delay timer not a CAPTCHA!
评论 #28488090 未加载
评论 #28491058 未加载
d--bover 3 years ago
I don&#x27;t get this. People can still create 1000s of fake users on my website just by using CPU time?
评论 #28487554 未加载
评论 #28490181 未加载
评论 #28488906 未加载
评论 #28487707 未加载
sneakover 3 years ago
The issue with browser based PoW is that browsers are still fairly slow execution environments.<p>Any waiting period for calculation that won&#x27;t annoy users is not long enough for an attacker to not still be able to spam, given that they will be solving them 2-100x faster with an optimized native implementation vs in a browser.<p>It also doesn&#x27;t work as a turing test, because by their nature computers are good at batch solving proofs of work.<p>I once started an anonymous email service with browser-based PoW for antispam. It didn&#x27;t work.<p>You&#x27;d need users to do like, several hours of in-browser PoW to make it viable as an anti-abuse measure. Anything less means a bot farm is posting spam dozens of times per hour.<p>Frictionless micropayments are still a pipe dream today, as any useful technology available to do so has basically been outlawed in the USA without a multimillion dollar license, and a KYC department, et c. It&#x27;s a real shame because we have all of the technology for cash-based anti-abuse bonds and the like. It&#x27;s just illegal to deploy it unless you go full MSB.
评论 #28490185 未加载
评论 #28487602 未加载
roywigginsover 3 years ago
Maybe not technically a CAPTCHA if it can&#x27;t &quot;Tell Computers and Humans Apart&quot;.
kazinatorover 3 years ago
Why do we need work? Since no valuable work product is being made, proof of work is really just a proxy for <i>proof of elapsed time</i>.<p>The animated demo shows this perfectly. The bar which is showing the progress in the proof of work could just be a simple timer, and it would look exactly the same.<p>The back end generates the page, and makes a note of the current time. Then it doesn&#x27;t accept the submission until N seconds have passed since that time. The animated bar on the front end is just for show; the browser isn&#x27;t what is enforcing it.<p><i>Proof of elapsed time</i> requires nothing from the other party. If I want proof that you spent at least 30 seconds waiting from the moment I gave you some starting signal, the only evidence I need to trust are the readings of my own stopwatch.
评论 #28488631 未加载
评论 #28488551 未加载
评论 #28488673 未加载
maxk42over 3 years ago
I like this - the hash function is memory-based rather than CPU-based so it&#x27;s easier on your CPU while being more costly for attackers to spoof en masse.<p>Good thinking!
tyingqover 3 years ago
It mentions on the widget itself that it&#x27;s accessible. That makes sense at a high level, since it doesn&#x27;t require interaction.<p>But I&#x27;m curious if it might need more work in the &#x27;accessible&#x27; area. Like, for example, is the progress bar percentage-done exposed in an accessible way? I don&#x27;t see anything obvious here: <a href="https:&#x2F;&#x2F;git.sequentialread.com&#x2F;forest&#x2F;pow-captcha&#x2F;src&#x2F;branch&#x2F;master&#x2F;static&#x2F;captcha.js#L102" rel="nofollow">https:&#x2F;&#x2F;git.sequentialread.com&#x2F;forest&#x2F;pow-captcha&#x2F;src&#x2F;branch...</a> , seems like it just changes width via css styling, but I could be missing it. I&#x27;m not sure it presents an easily understandable reason why the submit button is disabled, that you need to wait, etc, either.
评论 #28488923 未加载
bawolffover 3 years ago
I think proof of work makes bad captchas. CPU power is pretty cheap. Its really hard to have it be expensive enough to deter bad people well being cheap enough to not deter real users
评论 #28490166 未加载
kazinatorover 3 years ago
&gt; <i>It uses a multi-threaded WASM (Web Assembly) WebWorker running the Scrypt hash function instead of SHA256. Because of this, it&#x27;s less succeptible to hash-farming attacks.</i><p>That&#x27;s a problem; captchas need a fallback mechanism for situations when JS is disabled.<p>(I think that could be arranged; e.g. in the no JS case, the web application just spits out some token, which the user must copy and paste into some program that does the work, and then passes the answer back into the web application.
评论 #28488975 未加载
ReactiveJellyover 3 years ago
Very nice. Wish there was a demo.<p>This project is also cool: <a href="https:&#x2F;&#x2F;git.sequentialread.com&#x2F;forest&#x2F;greenhouse" rel="nofollow">https:&#x2F;&#x2F;git.sequentialread.com&#x2F;forest&#x2F;greenhouse</a><p>A reverse proxy that lets you split the &quot;public-visible focal point&quot; part of a web server from the &quot;Holds a lot of private data and runs code&quot; part. So the latter can run in someone&#x27;s living room.
评论 #28488927 未加载
kevincoxover 3 years ago
&gt; It is impossible to predict how long a given Proof of Work will take to calculate.<p>This seems like a very significant limitation. Is there a way around this?<p>My first though is that if instead of one problem 100x as hard you solved 100 easier problems. That at least would give you a somewhat accurate loading bar, but I&#x27;m not sure if that would actually reduce your variance.
评论 #28488936 未加载
评论 #28491239 未加载
andixover 3 years ago
It is GPL licensed, which means you can’t integrate it into any non-GPL licensed application (Apache, MIT or commercial).
评论 #28490808 未加载
tyingqover 3 years ago
The end user experience isn&#x27;t too terrible, big improvement over other captcha&#x27;s I&#x27;ve had to use. Though I imagine it might get frustrating for things like logging in, where you might get your password wrong and have to start over. Or maybe it supports caching the idea that you&#x27;ve already proved yourself?
评论 #28487346 未加载
eurasiantigerover 3 years ago
I can see how this could pay for scalable hosting of several popular websites.