Is there any documentation on how algorand computes block hashes?
Usually on Algorand, everything is serialized using a canonical version of msgpack/messagepack (canonical means that zero values are omitted and keys are alphabetically sorted).
Then, hashing is done by applying SHA-512/256 on
prefix || msgpack_of_data
where || represents concatenation
and prefix is a prefix that is specified on specs/crypto.md at master · algorandfoundation/specs · GitHub / go-algorand/hash.go at 2bc55c06f4dacf247b93a15f47530f57b4925d28 · algorand/go-algorand · GitHub
You can find details of Block serialization there:
// Copyright (C) 2019-2022 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// go-algorand is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with go-algorand. If not, see <https://www.gnu.org/licenses/>.
package bookkeeping
import (
"fmt"
This file has been truncated. show original