address assignment and key share mostly working with a few bugs