Re: Design of SFTP Client Application.
On supported protocols page you'll find links to SFTP specification. You may also check source code of SFTP implementation in WinSCP or any other open source SFTP client (like PSFTP or OpenSSH's sftp).