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).