code: func ComposeChainCommit(c *Chain, ec *ECAddress) (*JSON2Request, error) {
  	buf := new(bytes.Buffer)
  
  	// 1 byte version
  	buf.Write([]byte{0})
  
  	// 6 byte milliTimestamp
  	buf.Write(milliTime())
  
  	e := c.FirstEntry
  
  	// 32 byte ChainID Hash
  	if p, err := hex.DecodeString(c.ChainID); err != nil {
  		return nil, err
  	} else {
  		// double sha256 hash of ChainID
  		buf.Write(shad(p))
  	}
  
  	// 32 byte Weld; sha256(sha256(EntryHash + ChainID))
  	if cid, err := hex.DecodeString(c.ChainID); err != nil {
  		return nil, err
  	} else {
  		s := append(e.Hash(), cid...)
  		buf.Write(shad(s))
  	}
  
  	// 32 byte Entry Hash of the First Entry
  	buf.Write(e.Hash())
  
  	// 1 byte number of Entry Credits to pay
  	if d, err := EntryCost(e); err != nil {
  		return nil, err
  	} else {
  		buf.WriteByte(byte(d + 10))
  	}
  
  	// 32 byte Entry Credit Address Public Key + 64 byte Signature
  	sig := ec.Sign(buf.Bytes())
  	buf.Write(ec.PubBytes())
  	buf.Write(sig[:])
  
  	params := messageRequest{Message: hex.EncodeToString(buf.Bytes())}
  	req := NewJSON2Request("commit-chain", APICounter(), params)
  
  	return req, nil
  }
docs: // ComposeChainCommit creates a JSON2Request to commit a new Chain via the
  // factomd web api. The request includes the marshaled MessageRequest with the
  // Entry Credit Signature.