8 ms·
Show HN: Peer-to-peer mini r/place with Proof of Work
Hi HN,
This is a site where users can submit content and the shortest SHA256 value of nonce+content among them will make the site display the content. Very basic, without a blockchain. It's a static site with WebRTC and peer-to-peer.
Why? I wanted r/place (Reddit canvas where users collaborate on a pixel grid), but with proof of work. This is my progress so far. It's a WebRTC app with peer to peer connectivity that forwards the best hashed values to other users, which verify them, display them and pass them on.
There are many many improvements to be done (especially I should probably use something like libp2p-gossipsub, otherwise scale is probably an issue) and more ideas to be implemented, and I'm sure there are bugs. But I didn't find any similar projects yet (except blockchains of course).
Hope you like it!
- pierat 3y agoOOOh, climate destroying shitcoin-inspired /r/place ? I'll just take https://paint.adminforge.de/?lang=en https://paint.adminforge.de/?lang=en as FLOSS and not climate destroying thankyouverymuch.
- 99973738109 3y ago[dead]
- skeptrune 3y agoI know there are problems, but PoW seems like such a good baseline for discoverability on socially enabled sites
- kmeisthax 3y agoNo! Absolutely not! Proof of work is a form of money[0], with extraordinarily unequal distribution[1] in people willing to front the cost of spinning custom single-purpose mining silicon. A social media site that uses proof of work is equivalent to a social media site that is explicitly pay-to-play, where ordinary users will be censored for being too hashcash-poor to participate. [0] That's why Bitcoin uses it [1] That's the opposite of why Bitcoin uses it
- skeptrune 3y agoI mean you'd expect that the amount of work you'd have to put in to rank would stay quite low. You can also combine it w/ traditional social graph techniques to further prevent the work threshold from going past what you can do on a typical mobile phone. At the very least it seems like it would work to bootstrap discoverabilty before social graphs really start to develop w/ more usership.
- kmeisthax 3y agoThe problem is the inequality of specialization. The whole point of proof-of-work is to add costs that are trivial for even the poorest user but add up quickly for someone who wants to sockpuppet, ballot stuff, or otherwise spam the system. This only holds if all users pay relatively the same amount of money for access to compute power. If you can specialize - that is, invest capital into making a more efficient computer that only does proof-of-work, but does it for cheaper - than the system breaks down. Spammers pay less than users. Yes, there are "ASIC-resistant" proof-of-work systems in the cryptocurrency space. People specialize on them anyway - there's ASIC mining rigs for Monero, for example. Yes, you can fix that with a hard fork, but hard forks take time in decentralized systems, and designing new hash functions also takes time. ASICs aren't even the only way people specialize their mining rigs, just the most blatant, obvious, and most importantly, capital intensive.
- mrb 3y ago"If you can specialize [...] then the system breaks down. Spammers pay less than users." That's not at all what happened in practice. You see, in the Bitcoin industry, those who specialize, those who design and manufacture ASICs, realized that selling them on the open market is equally profitable as mining with them. As a result, even the small miners, the common guys, have access to the same hardware as the large scale miners. That's why today anybody can get, say, an Antminer S19. So spammers do NOT "pay less than users". We all pay the same amount of money for the same compute power. In fact, the cost curve of mining somewhat advantages small miners. The guy with a single Antminer S19 in his garage may not need to have dedicated cooling because cracking open a window may be sufficient. Whereas the large-scale miners definitely have to incur significant cooling costs. However they can cancel out these scale issues by, notably, choosing to set up their mining farm where electricity is cheap.
- OsrsNeedsf2P 3y agoCloudflare now uses PoW (among other things) for their captchas[0] [0] https://blog.cloudflare.com/turnstile-ga https://blog.cloudflare.com/turnstile-ga
- skeptrune 3y agohell yeah
- joshua-at-banxa 3y agoThis is an interesting concept – Would you mind expanding on how you would see this working?
- deleted 3y ago[deleted]
- ericbarrett 3y agoWow this really fun. Nice web client too. Makes me want to relearn CUDA...
- Retr0id 3y agoThe one problem with this approach is that it gives one guy with a big GPU (or even an ASIC) a huge advantage over "casual" users (e.g. mobile web). You could perhaps make the gap smaller by using one of the "ASIC-resistant" mining algorithms? By the way, for making more efficient mining algorithms, it would be nicer if the nonce is on the end of the message, aligned to a sha256 block. As is, it encourages someone to set the real nonce to a fixed value, and append their own garbage (for the text message version at least, I suppose for the other formats it doesn't matter). Edit: it would appear that your current mining algorithm is pretty inefficient. I seemingly managed to out-hash everyone with just 32 leading zeroes, taking a few Python-CPU-minutes to find. To cement my place further, I spent a few GPU-minutes to find 40 leading zeroes. The current "best hash in grid" has 28 leading zeroes. If we pessimistically take that as the average, and there are 2^10 pixels, it would take 2^38 work to flood the whole grid right now. If I spent my GPU-minutes on grid pixels rather than the text, I could have flooded the grid 4 times over.
- quickthrower2 3y agoMake each pixel a millennium prize solution.
- bingogarden 3y agoIt doesn't help to use a fixed nonce and append garbage. The data never exceeds 512 bits (SHA256 block size), because the text has a max length.
- alwayslikethis 3y agoMonero imo has the best solution for that. Their hashing algorithm RandomX requires a ton of memory access which significantly hampers the possibility of using GPUs or ASICs for mining, favoring CPUs accessible to the common person.
- ericbarrett 3y agoAgreed. I have another suggestion, which would require continuous investment of compute and (hopefully) not make things too much more complex: Every N seconds, publish a "generation" string, randomly generated. This string must be prefixed to the nonce of the winner of the contest for [marquee, color, grid square]. When performing the "winner test" for new submissions, before the comparison to find out which is less, both the challenger and incumbent hashes are subject to the operation H << M where H is the hash and M is the age of their generation string (current = 0, previous = 1, second-previous = 2, etc.). This means incumbents weaken over time unless the incumbent's submitter continues to defend them by brute-forcing with newer published generation strings. Since the hash (SHA256) is 256 bits, you'd need to keep 256 previous generation strings, and this could get a bit expensive for testing new submissions. But computers are pretty fast nowadays!
- LeoPanthera 3y agoWell this site got me to write my first ever C program to generate low hashes, and by the time I get it working, I go back to the site to learn that the lowest hash now starts with 10 zeros. (!) I don't think my lowly little Mac CPU will ever compete with that. But hey. First C program.
- nashashmi 3y agoThere is less room for new users, then. maybe every new user should be given a time based vote mechanism. maybe every "wallet" should be given one vote. Sounds like a UBI scheme in the making.
- Retr0id 3y agoIf you repurpose your program for finding grid pixels, you can still beat just about everyone else ;)
- yreg 3y agoOh no, the French flag is growing :)
- samstave 3y agoHow can I use this to spy/leak/share? (not asking for any friend - but seriously, do these have exploitation vectors?)
- deleted 3y ago[deleted]
- bananapub 3y agoI was just thinking, I wish that silly thing Reddit did was done again somewhere less popular but with a truly ridiculous waste of computation also.
- ClassyJacket 3y agoOh my god, I had this same idea (but never made it! probably wouldn't know how to implement proof of work). I thought this was pretty specific... trust the internet to show me I have never had an original thought.
- waingake 3y agoSimilar idea with boring tech ;) https://thelist.best/ https://thelist.best/
- mrb 3y agoIf you guys like solving brute forcing games, you can solve this series of puzzles to win prizes totaling about 970 BTC (45 million USD): https://bitcointalk.org/index.php?topic=5218972.0 https://bitcointalk.org/index.php?topic=5218972.0 For example the next unsolved puzzle in the series is #66 which is a Bitcoin private key with 66 unknown random bits. If you crack it you win 6.6 BTC (300 000 USD). It goes all the way to #160 which has a 16.0 BTC prize. Puzzle numbers multiple of 5 (#65 #70 #75 etc) have had their public key published in a transaction on the blockchain, so it's possible to take some shortcuts such as the Pollard's kangaroo ECDLP solver. The next unsolved "multiple of 5" is #130 with a 13.0 BTC prize (600 000 USD). You need approximately 2^65 operations to solve it. The most recent win was puzzle #125 solved on 2023-07-09 by an anonymous person who collected the 12.5 BTC. One can see their tx here: https://www.blockchain.com/explorer/addresses/btc/1PXAyUB8ZoH3WD8n5zoAthYjN15yN5CVq5 https://www.blockchain.com/explorer/addresses/btc/1PXAyUB8Zo... They probably used 200-300 GPUs for about 2-4 months to crack it, based on the known performance of existing ECDLP solvers such as https://github.com/JeanLucPons/Kangaroo https://github.com/JeanLucPons/Kangaroo
- meowtimemania 3y agodoes anyone know about how much money was spent on compute to solve puzzle #125? I am curious if they made a profit.
- mrb 3y agoOh, yes they did. 200-300 GPUs for about 2-4 months at an average $0.10/kWh has a TCO of $100k-200k. 12.5 BTC was worth $375k back when it was solved. So definitely profitable—they would have made around $175k-275k, and end up with essentially free GPUs at the end. Puzzle #130 requires about 5.7 times more work (2**2.5) than #125, but BTC has doubled since they solved #125. They have the GPUs already, so opex (electricity, etc) will be their main expense. And even at $0.10/kWh which is pretty average they will also turn a profit solving #130. I estimate anywhere from $30k to $150k in electricity, for a prize of $600k.
- quickthrower2 3y ago
- modinfo 3y agoI did my own r/place too, but with React and Express, here is a demo: https://cubes.fly.dev/ https://cubes.fly.dev/ Of course is opensource: https://github.com/skorotkiewicz/Cubes https://github.com/skorotkiewicz/Cubes It's a websocket, but easily its possible to make this with p2p.
- meowtimemania 3y agoHow do different peers discover each other? And is all the data lost once no one is visiting the site?