user1562: Can someone explain or point to some documents with pseudo code that would show me how to verify bitcoin address based on a signature and message. I know how to do this in clients I want to know how to programmatically do it.

user659: In the satoshi client the verifymessage command is implemented by this code which calls CKey::SetCompactSignature() to do its work.

user516: According to this bitcointalk thread, it can be done via the JSON-RPC API:
Code:
verifymessage [address] [signature] [message]

See here for non-programmatical methods to verify a message.

user441: Even better than pseudocode: here's some python code for message signing and verification, largely pilfered from the electrum client:
https://github.com/nanotube/supybot-bitcoin-marketmonitor/blob/master/GPG/local/bitcoinsig.py

1562: <p>Can someone explain or point to some documents with pseudo code that would show me how to verify bitcoin address based on a signature and message. I know how to do this in clients I want to know how to programmatically do it.</p>
 659: <p>In the satoshi client the <code>verifymessage</code> command is implemented by <a href="https://github.com/bitcoin/bitcoin/blob/9af3c3c8249785a0106c14bce1cb72b3afc536e8/src/bitcoinrpc.cpp#L661" rel="nofollow">this code</a> which calls <a href="https://github.com/bitcoin/bitcoin/blob/9af3c3c8249785a0106c14bce1cb72b3afc536e8/src/key.cpp#L323" rel="nofollow"><code>CKey::SetCompactSignature()</code></a> to do its work.</p>
 516: <p>According to <a href="https://bitcointalk.org/index.php?topic=70911.0" rel="nofollow noreferrer">this bitcointalk thread</a>, it can be done via the <a href="https://en.bitcoin.it/wiki/API_reference_%28JSON-RPC%29" rel="nofollow noreferrer">JSON-RPC</a> API:
Code:</p>

<pre><code>verifymessage [address] [signature] [message]
</code></pre>

<p><a href="https://bitcoin.stackexchange.com/q/4137/516">See here for non-programmatical methods</a> to verify a message.</p>
 441: <p>Even better than pseudocode: here's some python code for message signing and verification, largely pilfered from the electrum client:</p>

<p><a href="https://github.com/nanotube/supybot-bitcoin-marketmonitor/blob/master/GPG/local/bitcoinsig.py" rel="nofollow">https://github.com/nanotube/supybot-bitcoin-marketmonitor/blob/master/GPG/local/bitcoinsig.py</a></p>
