How to sign bitcoin transactions using JCE primitives?
23 views
Skip to first unread message
Антон Долгополов
unread,
Jun 27, 2019, 10:15:04 AM6/27/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bitcoinj
Our company decided to use cloud HSM solutions instead of storing private keys in wallet files. That means that could HSM will generate keys and sign any data without compromising private keys. This HSM has JCE interface with its own provider. I found out how to create Bitcoin MultiSig addresses with it, but I cannot sign anything. Could you please take a look? Here is my code on Gist. Code is very simple, just 70 lines. Here is my output:
My signature s 15049647728136903136242197185843868386816894587707341569093673434251201365745 r 47232836412607535604858149488636859024055618718700726365263254587236051549984 canonical true
Verify my true
Bitcoinj signature s 50964035744498486600571392716871069156607582951343374442588735702293676462513 r 2242289704784843488107710601209509865833798320147928897700948751610583470176 canonical true
Verify Bitcoinj false
These signatures are completely different, even though I used the same private keys for both. What is wrong with my code? Could you please help me?
Andreas Schildbach
unread,
Jul 2, 2019, 6:00:04 PM7/2/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bitc...@googlegroups.com
There is no built-in support for signing via HSM. You could try to
implement a org.bitcoinj.signers.TransactionSigner.
On 27/06/2019 16.15, Антон Долгополов wrote:
> Our company decided to use cloud HSM solutions instead of storing
> private keys in wallet files. That means that could HSM will generate
> keys and sign any data without compromising private keys. This HSM has
> JCE interface with its own provider. I found out how to create Bitcoin
> MultiSig addresses with it, but I cannot sign anything. Could you please
> take a look? Here is my code on Gist
> Code is very simple, just 70 lines. Here is my output:
>
> My signature s
> 15049647728136903136242197185843868386816894587707341569093673434251201365745
> r
> 47232836412607535604858149488636859024055618718700726365263254587236051549984
> canonical true
> Verify my true
> Bitcoinj signature s
> 50964035744498486600571392716871069156607582951343374442588735702293676462513
> r
> 2242289704784843488107710601209509865833798320147928897700948751610583470176
> canonical true
> Verify Bitcoinj false
>
> These signatures are completely different, even though I used the same
> private keys for both. What is wrong with my code? Could you please help
> me?
>