Secure MultiParty Computation with secret inputs for secret outputs
Yes, that is possible -- that's exactly the problem that secure multiparty computation solves.  You should start by reading standard references on secure multiparty computation.

You might enjoy the following paper, and follow-on work:

Secure Multiparty Computations on Bitcoin,  Marcin Andrychowicz and Stefan Dziembowski and Daniel Malinowski and Łukasz Mazurek, IEEE Security &amp; Privacy 2014.