working encoding/decoding for bootstrap/addOverlay/joinOverlay