COTI V2 Documentation
  • Welcome
  • Networks
    • Faucet
    • Contracts Addresses
    • Adding the COTI Network to Metamask
  • How COTI Works
    • Introduction
      • EVM Introduction
      • Conceptual Overview
      • Use Cases and Applications
      • COTI Architecture
    • Advanced Topics
      • Garbled Circuits
      • AES Keys
      • Precompiles
      • Whitepaper
      • COTI vs others
  • Build on COTI
    • Core Concepts
      • Account Onboarding Procedure
      • Private Data Types
      • Supported Operations on Private Data Types
    • Quickstart
    • Guides
      • Basic Private Smart Contract
      • Account Onboard
      • Sending a Transaction with Encrypted Inputs
      • Resolving a Transaction's Encrypted Outputs
      • Writing a Private Smart Contract
      • Dos and Don'ts
        • Proper Use of Types
        • No Constant/Immutable Secret Types
        • No Public Contract Variables
      • Best Practices
        • Careful Onboarding
        • Careful Decrypting
        • Don't loop over an array without an index
        • Check Overflow
    • Tools
      • TypeScript SDK
      • Ethers.js
      • Python SDK
      • Web3.py
      • Contracts Library
        • MPC Core
        • Data Privacy Framework
        • Tokens
          • Private ERC20
          • Private ERC721
        • Onboard
      • Hardhat
      • Remix Plugin
      • COTI MetaMask Snap
      • Developer Sandbox
  • Running a COTI Node
    • COTI Node Ecosystem Litepaper
  • COTI Bridge
    • Swap COTI V1 Funds to COTI V2
  • Support and Community
    • Glossary
    • Telegram
    • Discord
    • GitHub
    • X
    • YouTube
  • COTI Builders Program
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Build on COTI
  2. Guides

Writing a Private Smart Contract

PreviousResolving a Transaction's Encrypted OutputsNextDos and Don'ts

Last updated 5 months ago

Was this helpful?

To start using the privacy features of the COTI platform effectively, keep the following in mind when writing contracts:

  1. Understand Privacy Features: Familiarize yourself with the privacy features offered by our blockchain platform. Explore how secret data types operate to ensure confidentiality.

  2. Define Contract Requirements: Clearly outline the requirements and functionality of your smart contract. Identify the specific use case and consider how privacy features can enhance security and confidentiality.

  3. Implement Secret Data Types: Utilize the provided secret data types defined in the library to protect sensitive information within your smart contract.

  4. Develop Scripts or dApp Frontend: Begin by developing scripts or a decentralized application (dApp) frontend using languages like Python, JavaScript, or relevant frameworks using the provided SDKs. These scripts or frontend interfaces will facilitate the execution of your smart contract's functionality while ensuring privacy and confidentiality are maintained.

  5. Test and Validate: Thoroughly test and validate your smart contract to ensure that privacy features are functioning correctly. Test various scenarios to verify the security and privacy of sensitive data handling.

  6. Deploy and Monitor: Deploy your smart contract onto the blockchain platform and monitor its performance in a real-world environment. Continuously monitor for security vulnerabilities or privacy leaks and address them promptly to maintain confidentiality.

By following these instructions, contract writers can effectively leverage the privacy features of our blockchain platform to develop secure and confidential smart contracts tailored to their specific use cases.

MPC Core