cosi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: BSD-3-Clause Imports: 6 Imported by: 1

Documentation

Overview

Package cosi defines a collective signing protocol abstraction. A set of participants will work with each others to sign a unique message collectively in the sense that the protocol produces a single signature that will verify the full, or partial, aggregated public key.

Related Papers:

Enhancing Bitcoin Security and Performance with Strong Consistency via Collective Signing (2016) https://www.usenix.org/system/files/conference/usenixsecurity16/sec16_paper_kokoris-kogias.pdf

On the Security of Two-Round Multi-Signatures (2019) https://eprint.iacr.org/2018/417.pdf

Documentation Last Review: 05.10.2020

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterMessageFormat

func RegisterMessageFormat(name serde.Format, f serde.FormatEngine)

RegisterMessageFormat registers the format for the given format name.

Types

type Actor

type Actor interface {
	// Sign collects the signature of the collective authority and creates an
	// aggregated signature.
	Sign(ctx context.Context, msg serde.Message,
		ca crypto.CollectiveAuthority) (crypto.Signature, error)
}

Actor provides a primitive to sign a message.

type CollectiveSigning

type CollectiveSigning interface {
	// GetSigner returns the individual signer assigned to the instance. One
	// should not use it to verify a collective signature but only for identity
	// verification.
	GetSigner() crypto.Signer

	// GetPublicKeyFactory returns the aggregate public key factory.
	GetPublicKeyFactory() crypto.PublicKeyFactory

	// GetSignatureFactory returns the aggregate signature factory.
	GetSignatureFactory() crypto.SignatureFactory

	// GetVerifierFactory returns a factory that can create a verifier to check
	// the validity of a signature.
	GetVerifierFactory() crypto.VerifierFactory

	// SetThreshold updates the threshold required by a collective signature.
	SetThreshold(Threshold)

	// Listen starts the collective signing so that it will answer to requests.
	Listen(Reactor) (Actor, error)
}

CollectiveSigning is the interface that provides the primitives to sign a message by members of a network.

type MessageFactory

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

MessageFactory is the message factory for the flat collective signing RPC.

- implements serde.Factory

func NewMessageFactory

func NewMessageFactory(msg serde.Factory, sig crypto.SignatureFactory) MessageFactory

NewMessageFactory returns a new message factory that uses the message and signature factories.

func (MessageFactory) Deserialize

func (f MessageFactory) Deserialize(ctx serde.Context, data []byte) (serde.Message, error)

Deserialize implements serde.Factory.

type MsgKey

type MsgKey struct{}

MsgKey is the key of the message factory.

type Reactor

type Reactor interface {
	serde.Factory

	// Invoke is provided with the message and the address of the sender and it
	// should return the unique hash for this message, or an error for malformed
	// messages.
	Invoke(addr mino.Address, in serde.Message) ([]byte, error)
}

Reactor is a collective signature event handler. Every participant must react to an incoming signature request from the leader, and this abstraction provides the primitive that allows to do so.

type SigKey

type SigKey struct{}

SigKey is the key of the signature factory.

type SignatureRequest

type SignatureRequest struct {
	Value serde.Message
}

SignatureRequest is the message sent to require a signature from the other participants.

- implements serde.Message

func (SignatureRequest) Serialize

func (req SignatureRequest) Serialize(ctx serde.Context) ([]byte, error)

Serialize implements serde.Message. It looks up the format and returns the serialized data if appropriate, otherwise an error.

type SignatureResponse

type SignatureResponse struct {
	Signature crypto.Signature
}

SignatureResponse is the message sent by the participants.

- implements serde.Message

func (SignatureResponse) Serialize

func (resp SignatureResponse) Serialize(ctx serde.Context) ([]byte, error)

Serialize implements serde.Message. It looks up the format and returns the serialized data if appropriate, otherwise an error.

type Threshold

type Threshold func(int) int

Threshold is a function that returns the threshold to reach for a given n, which means it is always positive and below or equal to n.

Directories

Path Synopsis
Package flatcosi is a flat implementation of a collective signing so that the orchestrator will contact all the participants to require their signatures and then aggregate them to the final one.
Package flatcosi is a flat implementation of a collective signing so that the orchestrator will contact all the participants to require their signatures and then aggregate them to the final one.
Package threshold is a stream-based implementation of a collective signing so that the orchestrator contacts only a subset of the participants.
Package threshold is a stream-based implementation of a collective signing so that the orchestrator contacts only a subset of the participants.
types
Package types implements the threshold collective signature and its verifier.
Package types implements the threshold collective signature and its verifier.

Jump to

Keyboard shortcuts

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