Compiler requirements: Solidity >= 0.8.27, EVM version istanbul or lower.
@skalenetwork/bite-solidity) provides smart contract interfaces for creating Conditional Transactions (CTX), encrypting data onchain, and handling decryption callbacks.
Installation
Imports
BITE.submitCTX()
Creates a Conditional Transaction that requests decryption of encrypted data. The decrypted result is delivered to your contract’s onDecrypt callback in the next block.
onDecrypt. Each call generates a unique address.
Parameters:
precompileAddress: UseBITE.SUBMIT_CTX_ADDRESS(0x1B)gasLimit: Gas for callback (in gas units, usemsg.value / tx.gasprice)encryptedArgs: Array of encrypted byte arrays to decryptplaintextArgs: Array of unencrypted byte arrays passed through to callback
Example
IBiteSupplicant.onDecrypt()
Callback that your contract must implement. Called by SKALE consensus with decrypted data in the block after submitCTX.
mapping(address => bool) pattern. See Security: Protect onDecrypt.
BITE.encryptTE()
Encrypts data using the network’s BLS threshold key. Only the validator committee can decrypt (via CTX callback).
BITE.encryptECIES()
Encrypts data for a specific viewer’s secp256k1 public key. Only the holder of the corresponding private key can decrypt off-chain.
PublicKey Struct
0x04 prefix).
Constants
Resources
- GitHub: github.com/skalenetwork/bite-solidity
- BITE TypeScript SDK: @skalenetwork/bite
- Programmable Privacy Intro: Overview
