Curio Cards’ on-chain data is now neatly organized and searchable in one place.
In a recent Twitter Space titled “Curio Cards x Graphrica talk Subgraph APIs for NFTs,” Curio Cards founder Travis Uhrig spoke to Graphrica founders Mack and Richie about the ‘subgraph’ they’re using to track and index Curio Cards’ blockchain data. This includes all transaction data, enabling what Mack describes as the ability to “look at every single event that has happened on every single contract.”
Subgraphs are “decentralized APIs” implemented by The Graph, “a Web3 protocol for indexing and querying blockchain data.” You can think of it as a “decentralized query market,” Richie explained.
“It’s basically a whole bunch of decentralized (indexing) nodes around the world, which index on-chain data, and index subgraphs which people can then query, for a variety of reasons across a variety of spaces,” he said. “It started off with DeFi, and it’s really moved full-throttle into the NFT space.”
For developers wanting to build decentralized applications, subgraphs replace a complex and arduous task — indexing smart contract data, as Mack, a Graph Advocates DAO member and seasoned subgraph builder, told listeners.
“You don’t have to run a backend server or database yourself,” Mack said. “Who runs that? It’s like these miners called ‘indexers’. Instead of mining, they run these nodes, and get paid by the query fees that come from people requesting data from these decentralized APIs.”
Richie went into more detail about the various network roles that enable the decentralized network to function — indexers, curators and delegators.
“The indexers are supporting the hosting infrastructure,” he explained. “But then there are the curators who are signaling onto the subgraphs. And when you signal onto a subgraph, it’s almost like purchasing ‘equity’ on the subgraph — the earlier you get in, the more you stand to benefit, as usage and queries increase.”
Built-in economic incentives allow the top performing subgraphs to get more signal, which, in turn, signals to indexers which subgraphs should be indexed.
“Then you have delegators who are a source of liquidity,” Richie continued. “They’ll own GRT tokens — Graph tokens — and they will delegate to various indexing nodes. They’re essentially staking their GRT, in order to earn a portion of the rewards that indexers generate from operating the node, and from indexing the right (high-performing) subgraphs.
We run the only indexing node in Africa. We’re obviously very proud African citizens, and we recently indexed the Curio Cards subgraph that Mack completed.”
The benefit of using Graphrica’s subgraph ties into the technical ground Curio Cards broke in launching as an Ethereum NFT project. While the initial 30 Cards were ERC20 tokens, and each Card had its own contract, this was’t “strictly an ERC20 contract,” as Travis explained.
“We’re saying ERC20, and that’s great for (...) developers (to understand). But it was modified to behave more like a digital collectible. So, examples of modification include the IPFS hash of the artwork.” Additionally, while you can divide up an ERC20 token, Curio Cards are “non-divisible tokens.”
“Since they’re not ERC20 compliant and it was written a long time ago — I don’t think the standards were as solidified — it doesn’t actually emit an event on a transfer function,” Travis continued. “So, the original tokens are also quite hard to see (...) when you use Etherscan, because Etherscan relies on events to tell when something’s been transferred on it.”
Travis also spoke about the Curio Cards-specific challenges indexers face, because of the unique deployment of the smart contracts when releasing the tokens.
“Now, when you have an NFT collection — and Curio Cards have been wrapped into this format as well, to work on things like OpenSea — it’s this one contract that has all the NFTs,” Travis said. “Maybe you can add to it over time, but it's just one contract. We had a different contract for every card. So people doing index work (like Graphrica) have to track down thirty different contracts.”
The idea to track Curio Cards’ data originated with Kian, a community developer who was involved with the project in 2017, and rejoined during the rediscovery when people started messaging him about the Cards. Kian helped make the Curio Cards website, including the official wrapper which allowed the Cards to be traded on OpenSea. During the panel, the community dev spoke about the data needs pre-subgraph, such as filling the leaderboard on the website.
“That was actually pretty fun, because that was like, ‘Wait, I need a way to look through all the past transactions of Curio Cards and see who has the most individual Cards. It’s not really something that you can just easily query an Ethereum node for; you have to actually look through all the past transactions, like one by one. And this is where the Graph project comes in: it’s a really cool tool for scanning the blockchain and indexing what’s interesting to you.”
Once Graphrica were brought in — thanks to community member crypt0biwan — the type of data that could be tracked expanded. This is more detailed than OpenSea, for example, but wasn’t easy to set up. According to Mack, “there were a ton of edge cases, which required doing “tons of unit tests for the subgraph” to make it catch them; things like “people sending themselves” Curio Cards, which would complicate the data.
With the subgraph, there’s no longer a need to call specific functions on the blockchain, like “ERC1155 get_balance.” And all the historical data is available. This applies to dynamic data, such as answering the question, “How many people own all 30 Curio Cards?” This changing data is “not easy to look up,” with something like Etherscan, for example, said Kian, as “this is not really how the data is structured in smart contracts.”
But Graphrica’s subgraph successfully tracks it. In fact, some of their work has helped pull back the curtain on Curio Cards’ early technological history, too, including finding 18B and 19B, which left Mack “astounded.”
The history of 17b once again stems from Curio Card’s unique launch. Even though the Cards “all came from the same ‘factory’ (a Solidity development term), they were deployed over time,” occurring in sets of three per week, while 10, 20 and 30 got their own deployment dates.
“So, Rhett deployed 18, 19 and 17 together, and 17 worked,” Travis explained. “Actually, 17 was the one that was fine. It had nothing wrong with it, but the vending machines for 19 and 18 didn’t work.” (The vending machines were the contracts you could buy the cards from.) “He was iterating on the code and there was some sort of typo or something. I don’t remember exactly what it was, but you couldn’t buy 18 and 19. So, there’s actually an 18b and a 19b, but you can’t buy them. They’re just sort of locked in their vending machines. Since he deployed them all together, and was looking at a script to automate it and do it really quickly, he just made the fix and redeployed all three, even though 17 worked. For an hour or so we told people about the old contracts, but nobody interacted with them, because 18 and 19 didn’t work.”
While people were told to ignore the failed contracts, one person, Travis recently found out, did manage to buy a 17b when it was “official,” in the narrow one-hour window before Rhett updated the addresses. They’ve since gone on to become a full set holder.
Curio Cards support from Graphrica was made possible through a migration grant provided by Edge & Node, the team that made The Graph. Edge & Node has worked actively in the past to identify the “top subgraphs that have been built and migrated,” said Mack. He added that because the subgraph was community funded and community-built, 15000 GRT tokens were allocated to host and run it, as well as serve the website and DAO’s potential needs.
Curio Cards’ collaboration with the Graph Protocol and Graphrica team once again epitomizes the promise of Web3: truly diverse people building together. Richie echoed this sentiment, describing this as delivering on the vision of “finding the others.”
“There’s this amazing cultural shift,” he explained, “that people in Web3 resonate with each other on many levels, both philosophically and intellectually, as well as technically. That, for me, has been one of the joys of being in this space; just discovering what everyone is doing, from an infrastructure perspective, right down to the subgraph perspective, and even here, in these NFT collections.”
He continued: “I had never heard of Curio Cards until you started working on them (Mack). And it’s incredible to see the artwork that’s been created, and the history behind the Curio Cards collection. And no doubt many cool things will come from these relationships and these networks — and that’s tremendously exciting.”
Daniel Friedman, Curio Cards artist of 24-26, summed up the positive sense of this kind of multivarious cross-collaboration, saying he’s excited about the “way that the (Curio) DAO has explored and documented all the challenges that are kind of generalized across different communities.”
“And then, being a community that’s sitting at the intersection of history, art, culture — in other DAOs and in other communities, I also kind of see analogous things that we work through,” he said. “And it’s just been awesome to see more and more community participants get involved in the different guilds. (...) And just the way that people from the community have kind of like stepped up or stepped in, and taken the story and kind of woven themselves into it, and just making amazing and interesting future Curio things. Because the Cards themselves are on the chain, and indexed (by Graphrica), but then it’s like the humans who kind of use those graphical (in multiple senses) representations to create meaning and make it continue.”
Those in search of a springboard into Web3 and DAOs are encouraged to visit The Graph Advocates DAO, a community serving newcomers to the space and The Graph.
To listen to the entire Twitter Space with Graphrica, go here: https://twitter.com/MyCurioCards/status/1535335546775474177.
Graphrica is a Web3 hub for talent in the African content, aimed at “bridging Africans to the rest of the world.” To discover more, visit graphrica.org.
This article was made possible by Curio DAO contributors with an enthusiastic interest in Curio Cards’ story and its place in art history. Proceeds from sales of this NFT will go toward funding Curio DAO and its Writers’ Guild, to bring new content and initiatives to the Curio Cards and Web3 communities.