package hostactors import ( "crypto/sha256" "encoding/hex" ) // GroupBoxReference is the reference of a box its region's group launched // (census ruling region-ha-2b): "g-" and the first 20 hex digits of // sha256("carlos-box-ref-v1|" + account + "|" + instance). Status labels // come from 1,600 values and collide as groups replace their boxes; // instance ids never repeat in an account, and 80 bits of their digest // make a collision negligible. It is a pseudonym, so the public status // feed never shows an instance id. The box derives it to publish under it, // and the console derives it again from the instance it proved (the // attempt's, then the roster's pinned one) to read and admit it, never // trusting the key a box chose. Boxes an operator enrolled keep their // labels. func GroupBoxReference(account, instance string) string { sum := sha256.Sum256([]byte("carlos-box-ref-v1|" + account + "|" + instance)) return "g-" + hex.EncodeToString(sum[:])[:20] }