This one is basically a mechanic of using hash collisions in a bloom filter. Every turn there's some sort of "hash function" like "Grain goes into slots 1,4,6"
Something changes that.
Then, you can also use that to test for existence of something:
- So, let's say in the six slots you've got [0,1,0,2,0,4]
- Then, you trade in one of your grain with the above example hash to make the breakdown into [1,1,0,3,0,5]
- Now gold this turn is "1,2,4", which means I can extract one gold from my magic bag, and leave myself with [0,0,0,2,0,5]
So, basically, I'm using a magic hash function and my magic bloom-filter-bag-of-holding to transmute materials from one type to another.
Maybe there's a deck of hashes, and you draw into a queue of 3, and relace at the end of the queue. That way you can play wheat now knowing that two turns from now you can exchange it for gold.