ton-proof-go

module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2024 License: GPL-3.0

README

Ton Proof Go

Ton proof library for go

go get github.com/domikedos/ton-proof-go

Ton proof library for check proof.

This library can generate payload for proof and also check that proof is valid

How to use

Payload

To generate payload use proof.GeneratePayload(config *model.PayloadConfig) method. Example of model.PayloadConfig:

&model.PayloadConfig{
    Secret: "your secret",
	PayloadTTL: "time to live for payload",
}

As response, you'll get the following object model.Payload:

Payload{
	Payload: "payload"
}
Proof

Firstly, you need to get request body as model.TonProofRequest:

{
  "address": "wallet_address",
  "network": "-239",
  "publicKey": "public_key",
  "proof": {
    "timestamp": 1733300545,
    "domain": {
      "lengthBytes": 20,
      "value": "your-domain.com"
    },
    "signature": "signature",
    "payload": "payload",
    "stateInit": "state_init"
  }
}

To check proof use proof.Proof(config *model.ProofConfig) method. Example of ProofConfig:

&model.ProofConfig{
    Secret: "your secret",
	Domain: "your-domain.com",
	ProofTTL: "time to live for proof",
    TonProof: "your body",
}

As response, you'll get nil if proof checked successfully and error otherwise

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL