When Keawe discovers the bottle imp, he is of course confused by the way in which the man that has such a treasure could look so unhappy. As he chats to the man about the bottle imp, the man tells him the rules of its use which of course explain why he looks so despondent. Note how he explains what the bottle can do:
"An imp lives in it, and that is the shadow we behold there moving: or so I suppose. If any man buy this bottle the imp is at his command; all that he desires--love, fame, money, houses like this house, ay, or a city like this city--all are his at the word uttered."
There are, as always in such cases, certain drawbacks to the possession of this bottle, however. Firstly, the imp cannot prolong life, and secondly, if a man dies before he sells the bottle imp on to another person, he "must burn in hell forever." Thus, as long as you can buy the bottle for a price that is less for which it was bought, and then can sell it, again for a price that is lower than what you paid for it, and do not die before you do this, you are safe.