Ton

Only supports SDK version 0.3.0 and above.

How to generate the proof with Ton?

import { useTonWallet } from "@tonconnect/ui-react"

const wallet = useTonWallet()

const generate = async (schemaId: string, appid: string) => {
    try {
      //check if you connect the Ton wallet
      if (!wallet) {
        return alert("Please connect the wallet")
      }
      
      // TON address for the Wallet
      const address = wallet.account.address

      //The appid of the project created in dev center     
      const appid = "39a00e9e-7e6d-461e-9b9d-d520b355d1c0"
      //The schemaId of the project
      const schemaId = "c7eab8b7d7e44b05b41b613fe548edf5"
            
      const connector = new TransgateConnect(appid)
      
      const isAvailable = await connector.isTransgateAvailable()
      if (!isAvailable) {
        return alert("Please install zkPass TransGate")
      }
      
      const res = (await connector.launchWithTon(schemaId, address)) as Result

    } catch (err) {
      alert(JSON.stringify(err))
      console.log("error", err)
    }
  }

The result includes two signatures: the allocator signature and the validator signature. Developers should verify both signatures based on the other returned fields.

Verify Allocator Signature

Encode the allocator message struct

Verify the allocator signature

Verify Validator Signature

Generate the validator message

Verify the validator address

Here, we've only given the reference code for js verification. However, the result can also be verified on Ton.

Last updated