클라이언트 기능 변경 signrawtransaction deprecated [bitcoin-cli]
안녕하세요 스티밋 여러분!
최근 Bitcoin Core Client를 사용해 보고 있습니다.
Ubuntu Testnet에서 여러가지를 실험해보고 있었는데...

?

;;;;;

signrawtransactionwithkey와 signrawtransactionwithwallet를 검색해봐도 뭐가 없더군요ㅠㅠ
그래서 직접 해보고 정리 글을 남깁니다.
먼저, 사전 준비 작업으로 raw Tx를 하나 생성합니다. (createrawtransaction)
raw transaction 사인 전과 후 작업은 아래 링크를 참고해 주세요
Please check this Link to create a raw transaction.

hex_createrawtransaction = 02000...00000 즉, 새로 생성된 raw tx의 hex값입니다.
이걸 원래는
signrawtransaction으로 서명 했으나, 이제는 아니죠!
signrawtransactionwithkey
signrawtransactionwithkey : 해당 utxo의 privatekey(WIF encoded)로 signFormat
$ bitcoin-cli signrawtransactionwithkey <hex_createrawtransaction> ‘[privateKey1, …]’
Example

Result

signrawtransactionwithwallet
signrawtransactionwithwallet : 기존 signrawtransaction과 유사합니다.
사실, signrawtransaction == signrawtransactionwithwallet 이라 봐도 무관하지 않을까...싶네요
Format
$ bitcoin-cli signrawtransactionwithwallet <hex_createrawtransaction>
그래서 이건 예시 생략합니다! 결과도 동일합니다. 궁금하신 분들은 위 Link에서 보시기 바랍니다.
이후 tx send 과정은 같습니다. 이 역시 위 Link를 참고바랍니다.
0
0
0.000
For future viewers: price of bitcoin at the moment of posting is 9251.90USD
예전의 signrawtransaction이 signrawtransactionwithkey와 ...withwallet으로 쪼개진 것입니다. 예전 걸로는 private key를 줘도 되고 안줘도 됐었고, 안주면 wallet으로 사인했었습니다. 지금은 명시적으로 함수를 나눠서 private로 사인하려면 ...withkey를, 아니면 ...withwallet을 사용하라고 나눈 것 같습니다.
네 그렇더군요. 확실히 명시적으로 나눠 함수 목적성이 분명해진 것 같습니다. bitcoin core도 doc 업데이트를 잘 해주면 좋을텐데 아쉽네요.
Congratulations @jchoy! You received a personal award!
Click here to view your Board
Congratulations @jchoy! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Vote for @Steemitboard as a witness to get one more award and increased upvotes!