Writing in general began as accounting practices. Put your grain in the common granary, get some token (pebbles) for each measure you put in. Redeem them later. Then they started keeping the tokens in a box. Then they wrapped the tokens in clay envelopes marked with your family symbol. But they had to keep breaking them open to count them, then re-wrapping them, so they started putting hash marks on the outside of the envelope. Then they finally realized they didn't need to put anything in the clay, just the hash marks. Voila, writing!