我正在尝试使用比特币私钥签署消息以从 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.
- Select a random integer k, 1 ≤ k ≤ n − 1.
- Compute kG = (x1, y1) and convert x1 to an integer x1.
- Compute r = x1 (mod n). If r = 0 then go to step 1.
- 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/