I would like to create a Bitcoin brain-wallet generator using an Ethereum contract that takes as input a given password, and gives as output a deterministic Bitcoin private and public key corresponding to the given password. I assume the deriving of the addresses themselves from the password could be done purely by hashfunctions (SHA-256 and RIPEMD160). The motivation is of course to have an "indestructible" and trustless brain-wallet such that the generator can never be lost, and one would know for sure that it does not store any generated keys. Is this possible, and how do I ensure that the function input is not exposed to the network and/or "man in the middle attacks"? thanks.
If the function that accepts the password and gives the private/public key pair as output is a constant function, i.e. it does not write anything to storage and does not change the blockchain state, then calling it would not send a transaction to the blockchain. The function would just run locally on the node, so I think that the password will not be exposed to the network. Also, if it can be called as a constant function, that would give the user confidence that the contract is not storing the generated private key in its storage.