Skip to content

Instantly share code, notes, and snippets.

@TrueCarry
Last active January 15, 2025 06:07
Show Gist options
  • Save TrueCarry/cac00bfae051f7028085aa018c2a05c6 to your computer and use it in GitHub Desktop.
Save TrueCarry/cac00bfae051f7028085aa018c2a05c6 to your computer and use it in GitHub Desktop.
TON Connect V2 Proof verification
https://github.com/ton-connect/demo-dapp-with-react-ui/blob/master/src/server/services/ton-proof-service.ts
@peng-xiao-shuai
Copy link

public_key can be obtained using v2/tonconnect/stateinit

const { data } = await axios(
    `https://${
      body.network === '-3' ? 'testnet.' : ''
    }tonapi.io/v2/tonconnect/stateinit`,
    {
      method: 'POST',
      data: {
        state_init: body.proof.state_init,
      },
    }
  )

@AlexBSoft
Copy link

@peng-xiao-shuai thanks, that works!

Is there any other methods to get public key instead of tonapi.io? It is proprietary project and they can shutdown v2 api in few years how did they did it with v1

@danylokarpenko
Copy link

@peng-xiao-shuai thanks, that works!

Is there any other methods to get public key instead of tonapi.io? It is proprietary project and they can shutdown v2 api in few years how did they did it with v1

parse state init example on GO:

https://github.com/ton-connect/demo-dapp-backend/blob/master/state_init.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment