code: func registrationToModel(r *core.Registration) (*regModel, error) {
  	key, err := json.Marshal(r.Key)
  	if err != nil {
  		return nil, err
  	}
  
  	sha, err := core.KeyDigest(r.Key)
  	if err != nil {
  		return nil, err
  	}
  	if r.InitialIP == nil {
  		return nil, fmt.Errorf("initialIP was nil")
  	}
  	if r.Contact == nil {
  		r.Contact = &[]string{}
  	}
  	rm := regModel{
  		ID:        r.ID,
  		Key:       key,
  		KeySHA256: sha,
  		Contact:   *r.Contact,
  		Agreement: r.Agreement,
  		InitialIP: []byte(r.InitialIP.To16()),
  		CreatedAt: r.CreatedAt,
  		Status:    string(r.Status),
  	}
  
  	return &rm, nil
  }
docs: // newReg creates a reg model object from a core.Registration