Sort the dried beans and discard broken and mishaped beans. Cover with water and bring the beans to a boil. Remove the pot from the heat. Cover the beans and let them soak overnight.
While your beans are cooking, put your ham bone in a separate pot that's large enough to cover most of the ham bun with the liquid when the water and wine are added, and a pinch of salt.
Bring to a boil, reduce heat to low, cover, and simmer for about 1 hour.
You can substitute 2 or 3 cups of ham chunks if you don't have a ham bone. Reduce the cooking time to about 30 minutes.
Remove the ham bone or ham chunks and KEEP THE LIQUID. This is your stock. If you used a ham bone, remove all of the meat from the bone and cut it into bite-sized chunks.