Skip to content

Payments Page

Secrether Smart Contract takes a fee for secret storage, secret retrievals by consumers and secret publications. Secrether uses "Pay as You Go" model, which means that no charges apply when no business happens.


Pricing

- Price in ETH
Retrieval fee per byte 0.000004
Minimum retrieval fee 0.000125
Storage fee per byte 0.000016
Minimum storage fee 0.0005
Publication fee per byte 0.000016
Minimum publication fee 0.0005

Usage

The fees above are subject to slight change but will keep that low in order to provide a reliable platform for future DApps development and business.

Therefore its is recommended to use Secrether Smart Contract's functions to calculate the fee properly on the fly. This guarantees that no DApp functioning interruption will occur on fees change, if it will take place. Note, that you are able to limit the fees on your side to be sure that your application would not pay any larger fees that you are willing to.

Solidity

// Solidity

// The secret is "***SECRET DATA***"
// DO NOT REVEAL IT IN BLOCKCHAIN AS IT WILL TURN PUBLIC
// keccak256("***SECRET DATA***") = 0x7b62008c866b0c258068ad9cebf59798968c95e5e1d90eebca0e6160e31180a8
// secretBytesSize = bytes('***SECRET DATA***').length = 17
bytes32 hash = 0x7b62008c866b0c258068ad9cebf59798968c95e5e1d90eebca0e6160e31180a8;
address consumer = 0x1111111111111111111111111111111111111111;

// Create a secret
uint256 storageFee = secrether.calculateStorageFee(secretBytesSize);
secrether.createSecret{value:storageFee}(hash,secretBytesSize,owner);

// Now add permission for your customer to download that secret
uint256 retrievalFee = secrether.calculateRetrievalFee(secretBytesSize);
secrether.addPermissions{value:retrievalFee}(hash,consumer); // Now consumer can retrieve that secret

// Or, alternatively, you can make this secret public
uint256 publicFee = secrether.calculatePublicFee(secretBytesSize);
secrether.makePublic{value:publicFee}(hash,consumer); // Now anyone can download that secret

JavaScript

// JavaScript

const secret="***SECRET DATA***";
const hash=web3.utils.keccak256(secret);
const owner="0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";


// Create a secret
const storageFee=await secrether.calculateStorageFee(secret.length);
await secrether.createSecret(hash, secret.length, owner, { value: fee });

// Now add permission for your customer to download that secret
const retrievalFee = await secrether.calculateRetrievalFee(secret.length);
await secrether.addPermissions(hash, consumer, { value:retrievalFee }); // Now consumer can retrieve that secret

// Or, alternatively, you can make this secret public
const publicFee = await secrether.calculatePublicFee(secret.length);
await secrether.makePublic(hash, consumer, { value: publicFee }); // Now anyone can download that secret

Actual Calculation

Avoid calculating fees yourself, beacuse the fees are subject to a slight change.
Use the smart contracts functions to calculate the fee on the fly.

Storage Fee

Storage fee is payed once on Ethereum API Create Secret Method and is calculated the following way:

// Solidity
MIN_STORAGE_FEE.max(BYTE_STORAGE_FEE.mul(secretBytesSize))

Retrievals Fee

Retrievals fee is paid to the Ethereum API Add Permissions Method and calculated the following way:

// Solidity
MIN_RETRIEVAL_FEE.max(BYTE_RETRIEVAL_FEE.mul(secretBytesSize));

Publication Fee

Publication fee is paid to the Ethereum API Make Public Method and calculated the following way:

// Solidity
MIN_PUBLIC_FEE.max(BYTE_PUBLIC_FEE.mul(secretBytesSize));