idkit_go

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 9 Imported by: 0

README

idkit_go - Go SDK for Worldcoin's IDKit

idkit_go is a Go SDK for integrating with Worldcoin's IDKit, a service that allows you to verify user identities using World ID. This SDK provides the necessary tools to interact with the IDKit API and verify user proofs securely and easily in your Go applications.

Installation

You can install the idkit_go package via go get:

go get github.com/mono424/idkit-go

Features

🛡️Verify Proof: Verifies the Zero-knowledge proof using the provided proof, appID, and signal.

How to use

import (
	"fmt"
	"idkit-go/models"
	"idkit-go"
)

func main() {
	// Define the proof to be verified
	proof := models.Proof{
		Proof:         "proof_string",
		MerkleRoot:    "merkle_root_string",
		NullifierHash: "nullifier_hash_string",
		VerificationLevel: "orb",
	}

	// Define the appID and action
	appID := "app_12345"
	action := "sign_in"

	// Define an optional signal (empty byte slice if not used)
	signal := []byte("signal_data")

	// Create a new IDKit client
	client := idkit_go.New(models.Config{})

	// Verify the proof
	err := client.VerifyProof(proof, appID, action, signal)
	if err != nil {
		fmt.Printf("Verification failed: %v\n", err)
		return
	}

	fmt.Println("Verification successful!")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IdKit

type IdKit struct {
	// contains filtered or unexported fields
}

func New

func New(config models.Config) *IdKit

func (*IdKit) VerifyProof

func (k *IdKit) VerifyProof(proof models.Proof, appID string, action string, signal []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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