/** * Attest to the legitimacy of a particular block * * @param array $blocks */ private function notarizeBlocks($blocks) { // We timebox our notary communications, just because $message = \json_encode(['datetime' => \date('c'), 'blocks' => $blocks]); // Load our signing key from the configuration $skey = \Sodium::crypto_sign_secretkey(\base64_decode($this->config['crypto']['signing_key'])); // Grab a detached signature $signature = \Sodium::crypto_sign_detached($message, $skey); return \json_encode(['message' => \base64_encode($message), 'signature' => \base64_encode($signature)], JSON_PRETTY_PRINT); }