echo

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

README

Echo Broadcast

Three-round echo broadcast primitive that ensures all honest parties deliver the same payload. Suitable for small-group MPC setups where parties can afford two rounds of echo to detect inconsistencies.

Protocol

  1. Round 1: each party unicasts its message to everyone.
  2. Round 2: parties echo every payload they observed back to all others.
  3. Round 3: parties check that all echoes match; mismatches abort. Validated messages are decoded and returned.

Notes

  • Payloads are CBOR-encoded between rounds to keep the transport generic.
  • Quorum membership must include the caller’s sharing.ID; otherwise construction fails.
  • Correlation IDs separate concurrent broadcasts on the same router.

Documentation

Overview

Package echo provides three-round echo broadcast primitive that ensures all honest parties deliver the same payload. Suitable for small-group MPC setups where parties can afford two rounds of echo to detect inconsistencies.

See README.md for details.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidArgument = errs.New("invalid argument")
	ErrFailed          = errs.New("failed")
)

Functions

func ExchangeEchoBroadcastSimple

func ExchangeEchoBroadcastSimple[B any](rt *network.Router, correlationID string, message B) (network.RoundMessages[B], error)

ExchangeEchoBroadcastSimple runs an echo broadcast: send, echo, and verify consistent payloads for all parties.

func NewEchoBroadcastRunner

func NewEchoBroadcastRunner[B any](sharingID sharing.ID, quorum network.Quorum, correlationID string, message B) (network.Runner[network.RoundMessages[B]], error)

NewEchoBroadcastRunner constructs an echo broadcast runner for the given party and quorum.

Types

type Participant

type Participant[B any] struct {
	// contains filtered or unexported fields
}

Participant drives the echo broadcast protocol for a single party.

func NewParticipant

func NewParticipant[B any](id sharing.ID, quorum network.Quorum) (*Participant[B], error)

func (*Participant[B]) Quorum

func (p *Participant[B]) Quorum() network.Quorum

Quorum returns the participant quorum.

func (*Participant[B]) Round1

func (p *Participant[B]) Round1(message B) (network.OutgoingUnicasts[*Round1P2P], error)

Round1 broadcasts the sender's message to all other parties.

func (*Participant[B]) Round2

Round2 echoes every received payload back to all parties.

func (*Participant[B]) Round3

Round3 validates echo consistency and outputs the agreed messages.

func (*Participant[B]) SharingID

func (p *Participant[B]) SharingID() sharing.ID

SharingID returns the participant's identifier.

type Round1P2P

type Round1P2P struct {
	Payload []byte `cbor:"payload"`
}

Round1P2P carries the original broadcast payload.

type Round2P2P

type Round2P2P struct {
	Echo map[sharing.ID][]byte `cbor:"echo"`
}

Round2P2P carries echoed payloads from each sender.

Jump to

Keyboard shortcuts

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