darkblock-logo
Darkblock Docs
How does it work?

Creating a darkblock

image.jpeg
There are a few methods to create Darkblocks and connect them with their parent NFTs, each with their own API endpoint:
The NFT has been created first. The protocol embeds the nft_id in the metadata of the darkblock
The NFT collection has been minted. The creator can add content accessible by all owners of an NFT from the collection or also target specific traits of NFTs in the collection.
Forward lookup (advanced)
Darkblock was created first and the creator embeds a "darkblock-id": "tx_id" in the NFT metadata
"traits": [
{
"trait_type": "darkblock-id",
"value": "<insert tx_id>"
}
]

"properties": {
"files":
[
{
"uri": "<insert tx_id>",
"type": "encrypted(<insert filetype>)"
}
]
}

"attributes":[
{
"trait_type":"darkblock-id",
"value":"l5qo9y2_6z5YBOrokPnU-UFj8cQmHYu_9NP7O0guwkA"
}
]

NFT Upgrades

With this method, we apply the opposite approach of the forward lookup and embed the nft_id in the metadata of the darkblock. This means that the NFT has to be created before the darkblock. Also, to know whether the NFT has a darkblock attached to it, the Darkblock Protocol API must be called to check if any darkblock has this NFT's ID embedded in it.
However, this method does offer the upside of being able to add an infinite amount of darkblocks to any NFT (as long as the user has the permission to).

Collection Upgrades

Another advantage the upgrade method has is that multiple NFTs can be targeted at the same time. This can be done by passing in a collection instead of a single NFT. Traits of that collection can also be used to narrow down the selection of NFTs to be upgraded from the selected collection.

Forward Lookup (advanced)

In this case, the darkblock is created first.
When a darkblock piece of unlockable content is created it is encrypted and stored on . Doing this, a tx_id is created and is now an Arweave transaction id that can be verified at .
Later, when the NFT is created this tx_id is embedded in the NFT metadata as a "trait" or "attribute" labeled "Darkblock-ID".
This method has certain advantages as afterward you can simply look at the NFT metadata to know whether there is unlockable content attached to it.
However, depending on whether the NFT metadata can be updated, after the NFT has been minted, more darkblocks (unlockable content) cannot be added to the NFT in this way.

Try it out


We all make mistakes.

Uploaded a Darkblock and would like to take it back? Well, you can’t. Darkblocks are permanent by design. BUT, you can hide that Darkblock so it doesn’t show up in the UI anymore. It will always be there if someone digs enough, but if you use THE SAME EXACT FILE and you upgrade in the same way, then you can name that new Darkblock HIDE ME and it sill disappear from the UI.
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.