Module: BSV::Wallet::Serializer::RevealSpecificKeyLinkage::Args
- Defined in:
- lib/bsv/wallet/serializer/reveal_specific_key_linkage.rb
Overview
Args wire layout:
[key-related params: protocol + key_id + counterparty + privileged]
[33 bytes: verifier compressed pubkey]
Class Method Summary collapse
Class Method Details
.deserialize(bytes) ⇒ Object
35 36 37 38 39 40 |
# File 'lib/bsv/wallet/serializer/reveal_specific_key_linkage.rb', line 35 def deserialize(bytes) r = BSV::Wallet::Wire::Reader.new(bytes) params = Common.(r) verifier = r.read_bytes(PUBKEY_SIZE) params.merge(verifier: verifier) end |
.serialize(args) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/bsv/wallet/serializer/reveal_specific_key_linkage.rb', line 18 def serialize(args) verifier = args[:verifier] raise BSV::Wallet::InvalidParameterError.new('verifier', 'a 33-byte binary pubkey or 66-char hex') unless verifier w = BSV::Wallet::Wire::Writer.new Common.( w, protocol_id: args[:protocol_id], key_id: args[:key_id], counterparty: args[:counterparty], privileged: args[:privileged], privileged_reason: args[:privileged_reason] ) w.write_bytes(pubkey_bytes(verifier)) w.buf end |