mirror of
https://github.com/luxfi/consensus.git
synced 2026-09-24 00:26:58 +00:00
- Rename quasar files to simpler names: - quasar_aggregator.go → core.go - quasar_impl.go → engine.go - quasar.go → bls.go - event_horizon.go → horizon.go - hybrid_consensus.go → hybrid.go - verkle_witness.go → witness.go - prism_dag.go → dag.go - Rename types for clarity: - PChain → BLS (BLS signature aggregation) - NewPChain → NewBLS - QuasarHybridConsensus alias added for backward compatibility - Add missing documentation: - protocol/nova/doc.go - linear blockchain consensus - protocol/nebula/doc.go - DAG consensus mode - protocol/chain/doc.go - blockchain primitives All tests pass. Backward-compatible aliases provided.
22 lines
471 B
Go
22 lines
471 B
Go
// Copyright (C) 2025, Lux Industries Inc All rights reserved.
|
|
// Event Horizon - Helper functions and utilities for the Quasar consensus
|
|
|
|
package quasar
|
|
|
|
import (
|
|
"crypto/sha256"
|
|
"encoding/hex"
|
|
"fmt"
|
|
)
|
|
|
|
// computeBlockHash creates a quantum-resistant block hash.
|
|
func computeBlockHash(block *Block) string {
|
|
data := fmt.Sprintf("%s:%d:%d",
|
|
block.Hash,
|
|
block.Height,
|
|
block.Timestamp.Unix())
|
|
|
|
h := sha256.Sum256([]byte(data))
|
|
return hex.EncodeToString(h[:])
|
|
}
|