Darkblock API

The Darkblock API is a tool for partners to integrate with the Darkblock Protocol quickly and easily with simple REST requests. The API enables you to mint Darkblocks, a piece of content that acts as an upgrade to an NFT, that only the NFT owner can access.

getDarkblockInfo

Gets Darkblock metadata and status.

nft_id or tx_id are required

nft_id is the NFT contract:NFT Token id

Example:

0x495f947276749ce646f68ac8c248420045cb7b5e:30553606573219150352991292921105176340809048341686170040023897628611270672385

tx_id is the Arweave transaction id, returned as tx_id in the Darkblock minting endpoint, or found in the NFT metadata for Darkblock-enabled NFTs.

Request
query Parameters
nft_id
string

Ethereum Nft "0x495f947276749ce646f68ac8c248420045cb7b5e:30553606573219150352991292921105176340809048341686170040023897628611270672385" | Solana Nft "CTzuzHyTiqXa7APk8vqnDnjRVTUBABKxRRb7UeCvTw84"

tx_id
string
Example: tx_id=Fs17d_rSR0oQE2verfs3ejIABSX8RO1XM90hzkUqdmI
nft_platform
required
string

Ethereum | Ethereum-Goerli | Polygon | Polygon-Mumbai | Avalanche | Avalanche-Fuji | Solana | Solana-Devnet | Tezos | Tezos-Ithaca

type
string
Responses
200

Returns status and full metadata of the Darkblock

404

No darkblock associated with the nft

500

Server error

get/v1/darkblock/info
Request samples
Response samples
application/json
{
  • "status": "Verified",
  • "darkblock": {
    }
}

getNftOwner

Request
query Parameters
contract_address
string
token_id
required
string
platform
required
string

Ethereum | Ethereum-Goerli | Polygon | Polygon-Mumbai | Avalanche | Avalanche-Fuji | Solana | Solana-Devnet | Tezos | Tezos-Ithaca

owner
string
Responses
200

Returns the owner address of the nft

404

no nft found for the given contract and token

500

Server error

get/v1/nft/owner
Request samples
Response samples
application/json
{
  • "message": "Owner Found!",
  • "owner_address": "0x310cba7e454b4521f897d5gvfd3eaef37160c0a"
}

getNftCreator

Request
query Parameters
platform
required
string

Ethereum | Ethereum-Goerli | Polygon | Polygon-Mumbai | Avalanche | Avalanche-Fuji | Solana | Solana-Devnet | Tezos | Tezos-Ithaca

contract_address
string
token_id
required
string
Responses
200

Returns the creator address of the nft

404

no nft found for the given contract and token

500

Server error

get/v1/nft/creator
Request samples
Response samples
application/json
{
  • "message": "Creator Found!",
  • "creator_address": "0x310cba7e454b4521f897d5gvfd3eaef37160c0a"
}

verifySignature

Request
Request Body schema: multipart/form-data
platform
required
string

Ethereum | Ethereum-Goerli | Polygon | Polygon-Mumbai | Avalanche | Avalanche-Fuji | Solana | Solana-Devnet | Tezos | Tezos-Ithaca

signature
required
string

Signature to verify.

data
required
string

Input from which the signature was generated.

address
required
string

Wallet address of the signer.

Responses
200

Signature verification went successfull, signer recovered for the signature.

400

Signature verification failed

500

Server error

post/v1/verify/signature
Request samples
Response samples
application/json
{
  • "message": "Signer Recovered Successfully!",
  • "address": "9sUnEsLPa6uENMd6MBFMWYXAXDdTadj4nnxSoX93gg8t"
}

mintDarkblock

Mints a Darkblock. The Darkblock should be minted prior to the NFT. Upon minting a Darkblock you are returned a transaction id (tx_id) that should be embedded into the NFT using the tag name "darkblock-id".

See example NFT with Darkblock embedded

Max file size is 350mb, anything larger will be rejected. Higher limits coming soon!

To check the status of a Darkblock you can use the info endpoint.

SecurityApiKeyAuth
Request
Request Body schema: multipart/form-data
file
required
string <binary>

The content to lock in a Darkblock

creator_address
required
string

Address of the NFT creator

nft_platform
required
string

Ethereum | Ethereum-Goerli | Polygon | Polygon-Mumbai | Avalanche | Avalanche-Fuji | Solana | Solana-Devnet | Tezos | Tezos-Ithaca

nft_standard
required
string

Supported NFT standards : ERC-721, ERC-1155, Metaplex, TZIP-12 (more coming soon)

darkblock_description
string

(Optional) Text description of the content locked in the Darkblock

publisher_address
string

(Optional) Public address of the NFT minting platform. Used for attribution and collecting residuals from the Darkblock rental protocol.

Responses
200

Upon successful mint, a tx_id is returned. This tx_id is an Arweave transaction id that can be verified at https://viewblock.io/arweave. Please allow a few minutes for the transaction to show up.

