Once, the Bodhisatta was a brahmin who, having studied at Takkasilá, became an ascetic in the Himálaya region, living only in standing and walking attitudes. One day a tree-sprite appeared before him and asked him a riddle about waking and sleeping, which he solved to her satisfaction.
The story was related in reference to a certain layman who was a Sotápanna. He was once travelling with a caravan along a forest road. When the caravan halted for the night it was attacked by robbers. But seeing the layman walking to and fro all night they stopped their attack and reported the matter to their leader. The layman was greatly honoured and, on arriving at Sávatthi, told the Buddha of it.
The tree-sprite is identified with Uppalavanná (J.iii.403f).