GithubHelp home page GithubHelp logo

coti-sdk-typescript-copy's Introduction

COTI V2 Confidential Smart Contracts | SDKs and Examples

All repositories specified below contain smart contracts that implement confidentiality features using the COTI V2 protocol. The contracts provide examples for various use cases, such as Non-Fungible Tokens (NFTs), ERC20 tokens, Auction, and Identity management.

These contracts demonstrate how to leverage the confidentiality features of the COTI V2 protocol to enhance privacy and security in decentralized applications. The contracts are of Solidity and can be compiled and deployed using popular development tools like Hardhat and Foundry (Work in progress).

Important Links:

Docs | Devnet Explorer | Faucet

Interact with the contract using any of the following:

  1. Python SDK
  2. Typescript SDK | Typescript SDK Examples
  3. Hardhat Dev Environment

The following contracts are available in each of the packages:

Contract python sdk hardhat sdk typescript sdk Contract Description
AccountOnboard deployment ✅ * Onboard a EOA account - During onboard network creates AES unique for that EOA which is used for decrypting values sent back from the network
AccountOnboard execution "
ERC20Example deployment Confidential ERC20 - deploy and transfer encrypted amount of funds
ERC20Example execution "
NFTExample deployment Confidential NFT example - saving encrypted data
NFTExample execution "
ConfidentialAuction deployment Confidential auction - encrypted bid amount
ConfidentialAuction execution "
ConfidentialIdentityRegistry deployment Confidential Identity Registry - Encrypted identity data
ConfidentialIdentityRegistry execution "
DataOnChain deployment Basic encryption and decryption - Good place to start explorining network capabilties
DataOnChain execution "
Precompile deployment Thorough examples of the precompile functionality
Precompile execution "

(*) no deployment needed (system contract)

Note

Due to the nature of ongoing development, future version might break existing functionality

Faucet

🤖 To request devnet/testnet funds use our faucet

COTI v2 Typescript SDK

The COTI Typescript SDK is comprised of two main components:

  1. The crypto.ts library, which provides cryptographic functions to interact with the COTI network. For a full description of the library visit the libs readme.

  2. Typescript classes to interact with the COTI network. These are located in the src/account directory. The following are provided:

  • confidential-account.ts: designed to handle confidential data by providing methods for encryption and decryption, as well as onboarding new wallets. It utilizes cryptographic functions to ensure the security of data on the COTI network.

  • onboard_contract.ts: interact with the onboarding smart contract. The address and ABI allow a web3-enabled application to connect to the contract, listen for events, and call the OnboardAccount function to onboard new accounts.

  • onboard.ts: facilitates the onboarding of new users by generating cryptographic keys, signing data, and interacting with a blockchain smart contract. The onboard function automates the entire process, ensuring secure onboarding and key management.

Usage

  1. Install dependencies

    yarn
    
  2. Run ERC20 test

    yarn erc20
    

Note

Runnning tests will create an account automatically. The account will be saved to the .env file and will need to be funded. Use the COTI faucet to request devnet/testnet funds.

Pending enhancements

  • Publishing SDK via npmjs
  • Extending examples such as confidential ERC20 minting, confidential NFT (deployment and actions) and more.

To report issues, please create a github issue

coti-sdk-typescript-copy's People

Contributors

danielgruesso avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.