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.
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.
Returns status and full metadata of the Darkblock
No darkblock associated with the nft
Server error
{- "status": "Verified",
- "darkblock": {
- "id": "Fs17d_rSR0oQE2verfs3ejIABSX8RO1XM90hzkUqdmI",
- "tags": [
- {
- "name": "Description",
- "value": "description param in /mint"
}, - {
- "name": "NFT-Creator",
- "value": "wallet of the owner"
}, - {
- "name": "Platform",
- "value": "Ethereum/Tezos/Flow/Palm"
}, - {
- "name": "ArtId",
- "value": "uuid"
}, - {
- "name": "Encryption-Level",
- "value": "encryption standard"
}, - {
- "name": "Uploading-App",
- "value": "Darkblock"
}, - {
- "name": "Content-Type",
- "value": "encrypted(mimetype)"
}, - {
- "name": "RSA-Public",
- "value": "public-key"
}, - {
- "name": "Data-Hash",
- "value": "hash of the content"
}, - {
- "name": "Type",
- "value": "Darkblock"
}, - {
- "name": "Encryption-Version",
- "value": "version number"
}, - {
- "name": "Date-Created",
- "value": "unix timestamp in seconds"
}
], - "data": {
- "size": 3447,
- "type": "encrypted(image/jpeg)"
}, - "block": {
- "height": 811711,
- "timestamp": 1636993436,
- "id": "Xb74934fbg6DdJks_WQJG34SIpa-DvvN_0XUNL2-vTrGm68_IsnhCyr--1W5tCxW"
}, - "owner": {
- "address": "fmTpIBFrCbAyUjV-f3VOq7Szs5RaMovb23455lUnjVk"
}, - "anchor": "wSLyjHNtr46yhnsYm4m7ywdc3NOAmk6MPVKjeqTSbA0qaz60OF7BxvuAXu5PrcW",
- "signature": "kiM9tIMCfdDIl3LMGPJgTNNiU-vzB-MRi-uLNReCUp5D8aldl3z9Ntxy7PE-ZbEPw0..."
}
}
Returns the owner address of the nft
no nft found for the given contract and token
Server error
{- "message": "Owner Found!",
- "owner_address": "0x310cba7e454b4521f897d5gvfd3eaef37160c0a"
}
Returns the creator address of the nft
no nft found for the given contract and token
Server error
{- "message": "Creator Found!",
- "creator_address": "0x310cba7e454b4521f897d5gvfd3eaef37160c0a"
}
Signature verification went successfull, signer recovered for the signature.
Signature verification failed
Server error
{- "message": "Signer Recovered Successfully!",
- "address": "9sUnEsLPa6uENMd6MBFMWYXAXDdTadj4nnxSoX93gg8t"
}
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.
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!)
Some params are missing
Something went wrong while minting darkblock
{- "message": "string",
- "tx_id": "string",
- "file_name": "string",
- "file_size": "string",
- "request_duration": "string"
}
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.
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.
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!)
Some params are missing
Something went wrong while minting darkblock
{- "message": "string",
- "tx_id": "string",
- "file_name": "string",
- "file_size": "string",
- "request_duration": "string"
}
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
Platform: Ethereum
SHA-256 hash: 0a7e328c0e94dd46327c9944e9bb7f8703fdc7c532e8b9b8a4099198fd09705b
Contract: 0x495f947276749ce646f68ac8c248420045cb7b5e
Traits: Type=Stink
concatenates to create:
Ethereum0a7e328c0e94dd46327c9944e9bb7f8703fdc7c532e8b9b8a4099198fd09705b0x495f947276749ce646f68ac8c248420045cb7b5eType=Stinky
Then you take the signature of this text.
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.
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!)
Some params are missing
Something went wrong while minting darkblock
{- "message": "string",
- "tx_id": "string",
- "file_name": "string",
- "file_size": "string",
- "request_duration": "string"
}
Enables Monetization for nft.
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 |
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!)
Some params are missing
Something went wrong while minting darkblock
configs=%5Bobject%20Object%5D&signature=string&nft_id=string&platform=string&nft_creator=string
{- "message": "string",
- "tx_id": "string"
}