mirror of
https://github.com/QuilibriumNetwork/ceremonyclient.git
synced 2026-02-21 18:37:26 +08:00
* v2.1.0 [omit consensus and adjacent] - this commit will be amended with the full release after the file copy is complete * 2.1.0 main node rollup
34 lines
944 B
Go
34 lines
944 B
Go
package hypergraph
|
|
|
|
import (
|
|
"math/big"
|
|
|
|
tcrypto "source.quilibrium.com/quilibrium/monorepo/types/crypto"
|
|
)
|
|
|
|
// Atom is the base interface for both vertices and hyperedges.
|
|
// It represents any element that can exist in the hypergraph.
|
|
type Atom interface {
|
|
// GetID returns the 64-byte unique identifier for this atom.
|
|
// The ID is composed of [32-byte AppAddress][32-byte DataAddress].
|
|
GetID() [64]byte
|
|
|
|
// GetAtomType returns the type of this atom (vertex or hyperedge).
|
|
GetAtomType() AtomType
|
|
|
|
// GetAppAddress returns the 32-byte application address.
|
|
GetAppAddress() [32]byte
|
|
|
|
// GetDataAddress returns the 32-byte data address.
|
|
GetDataAddress() [32]byte
|
|
|
|
// GetSize returns the size of this atom for size accounting.
|
|
GetSize() *big.Int
|
|
|
|
// ToBytes serializes the atom to bytes for storage.
|
|
ToBytes() []byte
|
|
|
|
// Commit generates a cryptographic commitment of the atom data.
|
|
Commit(prover tcrypto.InclusionProver) []byte
|
|
}
|