For non-existence (ie, "don't have" something, or something doesn't exist), the object that you don't have will always be in genitive case. In this sentence, «хлеба» is genitive form of «хлеб».
If you do have something, it will use nominative form. Compare: «У меня есть хлеб» (nominative) «У меня нет хлеба» (genitive)
Source, from the tips & notes of this lesson: 'If you use «нет» to say that there is "no" something or you do not have it, the object is always in Genitive'
I appreciate that people explain in detail as you have in the comment section! When i use my smartphone (like now) with duolingo there are no options for the tips and notes. You answered what i needed to know. Спасибо! !
In sentences showing possession (у [possessor] эсеь [noun]) is есть optional?
Sometimes it seems to be missing, and I can't detect a pattern or reason for this.
In my limited knowledge, it seems to be used to make note of something existing. Negatives don't exist, and I believe in some cases positives don't either. For example, "Хлеб у меня", which means "I have THE bread". I think this is because you're not emphasising its existence, but rather that you have the specific one.
Please correct me if I'm wrong.
According to my college textbook, if the existence of the object is known then есть should be omitted and you're just asking if they have it in their possession rather than if they own any of said object. So you're not wrong, just re-affirming your explanation. (Textbook ISBN: 978-0-470-64632-8, page 88)