Lovey
Maybe it was blood. It's possible the walnut stone you passed could have hurt you more than you think. The inside of your anus can easily tear as it is very delicate. Do you ever get blood in your stool on other days?
Maybe you have hemeroids or cysts. When something puts pressure on a cyst, it pops and bleeds. I have heard it's not too painful, but does cause bleeding. I've also heard that lots of people with liver problems also have cysts. They found some on my cervix at the doc's office, but I don't know if they appear inside the anus. I wouldn't doubt it if they do.
Lovey