anchor.diff:  %% Serializes a token to portable binary form.
   %% @end
   %%--------------------------------------------------------------------
  --spec serialize(token()) -> {ok, serialized()} | {error, term()}.
  +-spec serialize(token()) -> {ok, serialized()} | errors:error().
   serialize(Token) ->
       try
           {ok, Token64} = macaroon:serialize(Token#token.macaroon),
  
positive.code: %% @end
  %%--------------------------------------------------------------------
  -spec verify(token(), secret(), aai:auth_ctx(), [caveats:type()]) ->
      {ok, aai:auth()} | {error, term()}.
  verify(Token = #token{macaroon = Macaroon}, Secret, AuthCtx, SupportedCaveats) ->
      Verifier = caveats:build_verifier(AuthCtx, SupportedCaveats),
      try macaroon_verifier:verify(Verifier, Macaroon, Secret) of
  
negative.code: %% Deserializes a token from portable binary form.
  %% @end
  %%--------------------------------------------------------------------
  -spec deserialize(serialized()) -> {ok, token()} | errors:error().
  deserialize(<<>>) -> ?ERROR_BAD_TOKEN;
  deserialize(Serialized) ->
      try
  