mirror of
https://github.com/aljazceru/BitcoinAndLightningLayerSpecs.github.io.git
synced 2025-12-17 05:54:22 +01:00
216 lines
9.0 KiB
HTML
216 lines
9.0 KiB
HTML
<!DOCTYPE html>
|
|
<html class="writer-html5" lang="en" >
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<link rel="shortcut icon" href="../../img/favicon.ico" />
|
|
<title>Verification - WebBTC Specification</title>
|
|
<link rel="stylesheet" href="../../css/theme.css" />
|
|
<link rel="stylesheet" href="../../css/theme_extra.css" />
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/github.min.css" />
|
|
<link href="../../css/custom.css" rel="stylesheet" />
|
|
|
|
<script>
|
|
// Current page data
|
|
var mkdocs_page_name = "Verification";
|
|
var mkdocs_page_input_path = "signatures/verify.md";
|
|
var mkdocs_page_url = null;
|
|
</script>
|
|
|
|
<script src="../../js/jquery-3.6.0.min.js" defer></script>
|
|
<!--[if lt IE 9]>
|
|
<script src="../../js/html5shiv.min.js"></script>
|
|
<![endif]-->
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/languages/javascript.min.js"></script>
|
|
<script>hljs.initHighlightingOnLoad();</script>
|
|
</head>
|
|
|
|
<body class="wy-body-for-nav" role="document">
|
|
|
|
<div class="wy-grid-for-nav">
|
|
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
|
|
<div class="wy-side-scroll">
|
|
<div class="wy-side-nav-search">
|
|
<a href="../.." class="icon icon-home"> WebBTC Specification
|
|
</a><div role="search">
|
|
<form id ="rtd-search-form" class="wy-form" action="../../search.html" method="get">
|
|
<input type="text" name="q" placeholder="Search docs" title="Type search term here" />
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="../..">Overview</a>
|
|
</li>
|
|
</ul>
|
|
<p class="caption"><span class="caption-text">API Reference</span></p>
|
|
<ul class="current">
|
|
<li class="toctree-l1"><a class="reference internal" href="#">Enable</a>
|
|
<ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="../../enable/">Enabling</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="toctree-l1"><a class="reference internal" href="#">Information</a>
|
|
<ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="../../info/">info</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="toctree-l1 current"><a class="reference internal current" href="#">Signatures</a>
|
|
<ul class="current">
|
|
<li class="toctree-l2"><a class="reference internal" href="../sign/">Signing</a>
|
|
</li>
|
|
<li class="toctree-l2 current"><a class="reference internal current" href="./">Verification</a>
|
|
<ul class="current">
|
|
<li class="toctree-l3"><a class="reference internal" href="#syntax">Syntax</a>
|
|
</li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#parameters">Parameters</a>
|
|
</li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#returns">Returns</a>
|
|
</li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#example">Example</a>
|
|
</li>
|
|
<li class="toctree-l3"><a class="reference internal" href="#references">References</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="toctree-l1"><a class="reference internal" href="#">Invoices</a>
|
|
<ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="../../invoices/makeInvoice/">makeInvoice</a>
|
|
</li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../../transactions/send/">sendPayment</a>
|
|
</li>
|
|
<li class="toctree-l2"><a class="reference internal" href="../../transactions/sendTransaction/">sendTransaction</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="toctree-l1"><a class="reference internal" href="#">Addresses</a>
|
|
<ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="../../addresses/getAddress/">getAddress</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="toctree-l1"><a class="reference internal" href="../../extendability/extending/">Extending</a>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="../../squatting/">Namespace Squatting</a>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
<li class="toctree-l1"><a class="reference internal" href="../../references/">Resources</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
<nav class="wy-nav-top" role="navigation" aria-label="Mobile navigation menu">
|
|
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
<a href="../..">WebBTC Specification</a>
|
|
|
|
</nav>
|
|
<div class="wy-nav-content">
|
|
<div class="rst-content"><div role="navigation" aria-label="breadcrumbs navigation">
|
|
<ul class="wy-breadcrumbs">
|
|
<li><a href="../.." class="icon icon-home" alt="Docs"></a> »</li>
|
|
<li>API Reference »</li>
|
|
<li>Signatures »</li><li>Verification</li>
|
|
<li class="wy-breadcrumbs-aside">
|
|
</li>
|
|
</ul>
|
|
<hr/>
|
|
</div>
|
|
|
|
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
<div class="section" itemprop="articleBody">
|
|
|
|
<h1 id="verify-message-signature">Verify Message Signature</h1>
|
|
<p>The <code>verifyMessage</code> method is used to verify the signature of a arbitrary message.</p>
|
|
<h2 id="syntax">Syntax</h2>
|
|
<pre><code>verifyMessage(signature, address?)
|
|
</code></pre>
|
|
<h2 id="parameters">Parameters</h2>
|
|
<ul>
|
|
<li>Object<ul>
|
|
<li>signature: String (Hex) - The message to sign</li>
|
|
<li>address: String - The used to sign the message</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<blockquote>
|
|
<p><strong><em>NOTE:</em></strong><br />
|
|
The second parameter here is typically required for onchain wallets but can be omitted if the wallet contains internal support for automatic key selection. In the event of LND or C-Lightning, the wallet may use a root key whereas onchain wallets require to provide the address derived from the key required for signing the message.</p>
|
|
</blockquote>
|
|
<h2 id="returns">Returns</h2>
|
|
<ul>
|
|
<li>Boolean - Is valid signature</li>
|
|
</ul>
|
|
<h2 id="example">Example</h2>
|
|
<pre><code>> await window.webbtc.verifyMessage('2047ab7b010687146ef9d69648cbdc4610b7ebaf6f21d7255f2113fe87b24d4b4264eef980d21f29d3ba81b369e41bf532b1292021af16c6773187c34d090b7efb', 'tb1qqwn2dp8mundc6mf3xt4c8puqakk0vrcgzdayq2')
|
|
|
|
true
|
|
</code></pre>
|
|
<h2 id="references">References</h2>
|
|
<p><a href="https://api.lightning.community/#verifymessage">VerifyMessage LND</a></p>
|
|
<p><a href="https://lightning.readthedocs.io/lightning-checkmessage.7.html">lightning-checkmessage C-lightning</a></p>
|
|
<p>Bitcoin Core</p>
|
|
<ul>
|
|
<li><a href="https://github.com/bitcoin/bips/blob/master/bip-0137.mediawiki">Signatures of Messages using Private Keys- BIP137</a></li>
|
|
<li><a href="https://github.com/bitcoin/bips/blob/master/bip-0322.mediawiki">Generic Signed Message Format BIP322</a></li>
|
|
</ul>
|
|
|
|
</div>
|
|
</div><footer>
|
|
<div class="rst-footer-buttons" role="navigation" aria-label="Footer Navigation">
|
|
<a href="../sign/" class="btn btn-neutral float-left" title="Signing"><span class="icon icon-circle-arrow-left"></span> Previous</a>
|
|
<a href="../../invoices/makeInvoice/" class="btn btn-neutral float-right" title="makeInvoice">Next <span class="icon icon-circle-arrow-right"></span></a>
|
|
</div>
|
|
|
|
<hr/>
|
|
|
|
<div role="contentinfo">
|
|
<!-- Copyright etc -->
|
|
</div>
|
|
|
|
Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
</footer>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
<div class="rst-versions" role="note" aria-label="Versions">
|
|
<span class="rst-current-version" data-toggle="rst-current-version">
|
|
|
|
|
|
<span><a href="../sign/" style="color: #fcfcfc">« Previous</a></span>
|
|
|
|
|
|
<span><a href="../../invoices/makeInvoice/" style="color: #fcfcfc">Next »</a></span>
|
|
|
|
</span>
|
|
</div>
|
|
<script>var base_url = '../..';</script>
|
|
<script src="../../js/theme_extra.js" defer></script>
|
|
<script src="../../js/theme.js" defer></script>
|
|
<script src="../../search/main.js" defer></script>
|
|
<script defer>
|
|
window.onload = function () {
|
|
SphinxRtdTheme.Navigation.enable(true);
|
|
};
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|