Files
utxo/schnorrfx/transfer_output.go
zeekay ae673e7656 feat: add ed25519fx, schnorrfx, secp256r1fx, slhdsafx + mldsafx updates
Adds four new Fx (feature-extension) packages for X-Chain UTXO signing
schemes beyond secp256k1:
  - ed25519fx    — Ed25519 (EdDSA on Curve25519)
  - schnorrfx    — Schnorr (classical)
  - secp256r1fx  — P-256 / NIST
  - slhdsafx     — SLH-DSA (FIPS 205 hash-based PQ)

Plus mldsafx updates to match (ML-DSA / FIPS 204 lattice PQ).

Each fx package exports Fx, Credential, Keychain, OutputOwners, Input
following the existing secp256k1fx pattern.

Gitignore .DS_Store.
2026-04-13 07:33:34 -07:00

46 lines
900 B
Go

// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package schnorrfx
import (
"errors"
"github.com/luxfi/vm/components/verify"
)
var (
_ verify.State = (*TransferOutput)(nil)
ErrNoValueOutput = errors.New("output has no value")
)
type TransferOutput struct {
verify.IsState `serialize:"-" json:"-"`
Amt uint64 `serialize:"true" json:"amount"`
OutputOwners `serialize:"true"`
}
// Amount returns the quantity of the asset this output consumes
func (out *TransferOutput) Amount() uint64 {
return out.Amt
}
func (out *TransferOutput) Verify() error {
switch {
case out == nil:
return ErrNilOutput
case out.Amt == 0:
return ErrNoValueOutput
default:
return out.OutputOwners.Verify()
}
}
func (out *TransferOutput) Owners() interface{} {
return &out.OutputOwners
}
func (*TransferOutput) isState() {}