12 ms·
std::unique_ptr implementation backed by Ethereum NFTs
- varajelle 5y agoI was wondering if it was a joke, until I saw the white paper.
- scharman 5y agook, u got me - it was clearly a parody, but the whitepaper made me check and it took a few seconds to click. Love ur work!
- imron 5y agoThe benchmarks showing negligible performance differences also gave it away.
- AndrewStephens 5y agoThat’s the problem with all the idiotic blockchain projects around at the moment. I was only ninety percent sure it was a joke until about halfway through when the performance chart confirmed it but it is only slightly more ridiculous than several “legitimate” projects.
- Clewza313 5y agoFrom the readme: "As we all know, adding blockchain to a problem automatically makes it simple, transparent, and cryptographically secure."
- SAI_Peregrinus 5y agoSadly that's pretty realistic as far as blockchain project author statements go.
- chrismorgan 5y agoHmm, 994 bytes; that’s rather small, wonder what’s in it?— Ah.
- jb1991 5y agoJust look at the results from the “example program“ for benchmarking.
- ShroudedNight 5y agoTo be fair, the paper is white.
- iampims 5y ago> Made with by a Blockchain Expert who wrote like 100 lines of Solidity in 2017 (which didn't work) This made me chuckle.
- richieartoul 5y agoThis is one of the most subtley funny things I’ve ever seen on H.N, specifically because the target audience is so small. You have to understand both C++ memory management and what an NFT is.
- aberoham 5y agoThey should have called out the usage of Nocode to create the white paper
- grandmczeb 5y agoAnd it’s written in rust!
- wyldfire 5y agoWow, I thought for sure it was a punchline, but no: > written in rust for the hipster cred. I'm probably a founding member of the Rust Evangelism Strike Force but stuff like this seems ... way overboard. Almost like a Poe's Law demonstration - it's hard to determine whether it's satire or not.
- nexuist 5y agoThese are my favorite coding projects. No business case, no practicality for non-developers (or developers for that matter), no long term support, no problem solving. Just a love/hate letter to software and the absurdity it brings to our world.
- wyldfire 5y agoI get the sense from other comments in this thread that I did indeed miss the point - it is satire. Just a little too subtle IMO.
- sellyme 5y ago> Just a little too subtle IMO. Direct quote from the linked page: > As we all know, adding blockchain to a problem automatically makes it simple, transparent, and cryptographically secure.
- foota 5y agoAnd you thought memory management was expensive _before_!
- DDR0 5y agoActually it's cheaper this way, because you can sell the NFT to fund the operation. Before, you had to pay for everything it ran on!
- TeMPOraL 5y agoThat's why everyone loves JavaScript so much. You don't have to pay for the electricity your code burns, your users do.
- neurostimulant 5y agoI wonder if it's possible to run a linux vm (ala jslinux) in browser, connect them to the network via a proxy to allow the apps inside the linux vm to make arbitrary connections (I think I saw a jslinux clone that uses some form of proxy to allow tcp access from inside the vm, but forgot the name), then run a kubernetes worker node in them. Then you can try to make the page viral somehow and then enjoy your huge and free kubernetes cluster!
- TeMPOraL 5y agoI have a sinking suspicion that Facebook's Messenger webapp is doing exactly that - its UI has been very laggy for me in the past months, and the issue persists through refreshes, browser reboots and system reboots. It's the only thing that makes sense. I mean, they couldn't have screwed up a chat client that badly...
- foota 5y agoThey don't have the same depth of experience in developing chat apps as some other bay area companies.
- fctorial 5y agoTechnology gone berzerk.
- yjftsjthsd-h 5y agoWell yes, but it's a joke specifically making fun of that, so it's not really berserk itself.
- mmastrac 5y agoThat's an expensive operation.
- joshspankit 5y agoWas curious about this. If implemented, exactly how expensive would it get in the first 24h (assuming ETH at $2000USD)?
- masklinn 5y agoDepends how often the pointer is moved. According to the author’s Twitter at the time they were asked each move cost $18.69.
- joshspankit 5y agoSorry, I know my question depends on a lot of variables. I’m just looking for a “sanity check” example, but I only have a vague notion of pointer being a reference to a spot in memory, as well as knowing that doing transactions on the ETH network incurs fees. Are there any “power user” examples? Like, how much would it cost to run `ls` on a folder of 200 files, or encoding a video with `ffmpeg` (or insert proper example here since I don’t know where `unique_ptr` is used lol)
- iudqnolq 5y agoA lot :) If you've ever programmed, imagine kinda-sorta one move per argument per time you call a function. Like `console.log(foo, bar)` would be two moves. (This isn't literally true, it over counts a bit). Ffmpeg would be in the tens of thousands of moves for encoding a short video, maybe? They don't use unique_ptr, so it's hard to do a counterfactual. An imperfect analogy is this is like nails/screws when building a house.
- mhh__ 5y agoConsidering unique_ptr is not zero cost, this is fair game I say.
- beached_whale 5y agoWith clang you can make a unique_ptr that is though. It just cannot be used for the std one as that would break existing code. But clang has an attribute [[clang::trivial_abi]] and with that the cost really is zero compared to a pointer.
- jnwatson 5y ago"For a limited time, you can buy any Git commit from this repository as a Non-Fungible Token on my Content-First Multimedia Proof-of-Authority revision-controlled realtime collaborative private enterprise blockchain (a shared Google Doc)." Made my day.
- somebodythere 5y agoMaking pointers on mainnet is expensive these days, I was able to stand up a Ganache testnet so that my pointers are created faster and at lower cost. Fantastic library.
- mam2 5y ago"As we all know, adding blockchain to a problem automatically makes it simple, transparent, and cryptographically secure."
- qeternity 5y ago> Future steps > nft_ptr instances are themselves ERC-20 tokens with 0 supply, for forward compatibility with our next library, nft_shared_ptr. > nft_shared_ptr will implement reference counting with security by selling shares to the owned object until the SEC complains. The whole repo is a goldmine but this really had me in stitches.
- TeMPOraL 5y agoI'd love to see how they'll implement nft_weak_ptr and its creation from and conversion to a nft_shared_ptr :).
- MarkSweep 5y agoThis is great; now I feel like I have to rewrite programmerspoop.com in Rust to keep up.
- tolbish 5y ago> - void Seal::MakeSound() { std::cout << "Ow, ow, ow!" << std::endl; }
- er4hn 5y agoWARNING: This code is not safe to store secrets with. From the readme: > others may view the NFT/use the object, but only the owner can transfer/destroy the NFT/object. > absolutely no protection against just pirating the image represented by the NFT/copying the pointer out of the unique_ptr I would open an issue to support RFC 8959 and refuse to mint NFTs with secret-token URIs, but I think instead I will learn how to mint an NFT of RFC 8959.
- connor4312 5y agoJoking aside, their white paper (https://raw.githubusercontent.com/zhuowei/nft_ptr/main/white_paper.pdf https://raw.githubusercontent.com/zhuowei/nft_ptr/main/white...) is a must-read.
- penguin_booze 5y agoThank you. I must say that this is the ONLY white paper I managed to understand, ever. Very concise. Kudos to the authors. I wish we had more like this.
- beached_whale 5y agoI just wanted to use a one word reply, but that might have lacked the context. So I will say, good job :)
- rfoo 5y agozajebisty
- athrowaway3z 5y agoI was tempted to open an issue: Printing on green paper did not make it white.
- stevewodil 5y agoDo it! Bug: printing the white paper on colored paper does not work as expected
- vanderZwan 5y agoPerfect example of https://en.wikipedia.org/wiki/Does_exactly_what_it_says_on_the_tin https://en.wikipedia.org/wiki/Does_exactly_what_it_says_on_t...
- mhh__ 5y agoMaybe I'm too young, but I had no idea the phrase only originated in 1994
- sergiotapia 5y agoThe Andy Kaufman of programmers
- hjnilsson 5y agoTechnical side-note: Are NFTs free to create and/or use? Or do they require contribution of processing power and/or paying "the Network" for it using your own ETH?
- Jhsto 5y agoKind of, you can use a development network to which you can get free tokens to pay the gas fees.
- joshspankit 5y agoPeople are regularly paying $75-$250USD in gas fees to mint individual NFTs
- kmarc 5y agoIf you like this kind of humor, I'd recommend following Zhouwei Zhang on twitter[1] (not affiliated). His posts, I think, resonates well with HN's audience. [1]: https://twitter.com/zhuowei https://twitter.com/zhuowei
- TeMPOraL 5y agoA masterfully executed satire! The paranoid part of me worries this will be used for real in the future. The thing with building abstractions is, once you cover enough pieces to make a complete abstraction, people might run away with it and build castles on top, completely ignoring that the abstraction is implemented in terms of a joke. And once enough software is built on it, it'll be easier to start optimizing the joke to work faster than to get rid of it... (Also, I don't see any mention what happens to the NFT when the nft_ptr goes out of scope.)
- newswasboring 5y agoYour second paragraph paints a pretty grim scenario. Has this ever happened before? Someone building castles on a joke abstraction?
- davidhowlett 5y agoFlask was originally an April fools joke with what the author thought was a silly design. It is now widely used, including in production systems at my company. http://mitsuhiko.pocoo.org/flask-pycon-2011.pdf http://mitsuhiko.pocoo.org/flask-pycon-2011.pdf
- avery42 5y agoIn case anyone wants a video of the original talk: https://archive.org/details/pyvideo_440___opening-the-flask https://archive.org/details/pyvideo_440___opening-the-flask
- newswasboring 5y agoLol this isn't grim at all. As far as I understand, they came up with a pretty good architecture as a joke.
- pjc50 5y agoDogecoin?
- 5y ago
- MauranKilom 5y ago> Non-Fungible Tokens and std::unique_ptr have the exact same semantics: > [...] absolutely no protection against just pirating the image represented by the NFT/copying the pointer out of the unique_ptr Perfect!
- deleted 5y ago[deleted]
- FeepingCreature 5y ago"You can also help by going full r/roastme on my code: this is only my second Rust project, and I would appreciate guidance on my journey to carcinization." This is a very clever joke, so let me dissect it: The "carcinization" is a callout to, I presume, xkcd 2314 ( https://xkcd.com/2314/ https://xkcd.com/2314/ ), about how crustaceans tend to repeatedly evolve into crabs, and xkcd 2418 ( https://xkcd.com/2418/ https://xkcd.com/2418/ ), which makes the claim that any conversation with Randall evolves towards the topic of carcinization. A cutesy nickname for Rust fans is "Rustaceans". (Rust-aceans, like crustaceans.) With some creativity, we may then see the process of becoming an experienced Rust user as another instance of carcinization, especially given the similarity between xkcd's "metacarcinization" and the way that rustaceans, as fans are wont to do, tend to find a way to make the conversation about Rust.
- masklinn 5y ago> The "carcinization" is a callout to, I presume, xkcd 2314 ( https://xkcd.com/2314/ https://xkcd.com/2314/ ), about how crustaceans tend to repeatedly evolve into crabs That’s not an xkcd joke though, it’s an actual observation of evolutionary biology, first published in 1916.
- FeepingCreature 5y agoCorrect, but I suspect most geeks who know the term know it from xkcd, and that supports the additional metajoke about changing the topic to talk about Rust.
- cinntaile 5y agoI hope someone turns this into an NFT, to complete the circle.
- iudqnolq 5y agoThe author has an excellent reply to a question on twitter >> What are the gas prices like for copying a pointer? > Copying an nft_ptr is illegal. Moving an nft_ptr takes 87,169 gas: https://goerli.etherscan.io/tx/0xcbe06fdd54bd9d221993c875022fe2960128874811a25075d692cc638a28f290 https://goerli.etherscan.io/tx/0xcbe06fdd54bd9d221993c875022... at mainnet gas prices of ~100 Gwei, equal to 0.0087169 ETH, or $18.69 USD. (This was intentionally written to waste resources for no benefit, just like cryptocurrencies themselves) > The C++ "as-if" rule means the compiler is allowed to optimize away the move, but it still needs to charge the $18.
- wrigby 5y agoAside from the brilliant satire, it’s worth pointing to the “What I Learned” section of the readme: how C++ smart pointers are implemented how to implement a Non-Fungible Token how the Ethereum ecosystem has evolved since I wrote my last smart contract in 2017 how to integrate my previous Solidity, Truffle, and Ganache workflow with new tools such as OpenZeppelin and hosted wallets how to write a (trivial) program in Rust without fighting the borrow checker once how to use rust-web3, serde_json, and the openssl crates how to call Rust from C I often struggle with deciding what to build as a practice project when I want to learn a new skill, and this is a good reminder that “humor” is an acceptable answer. Using a satirical project to learn how smart pointers are implemented is genius.
- no-s 5y ago> how to write a (trivial) program in Rust without fighting the borrow checker once curiously apt, yet true...
- horsawlarway 5y agoThis is the hardest I've laughed all year. Mad props to the author for poking fun while doing a very cool (and crazy) project. Don't know why but the deadpan humor here really reminds me of reading Bill Bryson.
- im3w1l 5y agoIt's a bit complictated, requiring npm and cargo and c++. But still, a "hello world" demonstration like this is very valuable. It wouldn't surprise me if real projects use this as a starting point.
- crazypython 5y agoIt's thread-safe.
- nessup 5y agoI logged into GitHub on mobile just to star this.