ElementsProject / ElementsProject/elements

signmessage and signmessagewithprivkey don't work unless the address you use is of type legacy

未关闭
#976 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C++
星标
1.2k
派生
416
平均合并
1 天 23 小时
30 天内合并 PR
15

描述

elements-0.18.1.9

signmessage and signmessagewithprivkey only seem to work with p2pkh which is not the default in elements.

With a default address type this errors on signing:

```
elements-cli getnewaddress
AzpoUdjKavd8ZL4NTnaWt4bEYfVo4a5J42pDdAzCrzH3F7M5xk5iNSNCR3RfV9XndGEdnFv5uTs1EBmN

elements-cli signmessage AzpoUdjKavd8ZL4NTnaWt4bEYfVo4a5J42pDdAzCrzH3F7M5xk5iNSNCR3RfV9XndGEdnFv5uTs1EBmN "test"

error code: -3
error message:
Address does not refer to key
```

This will work if you use a legacy address type:

```
elements-cli getnewaddress "" "legacy"
CTEy43xUzkSCZGFnx2YjdoNpN6v8tVRUeBfyAb4N4K7UbqwNvaxjcxJJ5w3aeUtUbznpasycz1RnZksM

elements-cli signmessage CTEy43xUzkSCZGFnx2YjdoNpN6v8tVRUeBfyAb4N4K7UbqwNvaxjcxJJ5w3aeUtUbznpasycz1RnZksM "test"
IAEC8m8LC8DPUNVdKVnWlV00XqoYLWPWn83iP8ZAQ33ZKNyPnoU5cuDCpZCeKdpjqblgz9hKa9xKPW8Uhzue8Us=

elements-cli verifymessage CTEy43xUzkSCZGFnx2YjdoNpN6v8tVRUeBfyAb4N4K7UbqwNvaxjcxJJ5w3aeUtUbznpasycz1RnZksM IAEC8m8LC8DPUNVdKVnWlV00XqoYLWPWn83iP8ZAQ33ZKNyPnoU5cuDCpZCeKdpjqblgz9hKa9xKPW8Uhzue8Us= "test"
true
```

signmessagewithprivkey appears to work but verify stage fails:

```
elements-cli dumpprivkey AzpoUdjKavd8ZL4NTnaWt4bEYfVo4a5J42pDdAzCrzH3F7M5xk5iNSNCR3RfV9XndGEdnFv5uTs1EBmN
cSKSEM2nt24PRNMntCpExVhQbrmk5MffaNgWDS9zxWCt1yJgXvEF

elements-cli signmessagewithprivkey cSKSEM2nt24PRNMntCpExVhQbrmk5MffaNgWDS9zxWCt1yJgXvEF "test"
Hy5mGfJvFmLy6ZWXxxxLwymMvyOBI+vkFpFo8s+oWuFuFQiFN/Rb13L9ZjoUGWjJjGuvGDuhFfHx+Vgsl08xWqY=

elements-cli verifymessage AzpoUdjKavd8ZL4NTnaWt4bEYfVo4a5J42pDdAzCrzH3F7M5xk5iNSNCR3RfV9XndGEdnFv5uTs1EBmN "Hy5mGfJvFmLy6ZWXxxxLwymMvyOBI+vkFpFo8s+oWuFuFQiFN/Rb13L9ZjoUGWjJjGuvGDuhFfHx+Vgsl08xWqY=" "test"
error code: -3
error message:
Address does not refer to key
```

贡献指南

打开贡献指南

调研方向

Reproduce the reported behavior using the elements-cli getnewaddress, signmessage, signmessagewithprivkey, and verifymessage commands shown in the issue. Trace the RPC entry points for these signing and verification operations, then add or run coverage for default and legacy address types. Done means messages can be signed and verified for the default address type as well as legacy addresses.

由索引模型根据 Issue 内容生成。

评估

技术栈
cpp
领域
backend, blockchain
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。