Mirror wallet code exactly.