Frontend

For the contributors who chose to implement new interfaces, the option is available.

Given that deb0x is a communication protocol, the graphical interface can vary in many forms and reach different target audiences, so the protocol gives frontend developers the opportunity to put their fees on their site.

In the smart contract, only the CREFs generated for IPFS are stored. For the encryption and decryption of messages or the content on IPFS, we used the encryption from Metamask, but encryption in other ways chosen by the developer is allowed (and even encouraged).

Cryptography is an evolving environment, therefore this is designed to allow a certain flexibility for changing the encryption method through the protocol.

The only condition is that the CREF does not exceed 8 bytes32.

How can this be implemented?

The send function has three special parameters created for the frontend.

/**
     * @dev Sends messages to multiple accounts. Triggers helper functions 
     * used to update cycle, rewards and fees related state.
     * Optionally may include extra reward token fee and native coin fees on-top of the default protocol fee. 
     * These fees are set in the client user intarface the transaction sender interacts with.
     * 
     * @param to account addresses to send messages to.
     * @param crefs content references to the messages.
     * @param feeReceiver client address.
     * @param msgFee on-top reward token fee charged by the client (in basis points). If 0, no reward token fee applies.
     * @param nativeTokenFee on-top native coin fee charged by the client. If 0, no native token fee applies.
     */
    function send(
        address[] memory to,
        bytes32[][] memory crefs,
        address feeReceiver,
        uint256 msgFee,
        uint256 nativeTokenFee
    )
  • feeReceiver is the address of the person who implemented the interface can receive rewards.

  • msgFee is a fee that the developer is allowed to charge for the tokens received as a reward in DBX. The maximum value of msgFee is 10%.

  • nativeTokenFee is a fee in the native token of the blockchain.

If feeReceiver is set to zero address, the frontend does not charge fees for sending messages through it.

The fact that the deb0x protocol was designed to be used as a communication tool for decades did not allow us to set a maximum value for nativeTokenFee.

Those who will make implementations will charge as much as they see fit for this fee in accordance with their protocol for providing a friendly interface with secure encryption.

These fees can vary within upper limits which are encompassed in the smart contract. In this way, potential abuse is regulated by design in order to avoid fees being too high and instead have an open market where each user can choose the fees to charge.

Upper limits are not set for nativeTokenFee, but instead an ecosystem is created that supports liberalized market where each frontend will set its own fees. Based on price and conditions, users will decide which one to use.

Deb0xViews.sol offers view functions to retrieve data from Deb0x.sol. This smart contract was built like a library to help frontend developers.

Last updated