Skip to content

NickP005/WOTS-Go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WOTS-Go

A Go wrapper of the Winternitz One-Time Signature (WOTS) scheme of the Mochimo cryptocurrency.

Installation

To install the package, run:

go get github.com/NickP005/WOTS-Go

Usage Example

Here's a complete example showing all features with detailed explanations:

package main

import (
	"fmt"
	"crypto/rand"
	"github.com/NickP005/WOTS-Go"
)

func main() {
	var seed [32]byte
	rand.Read(seed[:])

	keychain, _ := NewKeychain(seed)
	keypair := keychain.Next()

	fmt.Printf("Public Key: %x\n", keypair.PublicKey)
	fmt.Printf("Private Key: %x\n", keypair.PrivateKey)

	var message [32]byte
	copy(message[:], []byte("Hello, world!"))
	// Initialize message with some value
	signature := keypair.Sign(message)

	fmt.Println("Signature: ", len(signature))

	isValid := keypair.Verify(message, signature)
	fmt.Printf("Signature valid: %v\n", isValid)

	// Tampering with the signature
	signature[0] ^= 0xFF
	isValid = keypair.Verify(message, signature)
	fmt.Printf("Signature valid after tampering: %v\n", isValid)

}

Support & Community

Join our communities for support and discussions:

NickP005 Development Server
Mochimo Official

  • NickP005 Development Server: Technical support and development discussions
  • Mochimo Official: General Mochimo blockchain discussions and community

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published