Put 3 whole chicken legs in the smallest pot that you can single-layer them in, and cover with water. Add 2-3 large slices of ginger, 2 whole scallions and 1 tablespoon kosher salt. Bring pot to a simmer, then turn heat to lowest setting and poach, covered, for 5 minutes. After 5 minutes, turn off the heat and leave everything in the covered pot for another 15 minutes. In the meantime, prepare a large bowl with cold water and ice for shocking the chicken.
Prick chicken to test for doneness—no blood should run out. (If there is blood, bring the pot to simmer again, then turn off heat and let chicken rest in the covered pot for another 10 minutes.) If chicken is cooked, use tongs to remove the legs from the broth and dunk them in the ice bath for 2 minutes. This step is essential for ensuring bouncy meat and tight skin.
While the chicken is resting in ice water, strain the broth through a fine mesh strainer and return to the pot. Bring to a simmer again and reduce until you have about 1½ cups of liquid. When the chicken is done with its ice bath, use a cleaver to hack it into bite-sized pieces and lay them in a lidded container (e.g. Pyrex or Tupperware).
When broth has reduced, turn heat to lowest setting and add 1½ cups of Shaoxing wine to the broth, bring back up to a bare simmer, then turn off the heat. Taste the brine and add more salt and sugar as needed, using the residual heat to dissolve. The brine needs to be powerfully savory in order to penetrate the chicken, and the sugar helps to mask any bitterness in the wine. I find that a teaspoon each of kosher salt and sugar usually works for me, but do taste as you go. If using goji berries, add them to the brine as a last step.
When brine is fully cooled, pour it over the chicken, cover the container and refrigerate for at least 24 hours. To serve, arrange pieces of chicken on a plate and spoon brine and goji berries over it. Serve cold or at room temperature.