Module: BSV::Wallet::Interface::BRC100
- Included in:
- ProtoWallet
- Defined in:
- lib/bsv/wallet/interface/brc100.rb
Instance Method Summary collapse
-
#abort_action(reference:, originator: nil) ⇒ Object
Aborts a transaction that has not yet been finalized.
-
#acquire_certificate(type:, certifier:, acquisition_protocol:, fields:, serial_number: nil, revocation_outpoint: nil, signature: nil, certifier_url: nil, keyring_revealer: nil, keyring_for_subject: nil, privileged: false, privileged_reason: nil, originator: nil) ⇒ Object
Acquires an identity certificate from a certifier or by direct receipt.
-
#authenticated?(originator: nil) ⇒ Boolean
Checks whether the user is authenticated.
-
#create_action(description:, input_beef: nil, inputs: nil, outputs: nil, lock_time: nil, version: nil, labels: nil, sign_and_process: true, accept_delayed_broadcast: true, trust_self: nil, known_txids: nil, return_txid_only: false, no_send: false, no_send_change: nil, send_with: nil, randomize_outputs: true, originator: nil) ⇒ Hash
Creates a new Bitcoin transaction.
-
#create_hmac(data:, protocol_id:, key_id:, privileged: false, privileged_reason: nil, counterparty: nil, seek_permission: true, originator: nil) ⇒ Object
Creates an HMAC for the provided data.
-
#create_signature(protocol_id:, key_id:, data: nil, hash_to_directly_sign: nil, privileged: false, privileged_reason: nil, counterparty: nil, seek_permission: true, originator: nil) ⇒ Object
Creates a digital signature (ECDSA) for data or a pre-computed hash.
-
#decrypt(ciphertext:, protocol_id:, key_id:, privileged: false, privileged_reason: nil, counterparty: nil, seek_permission: true, originator: nil) ⇒ Object
Decrypts ciphertext using derived keys.
-
#discover_by_attributes(attributes:, limit: 10, offset: 0, seek_permission: true, originator: nil) ⇒ Object
Discovers certificates matching specific attribute values.
-
#discover_by_identity_key(identity_key:, limit: 10, offset: 0, seek_permission: true, originator: nil) ⇒ Object
Discovers certificates issued to a given identity key.
-
#encrypt(plaintext:, protocol_id:, key_id:, privileged: false, privileged_reason: nil, counterparty: nil, seek_permission: true, originator: nil) ⇒ Object
Encrypts plaintext using derived keys.
-
#get_header_for_height(height:, originator: nil) ⇒ Object
Returns the 80-byte block header at the given height.
-
#get_height(originator: nil) ⇒ Object
Returns the current blockchain height.
-
#get_network(originator: nil) ⇒ Object
Returns the network (:mainnet or :testnet).
-
#get_public_key(identity_key: false, protocol_id: nil, key_id: nil, privileged: false, privileged_reason: nil, counterparty: nil, for_self: false, seek_permission: true, originator: nil) ⇒ Hash
Retrieves a derived or identity public key.
-
#get_version(originator: nil) ⇒ Object
Returns the wallet version string.
-
#internalize_action(tx:, outputs:, description:, labels: nil, seek_permission: true, originator: nil) ⇒ Object
Internalizes a transaction — labels it, pays outputs to the wallet balance, inserts outputs into baskets, and/or tags them.
-
#list_actions(labels:, label_query_mode: :any, include_labels: false, include_inputs: false, include_input_source_locking_scripts: false, include_input_unlocking_scripts: false, include_outputs: false, include_output_locking_scripts: false, limit: 10, offset: 0, seek_permission: true, originator: nil) ⇒ Hash
Lists transactions matching the specified labels.
-
#list_certificates(certifiers:, types:, limit: 10, offset: 0, privileged: false, privileged_reason: nil, originator: nil) ⇒ Object
Lists identity certificates filtered by certifier(s) and type(s).
-
#list_outputs(basket:, tags: nil, tag_query_mode: :any, include: nil, include_custom_instructions: false, include_tags: false, include_labels: false, limit: 10, offset: 0, seek_permission: true, originator: nil) ⇒ Hash
Lists spendable outputs in a basket.
-
#prove_certificate(certificate:, fields_to_reveal:, verifier:, privileged: false, privileged_reason: nil, originator: nil) ⇒ Object
Proves select fields of a certificate to a verifier.
-
#relinquish_certificate(type:, serial_number:, certifier:, originator: nil) ⇒ Object
Removes a certificate from the wallet.
-
#relinquish_output(basket:, output:, originator: nil) ⇒ Object
Removes an output from a basket without spending it.
-
#reveal_counterparty_key_linkage(counterparty:, verifier:, privileged: false, privileged_reason: nil, originator: nil) ⇒ Object
Reveals key linkage with a counterparty to a verifier, across all interactions.
-
#reveal_specific_key_linkage(counterparty:, verifier:, protocol_id:, key_id:, privileged: false, privileged_reason: nil, originator: nil) ⇒ Object
Reveals key linkage for a specific protocol and key interaction.
-
#sign_action(spends:, reference:, accept_delayed_broadcast: true, return_txid_only: false, no_send: false, send_with: nil, originator: nil) ⇒ Object
Signs a transaction previously created with #create_action.
-
#verify_hmac(data:, hmac:, protocol_id:, key_id:, privileged: false, privileged_reason: nil, counterparty: nil, seek_permission: true, originator: nil) ⇒ Object
Verifies an HMAC against the provided data.
-
#verify_signature(signature:, protocol_id:, key_id:, data: nil, hash_to_directly_verify: nil, privileged: false, privileged_reason: nil, counterparty: nil, for_self: false, seek_permission: true, originator: nil) ⇒ Object
Verifies a digital signature against data or a pre-computed hash.
-
#wait_for_authentication(originator: nil) ⇒ Object
Blocks until the user is authenticated.
Instance Method Details
#abort_action(reference:, originator: nil) ⇒ Object
Aborts a transaction that has not yet been finalized.
65 66 67 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 65 def abort_action(reference:, originator: nil) raise NotImplementedError end |
#acquire_certificate(type:, certifier:, acquisition_protocol:, fields:, serial_number: nil, revocation_outpoint: nil, signature: nil, certifier_url: nil, keyring_revealer: nil, keyring_for_subject: nil, privileged: false, privileged_reason: nil, originator: nil) ⇒ Object
Acquires an identity certificate from a certifier or by direct receipt.
191 192 193 194 195 196 197 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 191 def acquire_certificate(type:, certifier:, acquisition_protocol:, fields:, serial_number: nil, revocation_outpoint: nil, signature: nil, certifier_url: nil, keyring_revealer: nil, keyring_for_subject: nil, privileged: false, privileged_reason: nil, originator: nil) raise NotImplementedError end |
#authenticated?(originator: nil) ⇒ Boolean
Checks whether the user is authenticated.
237 238 239 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 237 def authenticated?(originator: nil) raise NotImplementedError end |
#create_action(description:, input_beef: nil, inputs: nil, outputs: nil, lock_time: nil, version: nil, labels: nil, sign_and_process: true, accept_delayed_broadcast: true, trust_self: nil, known_txids: nil, return_txid_only: false, no_send: false, no_send_change: nil, send_with: nil, randomize_outputs: true, originator: nil) ⇒ Hash
Creates a new Bitcoin transaction.
43 44 45 46 47 48 49 50 51 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 43 def create_action(description:, input_beef: nil, inputs: nil, outputs: nil, lock_time: nil, version: nil, labels: nil, sign_and_process: true, accept_delayed_broadcast: true, # BRC-100 spec-mandated parameter names — display-order hex txids trust_self: nil, known_txids: nil, return_txid_only: false, no_send: false, no_send_change: nil, send_with: nil, randomize_outputs: true, originator: nil) raise NotImplementedError end |
#create_hmac(data:, protocol_id:, key_id:, privileged: false, privileged_reason: nil, counterparty: nil, seek_permission: true, originator: nil) ⇒ Object
Creates an HMAC for the provided data.
156 157 158 159 160 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 156 def create_hmac(data:, protocol_id:, key_id:, privileged: false, privileged_reason: nil, counterparty: nil, seek_permission: true, originator: nil) raise NotImplementedError end |
#create_signature(protocol_id:, key_id:, data: nil, hash_to_directly_sign: nil, privileged: false, privileged_reason: nil, counterparty: nil, seek_permission: true, originator: nil) ⇒ Object
Creates a digital signature (ECDSA) for data or a pre-computed hash.
170 171 172 173 174 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 170 def create_signature(protocol_id:, key_id:, data: nil, hash_to_directly_sign: nil, privileged: false, privileged_reason: nil, counterparty: nil, seek_permission: true, originator: nil) raise NotImplementedError end |
#decrypt(ciphertext:, protocol_id:, key_id:, privileged: false, privileged_reason: nil, counterparty: nil, seek_permission: true, originator: nil) ⇒ Object
Decrypts ciphertext using derived keys.
149 150 151 152 153 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 149 def decrypt(ciphertext:, protocol_id:, key_id:, privileged: false, privileged_reason: nil, counterparty: nil, seek_permission: true, originator: nil) raise NotImplementedError end |
#discover_by_attributes(attributes:, limit: 10, offset: 0, seek_permission: true, originator: nil) ⇒ Object
Discovers certificates matching specific attribute values.
229 230 231 232 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 229 def discover_by_attributes(attributes:, limit: 10, offset: 0, seek_permission: true, originator: nil) raise NotImplementedError end |
#discover_by_identity_key(identity_key:, limit: 10, offset: 0, seek_permission: true, originator: nil) ⇒ Object
Discovers certificates issued to a given identity key.
221 222 223 224 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 221 def discover_by_identity_key(identity_key:, limit: 10, offset: 0, seek_permission: true, originator: nil) raise NotImplementedError end |
#encrypt(plaintext:, protocol_id:, key_id:, privileged: false, privileged_reason: nil, counterparty: nil, seek_permission: true, originator: nil) ⇒ Object
Encrypts plaintext using derived keys.
142 143 144 145 146 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 142 def encrypt(plaintext:, protocol_id:, key_id:, privileged: false, privileged_reason: nil, counterparty: nil, seek_permission: true, originator: nil) raise NotImplementedError end |
#get_header_for_height(height:, originator: nil) ⇒ Object
Returns the 80-byte block header at the given height.
254 255 256 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 254 def get_header_for_height(height:, originator: nil) raise NotImplementedError end |
#get_height(originator: nil) ⇒ Object
Returns the current blockchain height.
249 250 251 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 249 def get_height(originator: nil) raise NotImplementedError end |
#get_network(originator: nil) ⇒ Object
Returns the network (:mainnet or :testnet).
259 260 261 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 259 def get_network(originator: nil) raise NotImplementedError end |
#get_public_key(identity_key: false, protocol_id: nil, key_id: nil, privileged: false, privileged_reason: nil, counterparty: nil, for_self: false, seek_permission: true, originator: nil) ⇒ Hash
Retrieves a derived or identity public key.
118 119 120 121 122 123 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 118 def get_public_key(identity_key: false, protocol_id: nil, key_id: nil, privileged: false, privileged_reason: nil, counterparty: nil, for_self: false, seek_permission: true, originator: nil) raise NotImplementedError end |
#get_version(originator: nil) ⇒ Object
Returns the wallet version string.
264 265 266 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 264 def get_version(originator: nil) raise NotImplementedError end |
#internalize_action(tx:, outputs:, description:, labels: nil, seek_permission: true, originator: nil) ⇒ Object
Internalizes a transaction — labels it, pays outputs to the wallet balance, inserts outputs into baskets, and/or tags them.
90 91 92 93 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 90 def internalize_action(tx:, outputs:, description:, labels: nil, seek_permission: true, originator: nil) raise NotImplementedError end |
#list_actions(labels:, label_query_mode: :any, include_labels: false, include_inputs: false, include_input_source_locking_scripts: false, include_input_unlocking_scripts: false, include_outputs: false, include_output_locking_scripts: false, limit: 10, offset: 0, seek_permission: true, originator: nil) ⇒ Hash
Lists transactions matching the specified labels.
72 73 74 75 76 77 78 79 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 72 def list_actions(labels:, label_query_mode: :any, include_labels: false, include_inputs: false, include_input_source_locking_scripts: false, include_input_unlocking_scripts: false, include_outputs: false, include_output_locking_scripts: false, limit: 10, offset: 0, seek_permission: true, originator: nil) raise NotImplementedError end |
#list_certificates(certifiers:, types:, limit: 10, offset: 0, privileged: false, privileged_reason: nil, originator: nil) ⇒ Object
Lists identity certificates filtered by certifier(s) and type(s).
200 201 202 203 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 200 def list_certificates(certifiers:, types:, limit: 10, offset: 0, privileged: false, privileged_reason: nil, originator: nil) raise NotImplementedError end |
#list_outputs(basket:, tags: nil, tag_query_mode: :any, include: nil, include_custom_instructions: false, include_tags: false, include_labels: false, limit: 10, offset: 0, seek_permission: true, originator: nil) ⇒ Hash
Lists spendable outputs in a basket.
99 100 101 102 103 104 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 99 def list_outputs(basket:, tags: nil, tag_query_mode: :any, include: nil, include_custom_instructions: false, include_tags: false, include_labels: false, limit: 10, offset: 0, seek_permission: true, originator: nil) raise NotImplementedError end |
#prove_certificate(certificate:, fields_to_reveal:, verifier:, privileged: false, privileged_reason: nil, originator: nil) ⇒ Object
Proves select fields of a certificate to a verifier.
210 211 212 213 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 210 def prove_certificate(certificate:, fields_to_reveal:, verifier:, privileged: false, privileged_reason: nil, originator: nil) raise NotImplementedError end |
#relinquish_certificate(type:, serial_number:, certifier:, originator: nil) ⇒ Object
Removes a certificate from the wallet.
216 217 218 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 216 def relinquish_certificate(type:, serial_number:, certifier:, originator: nil) raise NotImplementedError end |
#relinquish_output(basket:, output:, originator: nil) ⇒ Object
Removes an output from a basket without spending it.
107 108 109 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 107 def relinquish_output(basket:, output:, originator: nil) raise NotImplementedError end |
#reveal_counterparty_key_linkage(counterparty:, verifier:, privileged: false, privileged_reason: nil, originator: nil) ⇒ Object
Reveals key linkage with a counterparty to a verifier, across all interactions.
126 127 128 129 130 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 126 def reveal_counterparty_key_linkage(counterparty:, verifier:, privileged: false, privileged_reason: nil, originator: nil) raise NotImplementedError end |
#reveal_specific_key_linkage(counterparty:, verifier:, protocol_id:, key_id:, privileged: false, privileged_reason: nil, originator: nil) ⇒ Object
Reveals key linkage for a specific protocol and key interaction.
133 134 135 136 137 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 133 def reveal_specific_key_linkage(counterparty:, verifier:, protocol_id:, key_id:, privileged: false, privileged_reason: nil, originator: nil) raise NotImplementedError end |
#sign_action(spends:, reference:, accept_delayed_broadcast: true, return_txid_only: false, no_send: false, send_with: nil, originator: nil) ⇒ Object
Signs a transaction previously created with #create_action.
57 58 59 60 61 62 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 57 def sign_action(spends:, reference:, accept_delayed_broadcast: true, return_txid_only: false, # BRC-100 spec-mandated parameter name no_send: false, send_with: nil, originator: nil) raise NotImplementedError end |
#verify_hmac(data:, hmac:, protocol_id:, key_id:, privileged: false, privileged_reason: nil, counterparty: nil, seek_permission: true, originator: nil) ⇒ Object
Verifies an HMAC against the provided data.
163 164 165 166 167 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 163 def verify_hmac(data:, hmac:, protocol_id:, key_id:, privileged: false, privileged_reason: nil, counterparty: nil, seek_permission: true, originator: nil) raise NotImplementedError end |
#verify_signature(signature:, protocol_id:, key_id:, data: nil, hash_to_directly_verify: nil, privileged: false, privileged_reason: nil, counterparty: nil, for_self: false, seek_permission: true, originator: nil) ⇒ Object
Verifies a digital signature against data or a pre-computed hash.
177 178 179 180 181 182 183 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 177 def verify_signature(signature:, protocol_id:, key_id:, data: nil, hash_to_directly_verify: nil, privileged: false, privileged_reason: nil, counterparty: nil, for_self: false, seek_permission: true, originator: nil) raise NotImplementedError end |
#wait_for_authentication(originator: nil) ⇒ Object
Blocks until the user is authenticated.
242 243 244 |
# File 'lib/bsv/wallet/interface/brc100.rb', line 242 def wait_for_authentication(originator: nil) raise NotImplementedError end |