Introducing Non-Replicated Queries for Bitcoin Canister

Beginning with dfx version 0.19.0, we are rolling out non-replicated queries for the Bitcoin canister, specifically bitcoin_get_balance_query and bitcoin_get_utxos_query. It’s important to note that these APIs are targeting single replicas, making them inherently unsafe. This update facilitates a swift access path without the need for cycle payments. Consequently, users can directly access the Bitcoin canister network via Ingress messages, bypassing intermediary canisters.

Here’s an example of how you can utilize this feature:

dfx canister --network=ic call aaaaa-aa --query bitcoin_get_balance_query '(record {
 network = variant { mainnet };
 address = "38XnPvu9PmonFU9WouPXUjYbW91wa5MerL";
})'
WARN: Cannot fetch Candid interface for bitcoin_get_balance_query, sending arguments with inferred types.
WARN: bitcoin_get_balance_query call to the management canister cannot be benefit from the "Replica Signed Queries" feature.
The response might not be trustworthy.
If you want to get reliable result, you can make an update call to the secure alternative: bitcoin_get_balance
(2_547_058_832 : nat64)

and

dfx canister --network=ic call aaaaa-aa --query bitcoin_get_utxos_query '(record {
 network = variant { mainnet };
 address = "38XnPvu9PmonFU9WouPXUjYbW91wa5MerL";
})'
WARN: Cannot fetch Candid interface for bitcoin_get_utxos_query, sending arguments with inferred types.
WARN: bitcoin_get_utxos_query call to the management canister cannot be benefit from the "Replica Signed Queries" feature.
The response might not be trustworthy.
If you want to get reliable result, you can make an update call to the secure alternative: bitcoin_get_utxos
(
  record {
    293_249_115 = null;
    496_462_219 = 837_672 : nat32;
    2_769_715_940 = blob "\b6\02\cc\26\b3\9e\de\7d\dd\7f\47\19\34\32\34\49\9d\d3\85\9a\b0\2a\03\00\00\00\00\00\00\00\00\00";
    2_867_465_885 = vec { record { 38_537_191 = 836_194 : nat32; 834_174_833 = 546 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\f2\7f\e8\48\30\7e\23\83\c4\6a\23\fd\d0\f1\fc\47\dc\11\7f\ab\3d\94\12\f0\92\a8\84\77\47\2d\eb\d0"; 1_314_115_032 = 909 : nat32;};}; record { 38_537_191 = 836_105 : nat32; 834_174_833 = 633_424_411 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\cf\59\1e\02\ee\12\44\e7\8f\32\35\41\54\d2\ce\ed\23\f5\cf\5d\08\77\20\60\17\81\79\27\28\c2\06\52"; 1_314_115_032 = 1 : nat32;};}; record { 38_537_191 = 836_104 : nat32; 834_174_833 = 634_539_989 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\f2\16\8f\be\f0\25\78\8b\b0\06\ec\1b\dc\3a\45\a4\74\4f\7e\42\95\96\f3\8c\2c\f1\08\62\1c\81\a6\a2"; 1_314_115_032 = 1 : nat32;};}; record { 38_537_191 = 836_102 : nat32; 834_174_833 = 632_977_777 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\12\8f\3f\73\29\f2\e4\1d\b5\cc\dc\99\3e\16\2e\54\6c\e2\e5\68\6c\2b\b9\f8\16\67\e1\de\5e\12\fd\e4"; 1_314_115_032 = 1 : nat32;};}; record { 38_537_191 = 836_097 : nat32; 834_174_833 = 645_505_001 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\f9\6b\e9\f3\ce\bd\9a\c4\41\c7\91\10\98\70\af\c1\6f\03\b6\d8\55\79\86\b8\d1\93\82\41\ff\36\1c\6c"; 1_314_115_032 = 1 : nat32;};}; record { 38_537_191 = 835_834 : nat32; 834_174_833 = 546 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\42\e4\87\d1\9a\7c\07\0c\77\bc\c3\c5\46\01\53\57\32\a7\62\e1\31\bf\dd\59\00\60\ce\56\0d\be\7f\69"; 1_314_115_032 = 466 : nat32;};}; record { 38_537_191 = 835_652 : nat32; 834_174_833 = 3_000 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\5e\20\47\a7\64\3c\25\ba\4c\25\31\14\15\f0\cc\aa\82\d6\6d\da\f7\2f\a0\de\6f\3e\b3\2f\2e\8c\46\fd"; 1_314_115_032 = 0 : nat32;};}; record { 38_537_191 = 834_708 : nat32; 834_174_833 = 546 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\2c\15\8a\d1\c7\d2\01\59\32\29\df\f8\5d\73\72\64\b7\74\71\d3\39\09\2e\33\8b\35\42\d1\cd\af\3d\5f"; 1_314_115_032 = 926 : nat32;};}; record { 38_537_191 = 829_635 : nat32; 834_174_833 = 546 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\39\c3\0a\53\d9\1b\19\d6\02\cd\07\4e\e5\cb\71\ef\e4\73\85\61\15\5a\bc\f7\80\fd\63\14\65\d5\56\ab"; 1_314_115_032 = 0 : nat32;};}; record { 38_537_191 = 828_029 : nat32; 834_174_833 = 9_000 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\8d\72\dc\9e\11\41\fc\29\b9\41\7c\eb\aa\ba\4f\fc\be\87\31\41\26\40\b1\77\1c\90\ab\db\91\91\fc\6d"; 1_314_115_032 = 115 : nat32;};}; record { 38_537_191 = 826_291 : nat32; 834_174_833 = 600 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\f6\39\6f\5e\76\ee\f3\fb\7d\89\17\13\66\67\80\d8\d2\5d\6c\d0\c1\60\14\aa\59\1c\87\8b\07\df\b4\ca"; 1_314_115_032 = 0 : nat32;};}; record { 38_537_191 = 820_616 : nat32; 834_174_833 = 15_000 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\08\54\33\92\80\85\01\4b\53\0b\08\0f\2a\e3\46\78\ee\a8\40\30\c8\10\3c\f7\b0\f2\eb\b6\18\94\5d\6a"; 1_314_115_032 = 3 : nat32;};}; record { 38_537_191 = 819_293 : nat32; 834_174_833 = 11_217 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\be\b0\b8\bc\e0\18\79\81\83\26\4c\f9\58\ed\d1\aa\ee\c1\20\d5\0a\be\aa\86\cc\5a\0c\4c\bd\c6\b7\00"; 1_314_115_032 = 0 : nat32;};}; record { 38_537_191 = 816_609 : nat32; 834_174_833 = 13_559 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\50\e5\51\c1\40\fa\4a\86\47\09\f3\ba\70\1c\ae\74\7e\7e\1a\23\e0\7e\64\b7\76\e9\5b\91\64\14\d5\6e"; 1_314_115_032 = 31 : nat32;};}; record { 38_537_191 = 813_859 : nat32; 834_174_833 = 7_500 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\40\45\1d\47\2a\40\ad\87\fc\11\5a\c5\34\d0\91\8e\46\ea\89\30\43\c6\0e\a1\81\ba\f4\32\5f\6f\ca\f9"; 1_314_115_032 = 0 : nat32;};}; record { 38_537_191 = 813_258 : nat32; 834_174_833 = 30_394 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\24\0c\6d\a5\dd\a8\e7\e1\fd\a8\25\d1\8c\f9\d7\24\c4\00\4b\2f\2f\6e\d2\51\e2\14\ba\d6\15\a2\bc\79"; 1_314_115_032 = 39 : nat32;};}; record { 38_537_191 = 811_622 : nat32; 834_174_833 = 600 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\58\0f\0b\73\c2\30\f1\df\cc\41\38\28\b2\a5\6c\bc\7e\4d\a5\ce\64\ba\4e\fe\5a\63\ea\de\73\b7\6d\86"; 1_314_115_032 = 4 : nat32;};}; record { 38_537_191 = 811_121 : nat32; 834_174_833 = 600 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\2a\30\7e\4b\1e\36\f8\1d\3f\1d\79\82\41\af\7e\a0\ce\b7\d5\e0\b1\b2\01\25\f6\72\fb\33\45\b2\50\a6"; 1_314_115_032 = 1 : nat32;};}; record { 38_537_191 = 809_929 : nat32; 834_174_833 = 7_500 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\a2\88\02\d0\f2\d5\53\0a\89\76\c2\fa\b5\97\d5\8f\77\37\d3\59\c4\0c\8a\a4\58\95\1c\5d\ec\d7\9d\4e"; 1_314_115_032 = 0 : nat32;};}; record { 38_537_191 = 804_954 : nat32; 834_174_833 = 40_619 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\7d\cb\cd\6e\75\d4\b7\35\f2\6b\1b\47\d0\9a\ed\33\ea\87\b3\79\77\84\10\8a\c9\c9\56\0c\b6\6c\cf\83"; 1_314_115_032 = 119 : nat32;};}; record { 38_537_191 = 804_708 : nat32; 834_174_833 = 39_778 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\72\f6\43\62\63\51\12\7d\c0\63\e2\94\99\96\e0\80\8c\0d\5f\54\f7\c7\fc\7b\e5\9e\fa\25\b1\7f\c0\17"; 1_314_115_032 = 106 : nat32;};}; record { 38_537_191 = 804_621 : nat32; 834_174_833 = 18_944 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\fa\6c\58\91\72\48\89\dd\de\95\ff\52\cc\a5\81\be\5b\69\0e\9a\d4\b7\fd\b7\14\7e\c1\db\24\ab\b9\cb"; 1_314_115_032 = 35 : nat32;};}; record { 38_537_191 = 800_843 : nat32; 834_174_833 = 37_848 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\85\5a\dc\70\91\34\af\52\9a\cc\97\69\20\6d\bf\aa\ce\44\bb\16\35\17\e6\86\d9\88\7b\45\b6\39\50\ae"; 1_314_115_032 = 13 : nat32;};}; record { 38_537_191 = 800_021 : nat32; 834_174_833 = 9_222 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\49\b3\f2\91\34\4a\74\d6\a0\54\7e\21\54\84\2d\ae\ab\aa\09\9f\77\6f\64\b5\97\27\64\27\12\bb\18\c1"; 1_314_115_032 = 49 : nat32;};}; record { 38_537_191 = 798_736 : nat32; 834_174_833 = 9_696 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\21\8d\6c\f5\6b\8b\7f\99\86\8e\48\1a\0c\5f\d8\5b\a5\62\7e\aa\83\f5\d6\ee\08\1f\6f\bc\10\2a\aa\6a"; 1_314_115_032 = 78 : nat32;};}; record { 38_537_191 = 794_212 : nat32; 834_174_833 = 600 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\a9\bb\93\5b\ff\cb\b3\cf\69\fa\19\09\0b\40\e1\4d\2a\0a\08\f7\d4\f0\27\1f\da\b2\c1\87\47\4e\08\c9"; 1_314_115_032 = 0 : nat32;};}; record { 38_537_191 = 788_053 : nat32; 834_174_833 = 3_493 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\c5\6b\cd\8e\49\57\d6\7d\6c\c2\df\30\1c\08\18\9c\af\9c\e7\83\ab\1e\c9\fb\91\bf\71\e1\e7\b4\a6\30"; 1_314_115_032 = 0 : nat32;};}; record { 38_537_191 = 782_391 : nat32; 834_174_833 = 7_261 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\92\fa\89\b5\3c\68\1c\db\85\6a\be\99\1b\89\f6\4a\de\06\15\36\54\f0\2a\72\ab\8c\c4\9d\4c\99\1d\46"; 1_314_115_032 = 146 : nat32;};}; record { 38_537_191 = 780_850 : nat32; 834_174_833 = 1_000 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\2a\de\8d\97\15\35\19\2a\86\b1\62\a2\4d\08\cc\cd\d8\7d\7c\de\d8\eb\a1\04\3e\62\08\81\ef\83\02\36"; 1_314_115_032 = 1 : nat32;};}; record { 38_537_191 = 779_756 : nat32; 834_174_833 = 9_000 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\1a\eb\84\6d\f0\e8\4d\70\e8\bb\73\35\26\fa\f5\b6\0f\3c\c7\c6\1c\30\2d\a8\2e\4a\d6\e7\c6\91\b8\d9"; 1_314_115_032 = 0 : nat32;};}; record { 38_537_191 = 775_785 : nat32; 834_174_833 = 22_441 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\06\ea\f7\e9\78\b7\f7\bb\51\c0\8d\1c\17\11\75\0a\f2\c2\47\76\60\e1\5b\ba\83\12\23\e4\b5\0b\9f\5d"; 1_314_115_032 = 144 : nat32;};}; record { 38_537_191 = 773_425 : nat32; 834_174_833 = 600 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\b9\59\29\64\e0\62\5f\15\35\fd\4b\d0\5b\1a\08\0b\cc\b7\b4\07\1c\54\ff\26\f4\a0\e4\f9\8b\d2\1e\53"; 1_314_115_032 = 1 : nat32;};}; record { 38_537_191 = 768_730 : nat32; 834_174_833 = 5_942 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\bb\8c\d8\bd\d1\24\08\95\50\b8\87\1c\11\74\e9\5f\fa\30\1c\2e\25\00\15\79\f2\55\c8\fe\9e\dc\56\6c"; 1_314_115_032 = 87 : nat32;};}; record { 38_537_191 = 764_504 : nat32; 834_174_833 = 6_007 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\05\1f\13\32\30\68\8a\34\ae\f9\db\40\23\cb\79\09\03\89\a3\ad\de\48\f1\d6\b6\9b\17\4b\c5\8a\19\49"; 1_314_115_032 = 111 : nat32;};}; record { 38_537_191 = 764_397 : nat32; 834_174_833 = 21_784 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\2a\fe\73\85\47\6d\c3\40\58\93\3c\57\86\8e\22\11\9f\e5\ec\d1\a8\d8\b5\f1\96\86\61\b0\99\36\4b\5d"; 1_314_115_032 = 43 : nat32;};}; record { 38_537_191 = 757_305 : nat32; 834_174_833 = 2_000 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\dd\f8\c4\af\d1\be\f1\8b\17\4d\1c\8f\fc\22\e1\ba\96\25\95\59\28\cb\16\17\07\3d\f8\6c\69\c9\02\5a"; 1_314_115_032 = 0 : nat32;};}; record { 38_537_191 = 757_201 : nat32; 834_174_833 = 5_000 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\02\93\d6\98\ea\8c\67\6f\e3\fa\c1\25\3e\82\dd\3d\63\d8\e0\2b\ea\e0\a9\84\dc\59\d9\d8\22\14\03\ac"; 1_314_115_032 = 0 : nat32;};}; record { 38_537_191 = 752_877 : nat32; 834_174_833 = 5_015 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\61\93\3a\89\dd\3f\93\9c\a2\fc\ac\b8\f3\b4\7f\ec\cb\e2\d6\60\d6\c8\83\dc\77\3d\c5\09\45\58\11\6d"; 1_314_115_032 = 32 : nat32;};}; record { 38_537_191 = 752_555 : nat32; 834_174_833 = 17_945 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\d2\7a\98\29\fd\79\76\93\cf\7a\bc\4d\fc\41\f5\5d\c7\6f\03\56\c0\db\74\0f\08\70\0c\1b\a8\d2\4f\88"; 1_314_115_032 = 31 : nat32;};}; record { 38_537_191 = 743_175 : nat32; 834_174_833 = 5_100 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\4e\39\86\c7\45\34\d2\7f\53\e3\ac\57\bb\44\b8\5a\56\81\80\d3\3d\dd\ad\ac\3e\42\32\cb\8a\b7\60\7d"; 1_314_115_032 = 52 : nat32;};}; record { 38_537_191 = 742_849 : nat32; 834_174_833 = 61_075 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\37\51\40\18\70\ef\1b\c3\4b\38\05\eb\39\1e\5c\36\4a\04\ea\f8\6a\ee\6e\50\09\53\33\22\f1\fa\74\3f"; 1_314_115_032 = 47 : nat32;};}; record { 38_537_191 = 741_021 : nat32; 834_174_833 = 11_186 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\f6\41\88\2a\03\54\d7\f2\d4\ed\36\ab\86\46\63\34\a0\20\49\1b\bd\55\28\ef\85\7d\38\a0\a6\4e\f5\17"; 1_314_115_032 = 53 : nat32;};}; record { 38_537_191 = 737_469 : nat32; 834_174_833 = 5_000 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\18\73\7a\fb\00\5b\6d\c4\98\2a\30\62\a1\2d\6f\35\eb\7c\ae\48\9d\df\39\5c\1e\cb\20\87\cc\a0\b0\39"; 1_314_115_032 = 71 : nat32;};}; record { 38_537_191 = 737_469 : nat32; 834_174_833 = 5_000 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\92\0f\31\fa\ff\db\3a\40\6c\8d\20\b6\a5\46\a6\f9\10\09\e0\35\cd\4b\87\f1\5e\b0\0b\d6\9f\31\ff\72"; 1_314_115_032 = 73 : nat32;};}; record { 38_537_191 = 736_692 : nat32; 834_174_833 = 1_348 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\c7\c1\b3\df\4a\68\aa\3c\9d\c1\d9\8f\4b\89\23\12\56\97\bb\4e\5a\78\e9\b4\47\cb\68\52\a7\ef\82\d0"; 1_314_115_032 = 330 : nat32;};}; record { 38_537_191 = 735_088 : nat32; 834_174_833 = 16_927 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\80\83\c5\b0\71\ad\bc\4e\c2\81\e5\95\96\e8\9e\11\04\e5\6e\74\dd\38\fa\d6\6d\a7\93\df\fa\40\2e\a8"; 1_314_115_032 = 0 : nat32;};}; record { 38_537_191 = 735_082 : nat32; 834_174_833 = 33_929 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\5b\33\3a\91\03\13\9f\8a\4e\03\b1\13\f4\35\e4\e5\79\aa\9b\09\84\a3\ec\f9\84\83\8b\92\ad\97\97\cc"; 1_314_115_032 = 0 : nat32;};}; record { 38_537_191 = 734_386 : nat32; 834_174_833 = 18_419 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\4d\d6\39\fa\d6\eb\15\4d\4e\c9\ed\5f\24\46\bc\f8\3f\f3\a5\f6\a1\66\4a\65\e2\a2\3d\84\92\8f\8f\e5"; 1_314_115_032 = 25 : nat32;};}; record { 38_537_191 = 733_449 : nat32; 834_174_833 = 10_000 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\42\62\5a\d0\78\05\05\5b\92\d4\80\e9\30\14\0e\c8\83\c1\d9\d6\4d\1e\19\7d\4c\a9\99\ef\1b\39\50\e0"; 1_314_115_032 = 0 : nat32;};}; record { 38_537_191 = 732_006 : nat32; 834_174_833 = 7_004 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\47\39\22\55\5b\d8\fe\a9\a3\82\dc\e1\1c\9c\dd\63\19\b4\cd\41\0f\03\59\cd\be\a1\cc\07\9a\66\e2\59"; 1_314_115_032 = 87 : nat32;};}; record { 38_537_191 = 731_774 : nat32; 834_174_833 = 1_317 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\d0\bb\07\b9\dc\75\00\5a\31\15\1b\e4\78\15\53\c1\7c\32\fb\c4\19\cd\9d\4b\1e\7e\16\74\a9\d4\e7\f0"; 1_314_115_032 = 0 : nat32;};}; record { 38_537_191 = 731_163 : nat32; 834_174_833 = 10_000 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\58\94\e6\c5\10\05\e0\d7\fb\54\c7\ff\b5\25\a6\46\dd\b8\7b\0a\02\8e\5a\92\4e\ee\46\18\ae\a0\12\05"; 1_314_115_032 = 1 : nat32;};}; record { 38_537_191 = 730_728 : nat32; 834_174_833 = 50_000 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\2f\d1\9e\fd\35\88\d4\8d\1b\e6\ef\e4\a8\16\bc\96\03\06\17\01\a3\04\76\25\0b\38\bc\69\a3\d0\e1\ec"; 1_314_115_032 = 1 : nat32;};}; record { 38_537_191 = 728_331 : nat32; 834_174_833 = 10_000 : nat64; 4_129_575_170 = record { 1_292_380_767 = blob "\24\0a\6c\03\f5\f7\40\62\38\b8\43\dc\10\5e\9c\4b\a4\a2\24\f5\c6\f6\c6\27\9e\4c\03\76\b0\a0\56\0f"; 1_314_115_032 = 0 : nat32;};};};
  },
)
1 Like

Are these just queries? Can you point to the code running them? Sorry…I get all the different types(replicated, non-replicated, composite, etc) mixed up. I’m not sure if this is a new kind of novel query that is doing an https call with just one canister or just a query getting state from its self.

Yes, these are just queries. Here is PR that added them to Bitcoin Canister. Internally when using DFX, the Management Canister is called which routes queries to the Bitcoin Canister and returns a response.

1 Like

How are these queries different from the existing bitcoin_get_balance and bitcoin_get_utxos methods?