mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
16 lines
324 B
Go
16 lines
324 B
Go
package primitives
|
|
|
|
import (
|
|
"crypto/sha256"
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
)
|
|
|
|
const blobCommitmentVersionKZG uint8 = 0x01
|
|
|
|
func ConvertKzgCommitmentToVersionedHash(commitment []byte) common.Hash {
|
|
versionedHash := sha256.Sum256(commitment)
|
|
versionedHash[0] = blobCommitmentVersionKZG
|
|
return versionedHash
|
|
}
|