In BABE, the authorities are block producers.
What you get when you query the nextAuthorities() is the AuthorityId
and the BabeAuthorityWeight
of the next block producers.
/// Next epoch authorities.
#[pallet::storage]
pub(super) type NextAuthorities<T: Config> = StorageValue<
_,
WeakBoundedVec<(AuthorityId, BabeAuthorityWeight), T::MaxAuthorities>,
ValueQuery,
>;
The AuthorityId you want to parse is the Babe authority identifier. Which is equivalent to the schnorrkel public key used in the main Babe module. See the definition here.
For the Heartbeat event you get the authority Id of the validator that has sent the heartbeat, which is a signed transaction.
From the docs:
If the local node is a validator (i.e. contains an authority key), this module gossips a heartbeat transaction with each new session. The heartbeat functions as a simple mechanism to signal that the node is online in the current era.
See the event HeartbeatReceived
on the im-online pallet.
#[pallet::event]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config> {
/// A new heartbeat was received from `AuthorityId`.
HeartbeatReceived { authority_id: T::AuthorityId },