@@ -290,20 +290,19 @@ be accepted to the daemon's memory pool.
290290
291291 0.0
292292
293- blockchain.scripthash .get_balance
294- =================================
293+ blockchain.scriptpubkey .get_balance
294+ ===================================
295295
296- Return the confirmed and unconfirmed balances of a :ref: `script hash
297- <script hashes>`.
296+ Return the confirmed and unconfirmed balances of a :ref: `scriptPubKey <scriptpubkeys >`.
298297
299298**Signature **
300299
301- .. function :: blockchain.scripthash .get_balance(scripthash )
302- .. versionadded :: 1.1
300+ .. function :: blockchain.scriptpubkey .get_balance(scriptpubkey )
301+ .. versionadded :: 1.6
303302
304- *scripthash *
303+ *scriptpubkey *
305304
306- The script hash as a hexadecimal string.
305+ The scriptPubKey as a hexadecimal string.
307306
308307**Result **
309308
@@ -322,25 +321,24 @@ Return the confirmed and unconfirmed balances of a :ref:`script hash
322321 "unconfirmed": 23684400
323322 }
324323
325- blockchain.scripthash .get_history
326- =================================
324+ blockchain.scriptpubkey .get_history
325+ ===================================
327326
328- Return the confirmed and unconfirmed history of a :ref: `script hash
329- <script hashes>`.
327+ Return the confirmed and unconfirmed history of a :ref: `scriptPubKey <scriptpubkeys >`.
330328
331329**Signature **
332330
333- .. function :: blockchain.scripthash .get_history(scripthash )
334- .. versionadded :: 1.1
331+ .. function :: blockchain.scriptpubkey .get_history(scriptpubkey )
332+ .. versionadded :: 1.6
335333
336- *scripthash *
334+ *scriptpubkey *
337335
338- The script hash as a hexadecimal string.
336+ The scriptPubKey as a hexadecimal string.
339337
340338**Result **
341339
342340 A list of confirmed transactions in blockchain order, with the
343- output of :func: `blockchain.scripthash .get_mempool ` appended to the
341+ output of :func: `blockchain.scriptpubkey .get_mempool ` appended to the
344342 list. Each confirmed transaction is a dictionary with the following
345343 keys:
346344
@@ -352,7 +350,7 @@ Return the confirmed and unconfirmed history of a :ref:`script hash
352350
353351 The transaction hash in hexadecimal.
354352
355- See :func: `blockchain.scripthash .get_mempool ` for how mempool
353+ See :func: `blockchain.scriptpubkey .get_mempool ` for how mempool
356354 transactions are returned.
357355
358356**Result Examples **
@@ -380,27 +378,26 @@ Return the confirmed and unconfirmed history of a :ref:`script hash
380378 }
381379 ]
382380
383- blockchain.scripthash .get_mempool
384- =================================
381+ blockchain.scriptpubkey .get_mempool
382+ ===================================
385383
386- Return the unconfirmed transactions of a :ref: `script hash <script
387- hashes>`.
384+ Return the unconfirmed transactions of a :ref: `scriptPubKey <scriptpubkeys >`.
388385
389386**Signature **
390387
391- .. function :: blockchain.scripthash .get_mempool(scripthash )
392- .. versionadded :: 1.1
388+ .. function :: blockchain.scriptpubkey .get_mempool(scriptpubkey )
389+ .. versionadded :: 1.6
393390 .. versionchanged :: 1.6
394391 results must be sorted (previously undefined order)
395392
396- *scripthash *
393+ *scriptpubkey *
397394
398- The script hash as a hexadecimal string.
395+ The scriptPubKey as a hexadecimal string.
399396
400397**Result **
401398
402399 A list of mempool transactions. The order is the same as when computing the
403- :ref: `status <status >` of the script hash .
400+ :ref: `status <status >` of the scriptPubKey .
404401 Each mempool transaction is a dictionary with the following keys:
405402
406403 * *height *
@@ -428,19 +425,19 @@ hashes>`.
428425 ]
429426
430427
431- blockchain.scripthash .listunspent
432- =================================
428+ blockchain.scriptpubkey .listunspent
429+ ===================================
433430
434- Return an ordered list of UTXOs sent to a script hash .
431+ Return an ordered list of UTXOs sent to a :ref: ` scriptPubKey < scriptpubkeys >` .
435432
436433**Signature **
437434
438- .. function :: blockchain.scripthash .listunspent(scripthash )
439- .. versionadded :: 1.1
435+ .. function :: blockchain.scriptpubkey .listunspent(scriptpubkey )
436+ .. versionadded :: 1.6
440437
441- *scripthash *
438+ *scriptpubkey *
442439
443- The script hash as a hexadecimal string.
440+ The scriptPubKey as a hexadecimal string.
444441
445442**Result **
446443
@@ -501,50 +498,59 @@ Return an ordered list of UTXOs sent to a script hash.
501498
502499.. _subscribed :
503500
504- blockchain.scripthash .subscribe
505- ===============================
501+ blockchain.scriptpubkey .subscribe
502+ =================================
506503
507- Subscribe to a script hash .
504+ Subscribe to a :ref: ` scriptPubKey < scriptpubkeys >` .
508505
509506**Signature **
510507
511- .. function :: blockchain.scripthash .subscribe(scripthash )
512- .. versionadded :: 1.1
508+ .. function :: blockchain.scriptpubkey .subscribe(scriptpubkey )
509+ .. versionadded :: 1.6
513510
514- *scripthash *
511+ *scriptpubkey *
515512
516- The script hash as a hexadecimal string.
513+ The scriptPubKey as a hexadecimal string.
517514
518515**Result **
519516
520- The :ref: `status <status >` of the script hash .
517+ The :ref: `status <status >` of the scriptPubKey .
521518
522519**Notifications **
523520
524- The client will receive a notification when the :ref: `status <status >` of the script
525- hash changes. Its signature is
526-
527- .. function :: blockchain.scripthash.subscribe(scripthash, status)
521+ The client will receive a notification when the :ref: `status <status >` of the
522+ scriptPubKey changes. Importantly, the notifications use :ref: `script hash <script hashes >`
523+ instead of scriptPubKey. The scripthash corresponds to the scriptPubKey from the
524+ original request.
525+ The client is expected to maintain a mapping scripthash->scriptpubkey, or similar,
526+ to be able to figure out what the notification refers to.
527+ Notably, this way servers do not have to store in memory the scriptpubkey corresponding
528+ to the original request (which can be up to 10 KB in size, as per Bitcoin consensus),
529+ only the scripthash (which is fixed size). Also, this limits upstream bandwidth usage
530+ of servers.
531+ The signature is
532+
533+ .. function :: blockchain.scriptpubkey.subscribe(scripthash, status)
528534 :noindex:
529535
530- blockchain.scripthash .unsubscribe
531- =================================
536+ blockchain.scriptpubkey .unsubscribe
537+ ===================================
532538
533- Unsubscribe from a script hash , preventing future notifications if its :ref: `status
539+ Unsubscribe from a scriptPubKey , preventing future notifications if its :ref: `status
534540<status>` changes.
535541
536542**Signature **
537543
538- .. function :: blockchain.scripthash .unsubscribe(scripthash )
539- .. versionadded :: 1.4.2
544+ .. function :: blockchain.scriptpubkey .unsubscribe(scriptpubkey )
545+ .. versionadded :: 1.6
540546
541- *scripthash *
547+ *scriptpubkey *
542548
543- The script hash as a hexadecimal string.
549+ The scriptPubKey as a hexadecimal string.
544550
545551**Result **
546552
547- Returns :const: `True ` if the scripthash was subscribed to, otherwise :const: `False `.
553+ Returns :const: `True ` if the scriptpubkey was subscribed to, otherwise :const: `False `.
548554 Note that :const: `False ` might be returned even for something subscribed to earlier,
549555 because the server can drop subscriptions in rare circumstances.
550556
@@ -1188,6 +1194,7 @@ Return a list of features and services supported by the server.
11881194 .. function :: server.features()
11891195 .. versionchanged :: 1.6
11901196 added *method_flavours * field to result
1197+ removed *hash_function * field from result
11911198
11921199**Result **
11931200
@@ -1224,14 +1231,6 @@ Return a list of features and services supported by the server.
12241231 The hash of the genesis block. This is used to detect if a peer
12251232 is connected to one serving a different network.
12261233
1227- * *hash_function *
1228-
1229- The hash function the server uses for :ref: `script hashing
1230- <script hashes>`. The client must use this function to hash
1231- pay-to-scripts to produce script hashes to send to the server.
1232- The default is "sha256". "sha256" is currently the only
1233- acceptable value.
1234-
12351234 * *server_version *
12361235
12371236 A string that identifies the server software. Should be the same
@@ -1272,7 +1271,6 @@ Return a list of features and services supported by the server.
12721271 "protocol_min": "1.0",
12731272 "pruning": null,
12741273 "server_version": "ElectrumX 1.0.17",
1275- "hash_function": "sha256",
12761274 "method_flavours": {
12771275 "blockchain.outpoint.subscribe": {"requires_spk_hint": true},
12781276 "blockchain.transaction.get": {"supports_verbose_true": false}
0 commit comments