You can also use the Arweave GraphQL endpoint to view the transaction metadata here: https://bit.ly/3clFg1n (replace the id returned by the API and press play!)

401

Some params are missing

500

Something went wrong while minting darkblock

post/v1/darkblock/mint
Request samples
Response samples
application/json
{
  • "message": "string",
  • "tx_id": "string",
  • "file_name": "string",
  • "file_size": "string",
  • "request_duration": "string"
}

mintDarkblockUpgrade

Mints a Darkblock as an upgrade to an existing NFT. A signature needs to be created to verify the creator is minting the Darkblock. To do this you need concatenate the NFT platform, the NFT Id (contract address:token id OR just token id in Solana's case) and then A SHA-256 hash of the uploaded file. You need to use Signature Type 4 from Metamask for Ethereum, Avalanche and Polygon. For Solana you need to first Encode (Unit8Array) the payload and then use signMessage method to generate the signature.

EXAMPLE:

concatenate the following:

NFT-Platform: Ethereum

NFT-Id: 0x495f947276749ce646f68ac8c248420045cb7b5e:30553606573219150352991292921105176340809048341686170040023897613218107883521

File-Hash: 2e49c4fb2af4b487b44c05553d4e6d633cbcaade01313abc67071f13bbaeb1cb

to make:

Ethereum0x495f947276749ce646f68ac8c248420045cb7b5e:305536065732191503529912929211051763408090483416861700400238976132181078835212e49c4fb2af4b487b44c05553d4e6d633cbcaade01313abc67071f13bbaeb1cb

This was signed by 0x438cba7e454b59a9f897d4731fd3eaef37160c0a

to create a signature of:

0x817a31206891cd9a14fe76ca5c7ffccf4ea59dd9f0b6ec798dc73b7ee6795b13083560797a4444384be6176761314076524f0899d1aaeb703cbe9a6d464105981c

Max file size is 350mb, anything larger will be rejected. Higher limits coming soon!

To check the status of a Darkblock you can use the info endpoint.

SecurityApiKeyAuth
Request
Request Body schema: multipart/form-data
file
required
string <binary>

The content to lock in a Darkblock

creator_address
required
string

Address of the NFT creator

nft_contract
string

NFT Contract

nft_token
required
string

NFT Token Id

nft_platform
required
string

Ethereum | Ethereum-Goerli | Polygon | Polygon-Mumbai | Avalanche | Avalanche-Fuji | Solana | Solana-Devnet | Tezos | Tezos-Ithaca

nft_standard
required
string

Supported NFT standards : ERC-721, ERC-1155, Metaplex, TZIP-12 (more coming soon)

darkblock_signature
required
string

Payload of {NFT-Platform + NFT-Id + File-Hash} signed by the platform specific wallet (Metamask, Phantom, Coin98 or Temple)

darkblock_description
string

(Optional) Text description of the content locked in the Darkblock

publisher_address
string

(Optional) Public address of the NFT minting platform. Used for attribution and collecting residuals from the Darkblock rental protocol.

test_mode
string

(Optional) if you want to mint a test darkblock, set this to true.

type
string

(Optional) can use this to mint different types of darkblocks. Be sure to use the type paramter in the info endpoint for lookup

Responses
200

Upon successful mint, a tx_id is returned. This tx_id is an Arweave transaction id that can be verified at https://viewblock.io/arweave. Please allow a few minutes for the transaction to show up and the content to be available. Note: there is an intentional delay built into the data availability to avoid front-running, the act of copying the data and pointing it to another NFT for unauthorized access.

You can also use the Arweave GraphQL endpoint to view the transaction metadata here: https://bit.ly/3clFg1n (replace the id returned by the API and press play!)

401

Some params are missing

500

Something went wrong while minting darkblock

post/v1/darkblock/upgrade
Request samples
Response samples
application/json
{
  • "message": "string",
  • "tx_id": "string",
  • "file_name": "string",
  • "file_size": "string",
  • "request_duration": "string"
}

mintDarkblockUpgradeCollection

A signature needs to be created to verify the creator is minting the Darkblock. To do this you need concatenate the NFT platform, A SHA-256 hash of the file you are uploading, collection name (or in case of Ethereum and Polygon, the contract) and the traits of the NFT you are targeting separated by a colon (Shape=Circular:Color=White). You need to use Signature Type 4 from Metamask for Ethereum, Avalanche and Polygon. For Solana you need to first Encode (Unit8Array) the payload and then use signMessage method to generate the signature.

A darkblock created with multiple traits will use an implicit OR, it will match either of the traits specified. Multiple required traits (AND) is not supported yet.

Traits are optional. If you leave traits empty it will match all NFTs for an input contract.

Format of the traits parameter is as follows: [{"name":"Type","value":"Stinky"}]

To match on just the collection send in an empty array for the traits: []

You can use this tool to manually create signatures from assembled text

Examples:

Ethereum:

Platform: Ethereum

SHA-256 hash: 0a7e328c0e94dd46327c9944e9bb7f8703fdc7c532e8b9b8a4099198fd09705b

Contract: 0x495f947276749ce646f68ac8c248420045cb7b5e

Traits: Type=Stink

concatenates to create:

Ethereum0a7e328c0e94dd46327c9944e9bb7f8703fdc7c532e8b9b8a4099198fd09705b0x495f947276749ce646f68ac8c248420045cb7b5eType=Stinky

Then you take the signature of this text.

Solana:

Solanaae784edb477fd195a42437833b577a2bff9d8f0156b3a4a15d6af7e5051d7171Darkblock CollectionShape=Square:Color=White:Shade=Grey

Max file size is 350mb, anything larger will be rejected. Higher limits coming soon!

To check the status of a Darkblock you can use the info endpoint.

SecurityApiKeyAuth
Request
Request Body schema: multipart/form-data
file
required
string <binary>

The content to lock in a Darkblock

creator_address
required
string

Address of the NFT creator

nft_platform
required
string

Ethereum | Ethereum-Goerli | Polygon | Polygon-Mumbai | Avalanche | Avalanche-Fuji | Solana | Solana-Devnet | Tezos | Tezos-Ithaca

nft_standard
required
string

Supported NFT standards : ERC-721, ERC-1155, Metaplex, TZIP-12 (more coming soon)

traits
required
string

Traits of any nft in the collection. Accepts json array, ex : [{name:'name1',value:'value1'},{name:'name2',value:'value2'}]

collection
required
string

Name of the collection. in case of Ethereum and Polygon, a contract should be passed instead.

darkblock_signature
required
string

Payload of { platform + contract + SHA-256 of file + collection + traits } signed by the platform specific wallet (Metamask, Phantom, Coin98, or Temple)

name
string

(Optional) Title for the content locked in the darkblock

darkblock_description
string

(Optional) Text description of the content locked in the Darkblock

platform_address
string

(Optional) Public address of the NFT minting platform. Used for attribution and collecting residuals from the Darkblock rental protocol.

test_mode
string

(Optional) if you want to mint a test darkblock, set this to true.

download
string

(Optional) specify if the content will be downloadable, set this to true

target_tokens
required
string

(Optional) can use this to target specific tokens or range to tokens. EVM Example ['0-20','25','52'] | Solana Example ['8Ykq9bL9fb5BHR7aPbdCWyrD8y4aTQBSBWg21vyUUcan','8cA7aR5zpEyhktU8Nvb6TGqVMXrDPKrpgm7on9eSnbsh','8CZMnhSyBFBvdbzhUJ7ByjsubsxievpbnWHWbv3goD2T']

Responses
200

Upon successful mint, a tx_id is returned. This tx_id is an Arweave transaction id that can be verified at https://viewblock.io/arweave. Please allow a few minutes for the transaction to show up and the content to be available. Note: there is an intentional delay built into the data availability to avoid front-running, the act of copying the data and pointing it to another NFT for unauthorized access.

You can also use the Arweave GraphQL endpoint to view the transaction metadata here: https://bit.ly/3clFg1n (replace the id returned by the API and press play!)

401

Some params are missing

500

Something went wrong while minting darkblock

post/v1/darkblock/upgrade/collection
Request samples
Response samples
application/json
{
  • "message": "string",
  • "tx_id": "string",
  • "file_name": "string",
  • "file_size": "string",
  • "request_duration": "string"
}

monetizeNFT

Enables Monetization for nft.

SecurityApiKeyAuth
Request
Request Body schema: application/x-www-form-urlencoded
configs
required
Array of objects

rental configurations. make sure this is an array of objects otherwise the request will fail.

signature
required
string

signature of the hash of the rental configs. can generate and get that from here https://neon-bonbon-39cf32.netlify.app/ as well as the configs

nft_id
required
string

ContractAddress:TokenId. In case of Solana it is just TokenId. Example: 2ARPZA8WqtScekVgWHXTVHG4qM9oFoAWB7gqeZ5fW3QA

platform
required
string

Supported Platforms; Solana

nft_creator
required
string

account address of the creator of the nft

Responses
200

Upon successful mint, a tx_id is returned. This tx_id is an Arweave transaction id that can be verified at https://viewblock.io/arweave. Please allow a few minutes for the transaction to show up and the content to be available. Note: there is an intentional delay built into the data availability to avoid front-running, the act of copying the data and pointing it to another NFT for unauthorized access.

You can also use the Arweave GraphQL endpoint to view the transaction metadata here: https://bit.ly/3clFg1n (replace the id returned by the API and press play!)

401

Some params are missing

500

Something went wrong while minting darkblock

post/v1/darkblock/monetize/nft
Request samples
application/x-www-form-urlencoded
configs=%5Bobject%20Object%5D&signature=string&nft_id=string&platform=string&nft_creator=string
Response samples
application/json
{
  • "message": "string",
  • "tx_id": "string"
}