You want to use just the hulls of the walnut that surrounds the shell. It starts out green and turns black with age. You can use water to leach out the stain, you can add ammonia to the water or you can add vinegar or alcohol to help bring out the stain. Another material that will help extract the stain out is alum. The amount of time depends on how dark you want the stain, the longer the better. To keep the solution from going bad you can place a stick of fresh willow into the mix or you can use an aspirin to prevent mold growth. You can strain the mixture through cheescloth to remove the debris and store in an airtight container. But remember this and other vegetable stains are fugitive and will fade with exposure to sunlight. Good Luck
I made a batch last year by collecting about 75 pounds of nuts in a big plastic bin and just letting it sit for a couple months under cover. Had to contend with the squirrels who made the most they could of the opportunity. I added two gallons of grocery store ammonia to the decomposing mass and let the mess percolate till spring. Ammonia does not deter squirrels for very long. I finally squeezed out as much of the liquid as possible and strained it through fiberglass window screen. The final product is an inky brown foul smelling concoction that imparts a rich ebony brown to oak. I'll make up a sample and post a picture.