The principal will convert to the account id it owns, so for the default account just converting it and seeing if the account ids match is your check. But you can also have sub accounts (the default account id is just the sub account set to 0) and for these you’d need to know the sub account name to generate its id, since you can’t go the other way (from account id to principal).