console - 如何从终端使用比特币私钥签署消息

标签 console terminal digital-signature bitcoin

我正在尝试使用比特币私钥签署消息以从 InstaWallet 获得退款。

关于如何从 OS X 上的终端执行此操作的任何提示?

最佳答案

(第 22、23 页来自 An Introduction to Bitcoin, Elliptic Curves and the Mathematics of ECDSA)

4.6 ECDSA

A brief outline of how digital signatures work was given in 2.4.2. Bitcoin uses the mathematics of elliptic curves as the underlying basis for its digital signature. Recall elliptic curves are defined by T = (p, a, b, G, n, h), with Bitcoin using parameters prescribed by sep256k1. We also have the private and public key pair (Kpriv, Kpub where Kpub = Kpriv × G, as explained in 4.5. If Alice (A) and Bob (B) wanted to send a message (or transaction) to each other, this is how they would create and verify a digital signature.

4.6.1 Signature Generation [7]

To sign a message m Alice would do the following.

  1. Select a random integer k, 1 ≤ k ≤ n − 1.
  2. Compute kG = (x1, y1) and convert x1 to an integer x1.
  3. Compute r = x1 (mod n). If r = 0 then go to step 1.
  4. Compute k^−1 (mod n). Where k^−1 is the multiplicative inverse and satisfies k−1

[ ... ]

要么点击链接并继续,通过第 23 页的第 5、6 和 7 步;或通过 Jorky10 在此处通过 python 回答: How to sign and verify signature with ecdsa in python

关于console - 如何从终端使用比特币私钥签署消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15991310/

相关文章:

c++ - 我如何在不中断行的情况下在 C++ 控制台中写入文本

go - 使用不带命令的 PTY

macos - Mac 终端更改 PDF 作者

java - RSA Java 投诉签名和验证

C++ 在没有打开控制台的情况下启动程序

c - 为什么控制台应用程序游戏在笔记本电脑上运行缓慢/滞后

javascript - 需要帮助使用 jquery 从浏览器控制台选择标签

macos - 如何使箭头键在MIT Scheme解释器中起作用?

pdf - 具有多个签名的数字签名 PDF 的到期时间

delphi - 有没有用于数字签名文档的delphi组件?