___  ___    _ _    _  _ _____   _____
 / __|/ _ \  | | |  | || |_ _\ \ / / __|
| (_ | (_) | |_  _| | __ || | \ V /| _|
 \___|\___/    |_|  |_||_|___| \_/ |___|

 --- A GOPHER-LIKE INTERFACE FOR HIVE BLOCKCHAIN ---

클라이언트 기능 변경 signrawtransaction deprecated [bitcoin-cli]

BY: @jchoy | CREATED: March 14, 2018, 3:54 a.m. | VOTES: 2 | PAYOUT: $0.00 | [ VOTE ]

안녕하세요 스티밋 여러분!
최근 Bitcoin Core Client를 사용해 보고 있습니다.
Ubuntu Testnet에서 여러가지를 실험해보고 있었는데...
[IMAGE: https://steemitimages.com/DQmX37smZgrUvscZYP4nDMYfMBuMFjj66gKHkiZADB51n82/image.png]
?
[IMAGE: https://steemitimages.com/DQmQ9B9kjZrTQokEkRFh6PDwKP8vRksCnMGqgDbUUBXa7ZD/image.png]
;;;;;
[IMAGE: https://steemitimages.com/DQmVV5o8ra6fgB5ThKmc1N543ygk1yfMzaYdmMKbfFuTwwi/image.png]
signrawtransactionwithkey와 signrawtransactionwithwallet를 검색해봐도 뭐가 없더군요ㅠㅠ

그래서 직접 해보고 정리 글을 남깁니다.

먼저, 사전 준비 작업으로 raw Tx를 하나 생성합니다. (createrawtransaction)
raw transaction 사인 전과 후 작업은 아래 링크를 참고해 주세요
Please check this Link to create a raw transaction.

[IMAGE: https://steemitimages.com/DQmTGfa6EpVnqY3yrxozrSc9zTQE4zjZRwS5cNt8PPodVJh/image.png]
hex_createrawtransaction = 02000...00000 즉, 새로 생성된 raw tx의 hex값입니다.
이걸 원래는 signrawtransaction으로 서명 했으나, 이제는 아니죠!

signrawtransactionwithkey
signrawtransactionwithkey : 해당 utxo의 privatekey(WIF encoded)로 sign
Format
$ bitcoin-cli signrawtransactionwithkey ‘[privateKey1, …]’

Example
[IMAGE: https://steemitimages.com/DQmPXtYGLQbfLxMeTZkZbK3WeV8Q9nrNupjPKQykCb87SZa/image.png]

Result
[IMAGE: https://steemitimages.com/DQmVEtcCYvBXBebzv3wQNGuvAQwvGL5whhtUQTHLa1GzSmo/image.png]

signrawtransactionwithwallet

signrawtransactionwithwallet : 기존 signrawtransaction과 유사합니다.
사실, signrawtransaction == signrawtransactionwithwallet 이라 봐도 무관하지 않을까...싶네요
Format
$ bitcoin-cli signrawtransactionwithwallet

그래서 이건 예시 생략합니다! 결과도 동일합니다. 궁금하신 분들은 위 Link에서 보시기 바랍니다.

이후 tx send 과정은 같습니다. 이 역시 위 Link를 참고바랍니다.

TAGS: [ #kr ] [ #coinkorea ] [ #bitcoin ] [ #blockchain ] [ #cryptocurrency ]

Replies

@ipostbtcprice | March 14, 2018, 3:54 a.m. | Votes: 0 | [ VOTE ]

For future viewers: price of bitcoin at the moment of posting is 9251.90USD

@egonspace | March 14, 2018, 4:45 a.m. | Votes: 1 | [ VOTE ]

예전의 signrawtransaction이 signrawtransactionwithkey와 ...withwallet으로 쪼개진 것입니다. 예전 걸로는 private key를 줘도 되고 안줘도 됐었고, 안주면 wallet으로 사인했었습니다. 지금은 명시적으로 함수를 나눠서 private로 사인하려면 ...withkey를, 아니면 ...withwallet을 사용하라고 나눈 것 같습니다.

@jchoy | March 14, 2018, 5:17 a.m. | Votes: 0 | [ VOTE ]

네 그렇더군요. 확실히 명시적으로 나눠 함수 목적성이 분명해진 것 같습니다. bitcoin core도 doc 업데이트를 잘 해주면 좋을텐데 아쉽네요.

@steemitboard | Feb. 1, 2019, 6:06 a.m. | Votes: 0 | [ VOTE ]

Congratulations @jchoy! You received a personal award!

https://steemitimages.com/70x70/http://steemitboard.com/@jchoy/birthday1.pngHappy Birthday! - You are on the Steem blockchain for 1 year!

Click here to view your Board

> Support SteemitBoard's project! Vote for its witness and get one more award!

@steemitboard | Feb. 1, 2020, 6:49 a.m. | Votes: 0 | [ VOTE ]

Congratulations @jchoy! You received a personal award!

https://steemitimages.com/70x70/http://steemitboard.com/@jchoy/birthday2.pngHappy Birthday! - You are on the Steem blockchain for 2 years!

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!
[ BACK TO TRENDING ] [ BACK TO MENU ]
CMD>