summaryrefslogtreecommitdiff
path: root/8a/197751f9ea48e82d4f5598aeed67f9fe25c18e
blob: d803d20be98c078de3fb8378736e6b7c10832cc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
Return-Path: <aymeric@peersm.com>
Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])
 by lists.linuxfoundation.org (Postfix) with ESMTP id A6B48C0893
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Fri, 25 Dec 2020 11:58:01 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by whitealder.osuosl.org (Postfix) with ESMTP id 878B68671E
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Fri, 25 Dec 2020 11:58:01 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
Received: from whitealder.osuosl.org ([127.0.0.1])
 by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id R53tp6f+t2pQ
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Fri, 25 Dec 2020 11:57:57 +0000 (UTC)
X-Greylist: delayed 00:09:26 by SQLgrey-1.7.6
Received: from smtpout1.mo804.mail-out.ovh.net
 (smtpout1.mo804.mail-out.ovh.net [79.137.123.220])
 by whitealder.osuosl.org (Postfix) with ESMTPS id 769C68671C
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Fri, 25 Dec 2020 11:57:57 +0000 (UTC)
Received: from mxplan6.mail.ovh.net (unknown [10.109.146.140])
 by mo804.mail-out.ovh.net (Postfix) with ESMTPS id 9D1847D48841
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Fri, 25 Dec 2020 12:48:28 +0100 (CET)
Received: from peersm.com (37.59.142.103) by DAG6EX1.mxp6.local (172.16.2.51)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Fri, 25 Dec
 2020 12:48:27 +0100
Authentication-Results: garm.ovh; auth=pass
 (GARM-103G005f225ec2f-b29a-4052-821f-f105d6025180,
 94A41F00DA93D7511217647F9C704594886C3F9A) smtp.auth=aymeric@peersm.com
X-OVh-ClientIp: 92.184.102.75
To: Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
References: <CAPvWj7H9hg8EMCvDzWiq=f59KojHEGCm_iAP+FBaB+25=CLt0A@mail.gmail.com>
 <202012230215.46394.luke@dashjr.org>
 <CAPvWj7E3S9HxZgpw0bdDmso+3sXc-h0u15_528r11EZ3LY-wYA@mail.gmail.com>
 <96a93692-b564-91df-9194-1373d805c434@peersm.com>
From: Aymeric Vitte <aymeric@peersm.com>
Message-ID: <466af0d2-c1ac-04c5-83b9-ce6d44a4958e@peersm.com>
Date: Fri, 25 Dec 2020 12:49:11 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.3; rv:45.0) Gecko/20100101
 Thunderbird/45.4.0
MIME-Version: 1.0
In-Reply-To: <96a93692-b564-91df-9194-1373d805c434@peersm.com>
Content-Type: multipart/alternative;
 boundary="------------32FBF9DA570E46019781993A"
X-Originating-IP: [37.59.142.103]
X-ClientProxiedBy: DAG6EX1.mxp6.local (172.16.2.51) To DAG6EX1.mxp6.local
 (172.16.2.51)
X-Ovh-Tracer-GUID: 74a9b217-c0ee-4136-aab9-f1a40c435a27
X-Ovh-Tracer-Id: 15099443653835645719
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: 0
X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedujedrvdduuddgfeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefuvfhfhffkffgfgggjtghisegrtderredtfeehnecuhfhrohhmpeethihmvghrihgtucggihhtthgvuceorgihmhgvrhhitgesphgvvghrshhmrdgtohhmqeenucggtffrrghtthgvrhhnpeehudffveefjeevkefguddufedtjeegveegleekgfevhfelleejudeftddtfedvhfenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhpvggvrhhsmhdrtghomhdplhhinhhugihfohhunhgurghtihhonhdrohhrghdplhhinhhkvgguihhnrdgtohhmpdhtohhrrhgvnhhtqdhlihhvvgdrohhrghenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddruddtfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehmgihplhgrnheirdhmrghilhdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomheprgihmhgvrhhitgesphgvvghrshhmrdgtohhmpdhrtghpthhtohepsghithgtohhinhdquggvvheslhhishhtshdrlhhinhhugihfohhunhgurghtihhonhdrohhrgh
X-Mailman-Approved-At: Fri, 25 Dec 2020 12:46:56 +0000
Subject: Re: [bitcoin-dev] BIP Proposal: Wallet Interface
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Bitcoin Protocol Discussion <bitcoin-dev.lists.linuxfoundation.org>
List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe>
X-List-Received-Date: Fri, 25 Dec 2020 11:58:01 -0000

--------------32FBF9DA570E46019781993A
Content-Type: text/plain; charset="windows-1252"
Content-Transfer-Encoding: 8bit

Resending to the list since I am using a different email

Complement: if anonymity is required from the browser (or elsewhere) you
might consider looking at https://github.com/Ayms/node-Tor too


Le 24/12/2020 à 20:40, Aymeric Vitte a écrit :
>
> You might want to take a look at: https://peersm.com/wallet
>
> And https://github.com/Ayms/bitcoin-transactions
>
> "wallet" is not the very correct word, it's more bitcoin cli outside
> of bitcoin core but for now not linked to an explorer/tx system which
> makes it probably still not so easy to use for the transactions part
> (which can be extended to lightning, etc)
>
> The idea is to propose to people most of the tools they need to manage
> their coins by themselves, or at least understand better what they are
> doing
>
> "People should not be encouraged to write or use web browsers for
> their wallet." --> yes and no, please crack the standalone webapp
> above, so it's finally a no when things are done correctly, of course
> there is no story of keys storage inside browsers or online stuff with
> keys
>
> Maybe this can be turned one day into a w3c api like webcrypto
> (window.bitcoin as you sketch)
>
> Le 23/12/2020 à 08:29, monokh via bitcoin-dev a écrit :
>> Thanks for the input Luke.
>>
>> > 1) People should not be encouraged to write or use web browsers for
>> their wallet.
>>
>> Indeed. Holding keys in the browser can be very insecure, however the
>> spec is not limited to this. I will amend to make this clear. The
>> same interface can be used to communicate from a web context or even
>> desktop application with hardware wallets where keys are segregated
>> safely. The prominent hardware wallets already have such an
>> interface. Unfortunately as there has been no standardisation, an
>> application must specifically provide an implementation for each
>> wallet to be compatible.
>>
>> > 2) You may want to look over earlier work in this area.
>>
>> Please share if you have specifics in mind. What has been considered
>> were mainly hardware wallet apis. The requests have been defined such
>> that they would be compatible. I will make references to such
>> considerations in the text. I welcome any feedback on what may be
>> missing or problematic for these providers - something I will also
>> pursue outwith the thread.
>>
>> -monokh 
>>
>> On Wed, Dec 23, 2020 at 2:15 AM Luke Dashjr <luke@dashjr.org
>> <mailto:luke@dashjr.org>> wrote:
>>
>>     1) People should not be encouraged to write or use web browsers
>>     for their
>>     wallet.
>>     2) You may want to look over earlier work in this area.
>>
>>     On Tuesday 22 December 2020 14:43:11 monokh via bitcoin-dev wrote:
>>     > Hi
>>     >
>>     > This is a first draft of a BIP we intend to submit. The main
>>     intention is
>>     > to define a simple interface that wallets and applications can
>>     agree on
>>     > that would cover the vast majority of use cases. This can
>>     enable writing
>>     > bitcoin applications (e.g. time lock, multi sig) on the web
>>     that can be
>>     > seamlessly used with any compatible wallets. We have
>>     implementations of
>>     > such examples but I don't want to turn this thread into a
>>     promotion and
>>     > rather focus on the spec.
>>     >
>>     > Appreciate input from the list. Please share if there are
>>     existing efforts,
>>     > relevant specs or use cases.
>>     >
>>     > ------------------------------
>>     >
>>     > A wallet interface specification for bitcoin applications
>>     >
>>     > ## Abstract
>>     >
>>     > This BIP describes an API for Bitcoin wallets and applications as a
>>     > standard.
>>     >
>>     > ## Summary
>>     >
>>     > Bitcoin wallets should expose their address derivation and signing
>>     > functions to external applications. The interface would be
>>     expressed as
>>     > follows in javascript:
>>     >
>>     > ```
>>     > {
>>     > // Wallet Metadata
>>     > wallet: {
>>     > name: 'Bitcoin Core'
>>     > },
>>     >
>>     > // Request access to the wallet for the current host
>>     > async enable: (),
>>     >
>>     > // Request addresses and signatures from wallet
>>     > async request ({ method, params })
>>     > }
>>     > ```
>>     >
>>     > In the web context the interface could be exposed at the top
>>     level of a
>>     > webpage, for example under `window.bitcoin`. However this spec
>>     does not
>>     > intend to define any standards for how and where the interfaces
>>     should be
>>     > exposed.
>>     >
>>     > ## Motivation
>>     >
>>     > Due to the seldom available APIs exposed by wallets,
>>     applications (web or
>>     > otherwise) are limited in how they are able to interact.
>>     Generally only
>>     > simple sends have been available. A more robust API that
>>     introduces other
>>     > requests will promote richer Bitcoin applications.
>>     >
>>     > Additionally, wallet APIs have frequently included
>>     inconsistencies in their
>>     > interfaces and behaviour. This has required applications to
>>     build and
>>     > maintain a separate client for each wallet, increasing the risk
>>     of bugs and
>>     > unintended behaviour as well as being a limiting factor for the
>>     adoption of
>>     > usable bitcoin applications.
>>     >
>>     > With a standardised wallet API:
>>     >
>>     > - Wallets have a clear API to implement
>>     > - Applications have a clear expectation of wallet interface and
>>     behaviour
>>     > - Applications become agnostic to the wallet specifics,
>>     increasing choice
>>     > for users
>>     >
>>     > If more wallets implement the specification, applications will
>>     be developed
>>     > more confidently by benefiting from the wallet
>>     interoperability. This
>>     > creates a positive feedback loop.
>>     >
>>     > ## Specification
>>     >
>>     > For simplicity, the interface is defined in the context of web
>>     applications
>>     > running in the browser (JS) however, they are simple enough to
>>     be easily
>>     > implemented in other contexts.
>>     >
>>     > ### General Rules
>>     >
>>     > - For sensitive functions (e.g. signing), wallet software
>>     should always
>>     > prompt the user for confirmation
>>     >
>>     > ### Types
>>     >
>>     > **UserDeniedError**
>>     > An error type indicating that the application's request has
>>     been denied by
>>     > the user
>>     > Type: Error
>>     >
>>     > **Hex**
>>     > Type: String
>>     > Example:
>>     >
>>     `"0000000000000000000a24677957d1e50d70e67c513d220dbe8868c4c3aefc08"`
>>     >
>>     > **Address**
>>     > Address details
>>     > Type: Object
>>     > Example:
>>     >
>>     > ```
>>     > {
>>     > "address": "bc1qn0fqlzamcfuahq6xuujrq08ex7e26agt20gexs",
>>     > "publicKey":
>>     >
>>     "02ad58c0dced71a236f4073c3b6f0ee27dde6fe96978e9a9c9500172e3f1886e5a",
>>     > "derivationPath": "84'/1'/0'/0/0"
>>     > }
>>     > ```
>>     >
>>     > ### API
>>     >
>>     > The wallet must implement the following methods.
>>     >
>>     > **enable**
>>     >
>>     > The enable call prompts the user for access to the wallet.
>>     >
>>     > If successful, it resolves to an address (`**Address**` type)
>>     of the
>>     > wallet. Typically the first external address to be used as an
>>     identity.
>>     >
>>     > **`UserDeniedError`** will be thrown if the request is rejected.
>>     >
>>     > **request**
>>     >
>>     > The request method must take one parameter in the following format:
>>     >
>>     > ```
>>     > {
>>     > "method": "wallet_methodName",
>>     > "params": ["foo", "bar", "baz"]
>>     > }
>>     > ```
>>     >
>>     > For a list of mandatory methods see Table
>>     >
>>     > The wallet should reject request calls unless `enable` has been
>>     resolved.
>>     >
>>     > Sensitive requests that involve signing should always prompt
>>     the user for
>>     > confirmation
>>     >
>>     > On success the request should resolve to the response as
>>     defined in the
>>     > method table.
>>     >
>>     > **`UserDeniedError`** will be thrown if the request is rejected.
>>     >
>>     > **Mandatory methods**
>>     >
>>     > method: `wallet_getAddresses` params: [`index = 0, numAddresses
>>     = 1, change
>>     > = false`]
>>     > return: `[ Address ]`
>>     > error: UserDeniedError
>>     >
>>     > method: `wallet_signMessage` params: `[ message, address ]`
>>     > return: Signature `Hex`
>>     > error: UserDeniedError
>>     >
>>     > method: `wallet_signPSBT` params: `[ [psbtBase64, inputIndex,
>>     address] ]`
>>     > return: `psbtBase64`
>>     > error: UserDeniedError
>>     >
>>     > method: `wallet_getConnectedNetwork` params: `[]`
>>     > return: Network object `mainnet` | `testnet` | `regetst`
>>     > error: UserDeniedError
>>     >
>>     > ## Rationale
>>     >
>>     > The purpose of the API is to expose a set of commonly used wallet
>>     > operations. In addition, it should be flexible enough to serve
>>     for other
>>     > requests such as node RPC calls.
>>     >
>>     > **Why is there a singular request call instead of named methods?**
>>     > The transport layer for the requests cannot be assumed,
>>     therefore it is
>>     > much more flexible to instead define an abstract format.
>>     >
>>     > **Why are the mandatory methods so primitive? Where is getBalance,
>>     > getUtxos, ... ?**
>>     > A wallet need not worry about providing every possible scenario
>>     for usage.
>>     > The primitives of keys and signing can expose enough to
>>     applications to do
>>     > the rest. Applications should have flexibility in how they
>>     implement these
>>     > functions. It is the role of a library rather than the wallet.
>>     >
>>     > ## Security Implications
>>     >
>>     > Great care should be taken when exposing wallet functionality
>>     externally as
>>     > the security and privacy of the user is at risk.
>>     >
>>     > ### Signing
>>     >
>>     > Operations that trigger signing using private keys should be
>>     guarded behind
>>     > confirmation screens where the user is fully aware of the
>>     nature of the
>>     > transaction. In the example of a PSBT signature request, the
>>     outputs, the
>>     > inputs and which key is being used should be clearly marked.
>>     >
>>     > ### Privacy
>>     >
>>     > Some api methods expose metadata about the user, such as public
>>     keys.
>>     > Depending on how privacy focused the wallet intends to be, the
>>     wallet could
>>     > protect these behind a confirmation. Commonly the wallet just
>>     needs to give
>>     > the origin access to all of its public keys, however it could
>>     also allow
>>     > the option to expose only selected derivation paths.
>>     >
>>     > -monokh
>>
>>
>>
>> _______________________________________________
>> bitcoin-dev mailing list
>> bitcoin-dev@lists.linuxfoundation.org
>> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
> -- 
> Sophia-Antipolis, France
> LinkedIn: https://fr.linkedin.com/in/aymeric-vitte-05855b26
> Move your coins by yourself (browser version): https://peersm.com/wallet
> Bitcoin transactions made simple: https://github.com/Ayms/bitcoin-transactions
> Zcash wallets made simple: https://github.com/Ayms/zcash-wallets
> Bitcoin wallets made simple: https://github.com/Ayms/bitcoin-wallets
> Get the torrent dynamic blocklist: http://peersm.com/getblocklist
> Check the 10 M passwords list: http://peersm.com/findmyass
> Anti-spies and private torrents, dynamic blocklist: http://torrent-live.org
> Peersm : http://www.peersm.com
> torrent-live: https://github.com/Ayms/torrent-live
> node-Tor : https://www.github.com/Ayms/node-Tor
> GitHub : https://www.github.com/Ayms

-- 
Sophia-Antipolis, France
LinkedIn: https://fr.linkedin.com/in/aymeric-vitte-05855b26
Move your coins by yourself (browser version): https://peersm.com/wallet
Bitcoin transactions made simple: https://github.com/Ayms/bitcoin-transactions
Zcash wallets made simple: https://github.com/Ayms/zcash-wallets
Bitcoin wallets made simple: https://github.com/Ayms/bitcoin-wallets
Get the torrent dynamic blocklist: http://peersm.com/getblocklist
Check the 10 M passwords list: http://peersm.com/findmyass
Anti-spies and private torrents, dynamic blocklist: http://torrent-live.org
Peersm : http://www.peersm.com
torrent-live: https://github.com/Ayms/torrent-live
node-Tor : https://www.github.com/Ayms/node-Tor
GitHub : https://www.github.com/Ayms


--------------32FBF9DA570E46019781993A
Content-Type: text/html; charset="windows-1252"
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Resending to the list since I am using a different email</p>
    <p>Complement: if anonymity is required from the browser (or
      elsewhere) you might consider looking at
      <a class="moz-txt-link-freetext" href="https://github.com/Ayms/node-Tor">https://github.com/Ayms/node-Tor</a> too<br>
    </p>
    <br>
    <div class="moz-cite-prefix">Le 24/12/2020 à 20:40, Aymeric Vitte a
      écrit :<br>
    </div>
    <blockquote
      cite="mid:96a93692-b564-91df-9194-1373d805c434@peersm.com"
      type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      <p>You might want to take a look at: <a moz-do-not-send="true"
          class="moz-txt-link-freetext" href="https://peersm.com/wallet">https://peersm.com/wallet</a>
        <br>
      </p>
      <p>And <a moz-do-not-send="true" class="moz-txt-link-freetext"
          href="https://github.com/Ayms/bitcoin-transactions">https://github.com/Ayms/bitcoin-transactions</a></p>
      <p>"wallet" is not the very correct word, it's more bitcoin cli
        outside of bitcoin core but for now not linked to an explorer/tx
        system which makes it probably still not so easy to use for the
        transactions part (which can be extended to lightning, etc) <br>
      </p>
      The idea is to propose to people most of the tools they need to
      manage their coins by themselves, or at least understand better
      what they are doing<br>
      <br>
      "People should not be encouraged to write or use web browsers for
      their wallet." --&gt; yes and no, please crack the standalone
      webapp above, so it's finally a no when things are done correctly,
      of course there is no story of keys storage inside browsers or
      online stuff with keys<br>
      <br>
      Maybe this can be turned one day into a w3c api like webcrypto
      (window.bitcoin as you sketch)<br>
      <br>
      <div class="moz-cite-prefix">Le 23/12/2020 à 08:29, monokh via
        bitcoin-dev a écrit :<br>
      </div>
      <blockquote
cite="mid:CAPvWj7E3S9HxZgpw0bdDmso+3sXc-h0u15_528r11EZ3LY-wYA@mail.gmail.com"
        type="cite">
        <meta http-equiv="Content-Type" content="text/html;
          charset=windows-1252">
        <div dir="ltr">Thanks for the input Luke.<br>
          <br>
          &gt; 1) People should not be encouraged to write or use web
          browsers for their wallet.<br>
          <br>
          Indeed. Holding keys in the browser can be very insecure,
          however the spec is not limited to this. I will amend to make
          this clear. The same interface can be used to communicate from
          a web context or even desktop application with hardware
          wallets where keys are segregated safely. The prominent
          hardware wallets already have such an interface. Unfortunately
          as there has been no standardisation, an application must
          specifically provide an implementation for each wallet to be
          compatible.<br>
          <br>
          &gt; 2) You may want to look over earlier work in this area.<br>
          <br>
          Please share if you have specifics in mind. What has been
          considered were mainly hardware wallet apis. The requests have
          been defined such that they would be compatible. I will make
          references to such considerations in the text. I welcome any
          feedback on what may be missing or problematic for these
          providers - something I will also pursue outwith the thread.<br>
          <br>
          -monokh </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Wed, Dec 23, 2020 at 2:15
            AM Luke Dashjr &lt;<a moz-do-not-send="true"
              href="mailto:luke@dashjr.org">luke@dashjr.org</a>&gt;
            wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">1) People should not be
            encouraged to write or use web browsers for their <br>
            wallet.<br>
            2) You may want to look over earlier work in this area.<br>
            <br>
            On Tuesday 22 December 2020 14:43:11 monokh via bitcoin-dev
            wrote:<br>
            &gt; Hi<br>
            &gt;<br>
            &gt; This is a first draft of a BIP we intend to submit. The
            main intention is<br>
            &gt; to define a simple interface that wallets and
            applications can agree on<br>
            &gt; that would cover the vast majority of use cases. This
            can enable writing<br>
            &gt; bitcoin applications (e.g. time lock, multi sig) on the
            web that can be<br>
            &gt; seamlessly used with any compatible wallets. We have
            implementations of<br>
            &gt; such examples but I don't want to turn this thread into
            a promotion and<br>
            &gt; rather focus on the spec.<br>
            &gt;<br>
            &gt; Appreciate input from the list. Please share if there
            are existing efforts,<br>
            &gt; relevant specs or use cases.<br>
            &gt;<br>
            &gt; ------------------------------<br>
            &gt;<br>
            &gt; A wallet interface specification for bitcoin
            applications<br>
            &gt;<br>
            &gt; ## Abstract<br>
            &gt;<br>
            &gt; This BIP describes an API for Bitcoin wallets and
            applications as a<br>
            &gt; standard.<br>
            &gt;<br>
            &gt; ## Summary<br>
            &gt;<br>
            &gt; Bitcoin wallets should expose their address derivation
            and signing<br>
            &gt; functions to external applications. The interface would
            be expressed as<br>
            &gt; follows in javascript:<br>
            &gt;<br>
            &gt; ```<br>
            &gt; {<br>
            &gt; // Wallet Metadata<br>
            &gt; wallet: {<br>
            &gt; name: 'Bitcoin Core'<br>
            &gt; },<br>
            &gt;<br>
            &gt; // Request access to the wallet for the current host<br>
            &gt; async enable: (),<br>
            &gt;<br>
            &gt; // Request addresses and signatures from wallet<br>
            &gt; async request ({ method, params })<br>
            &gt; }<br>
            &gt; ```<br>
            &gt;<br>
            &gt; In the web context the interface could be exposed at
            the top level of a<br>
            &gt; webpage, for example under `window.bitcoin`. However
            this spec does not<br>
            &gt; intend to define any standards for how and where the
            interfaces should be<br>
            &gt; exposed.<br>
            &gt;<br>
            &gt; ## Motivation<br>
            &gt;<br>
            &gt; Due to the seldom available APIs exposed by wallets,
            applications (web or<br>
            &gt; otherwise) are limited in how they are able to
            interact. Generally only<br>
            &gt; simple sends have been available. A more robust API
            that introduces other<br>
            &gt; requests will promote richer Bitcoin applications.<br>
            &gt;<br>
            &gt; Additionally, wallet APIs have frequently included
            inconsistencies in their<br>
            &gt; interfaces and behaviour. This has required
            applications to build and<br>
            &gt; maintain a separate client for each wallet, increasing
            the risk of bugs and<br>
            &gt; unintended behaviour as well as being a limiting factor
            for the adoption of<br>
            &gt; usable bitcoin applications.<br>
            &gt;<br>
            &gt; With a standardised wallet API:<br>
            &gt;<br>
            &gt; - Wallets have a clear API to implement<br>
            &gt; - Applications have a clear expectation of wallet
            interface and behaviour<br>
            &gt; - Applications become agnostic to the wallet specifics,
            increasing choice<br>
            &gt; for users<br>
            &gt;<br>
            &gt; If more wallets implement the specification,
            applications will be developed<br>
            &gt; more confidently by benefiting from the wallet
            interoperability. This<br>
            &gt; creates a positive feedback loop.<br>
            &gt;<br>
            &gt; ## Specification<br>
            &gt;<br>
            &gt; For simplicity, the interface is defined in the context
            of web applications<br>
            &gt; running in the browser (JS) however, they are simple
            enough to be easily<br>
            &gt; implemented in other contexts.<br>
            &gt;<br>
            &gt; ### General Rules<br>
            &gt;<br>
            &gt; - For sensitive functions (e.g. signing), wallet
            software should always<br>
            &gt; prompt the user for confirmation<br>
            &gt;<br>
            &gt; ### Types<br>
            &gt;<br>
            &gt; **UserDeniedError**<br>
            &gt; An error type indicating that the application's request
            has been denied by<br>
            &gt; the user<br>
            &gt; Type: Error<br>
            &gt;<br>
            &gt; **Hex**<br>
            &gt; Type: String<br>
            &gt; Example:<br>
            &gt;
            `"0000000000000000000a24677957d1e50d70e67c513d220dbe8868c4c3aefc08"`<br>
            &gt;<br>
            &gt; **Address**<br>
            &gt; Address details<br>
            &gt; Type: Object<br>
            &gt; Example:<br>
            &gt;<br>
            &gt; ```<br>
            &gt; {<br>
            &gt; "address":
            "bc1qn0fqlzamcfuahq6xuujrq08ex7e26agt20gexs",<br>
            &gt; "publicKey":<br>
            &gt;
            "02ad58c0dced71a236f4073c3b6f0ee27dde6fe96978e9a9c9500172e3f1886e5a",<br>
            &gt; "derivationPath": "84'/1'/0'/0/0"<br>
            &gt; }<br>
            &gt; ```<br>
            &gt;<br>
            &gt; ### API<br>
            &gt;<br>
            &gt; The wallet must implement the following methods.<br>
            &gt;<br>
            &gt; **enable**<br>
            &gt;<br>
            &gt; The enable call prompts the user for access to the
            wallet.<br>
            &gt;<br>
            &gt; If successful, it resolves to an address (`**Address**`
            type) of the<br>
            &gt; wallet. Typically the first external address to be used
            as an identity.<br>
            &gt;<br>
            &gt; **`UserDeniedError`** will be thrown if the request is
            rejected.<br>
            &gt;<br>
            &gt; **request**<br>
            &gt;<br>
            &gt; The request method must take one parameter in the
            following format:<br>
            &gt;<br>
            &gt; ```<br>
            &gt; {<br>
            &gt; "method": "wallet_methodName",<br>
            &gt; "params": ["foo", "bar", "baz"]<br>
            &gt; }<br>
            &gt; ```<br>
            &gt;<br>
            &gt; For a list of mandatory methods see Table<br>
            &gt;<br>
            &gt; The wallet should reject request calls unless `enable`
            has been resolved.<br>
            &gt;<br>
            &gt; Sensitive requests that involve signing should always
            prompt the user for<br>
            &gt; confirmation<br>
            &gt;<br>
            &gt; On success the request should resolve to the response
            as defined in the<br>
            &gt; method table.<br>
            &gt;<br>
            &gt; **`UserDeniedError`** will be thrown if the request is
            rejected.<br>
            &gt;<br>
            &gt; **Mandatory methods**<br>
            &gt;<br>
            &gt; method: `wallet_getAddresses` params: [`index = 0,
            numAddresses = 1, change<br>
            &gt; = false`]<br>
            &gt; return: `[ Address ]`<br>
            &gt; error: UserDeniedError<br>
            &gt;<br>
            &gt; method: `wallet_signMessage` params: `[ message,
            address ]`<br>
            &gt; return: Signature `Hex`<br>
            &gt; error: UserDeniedError<br>
            &gt;<br>
            &gt; method: `wallet_signPSBT` params: `[ [psbtBase64,
            inputIndex, address] ]`<br>
            &gt; return: `psbtBase64`<br>
            &gt; error: UserDeniedError<br>
            &gt;<br>
            &gt; method: `wallet_getConnectedNetwork` params: `[]`<br>
            &gt; return: Network object `mainnet` | `testnet` |
            `regetst`<br>
            &gt; error: UserDeniedError<br>
            &gt;<br>
            &gt; ## Rationale<br>
            &gt;<br>
            &gt; The purpose of the API is to expose a set of commonly
            used wallet<br>
            &gt; operations. In addition, it should be flexible enough
            to serve for other<br>
            &gt; requests such as node RPC calls.<br>
            &gt;<br>
            &gt; **Why is there a singular request call instead of named
            methods?**<br>
            &gt; The transport layer for the requests cannot be assumed,
            therefore it is<br>
            &gt; much more flexible to instead define an abstract
            format.<br>
            &gt;<br>
            &gt; **Why are the mandatory methods so primitive? Where is
            getBalance,<br>
            &gt; getUtxos, ... ?**<br>
            &gt; A wallet need not worry about providing every possible
            scenario for usage.<br>
            &gt; The primitives of keys and signing can expose enough to
            applications to do<br>
            &gt; the rest. Applications should have flexibility in how
            they implement these<br>
            &gt; functions. It is the role of a library rather than the
            wallet.<br>
            &gt;<br>
            &gt; ## Security Implications<br>
            &gt;<br>
            &gt; Great care should be taken when exposing wallet
            functionality externally as<br>
            &gt; the security and privacy of the user is at risk.<br>
            &gt;<br>
            &gt; ### Signing<br>
            &gt;<br>
            &gt; Operations that trigger signing using private keys
            should be guarded behind<br>
            &gt; confirmation screens where the user is fully aware of
            the nature of the<br>
            &gt; transaction. In the example of a PSBT signature
            request, the outputs, the<br>
            &gt; inputs and which key is being used should be clearly
            marked.<br>
            &gt;<br>
            &gt; ### Privacy<br>
            &gt;<br>
            &gt; Some api methods expose metadata about the user, such
            as public keys.<br>
            &gt; Depending on how privacy focused the wallet intends to
            be, the wallet could<br>
            &gt; protect these behind a confirmation. Commonly the
            wallet just needs to give<br>
            &gt; the origin access to all of its public keys, however it
            could also allow<br>
            &gt; the option to expose only selected derivation paths.<br>
            &gt;<br>
            &gt; -monokh<br>
            <br>
          </blockquote>
        </div>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
bitcoin-dev mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@lists.linuxfoundation.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev">https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev</a>
</pre>
      </blockquote>
      <br>
      <pre class="moz-signature" cols="72">-- 
Sophia-Antipolis, France
LinkedIn: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://fr.linkedin.com/in/aymeric-vitte-05855b26">https://fr.linkedin.com/in/aymeric-vitte-05855b26</a>
Move your coins by yourself (browser version): <a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://peersm.com/wallet">https://peersm.com/wallet</a>
Bitcoin transactions made simple: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://github.com/Ayms/bitcoin-transactions">https://github.com/Ayms/bitcoin-transactions</a>
Zcash wallets made simple: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://github.com/Ayms/zcash-wallets">https://github.com/Ayms/zcash-wallets</a>
Bitcoin wallets made simple: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://github.com/Ayms/bitcoin-wallets">https://github.com/Ayms/bitcoin-wallets</a>
Get the torrent dynamic blocklist: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://peersm.com/getblocklist">http://peersm.com/getblocklist</a>
Check the 10 M passwords list: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://peersm.com/findmyass">http://peersm.com/findmyass</a>
Anti-spies and private torrents, dynamic blocklist: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://torrent-live.org">http://torrent-live.org</a>
Peersm : <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.peersm.com">http://www.peersm.com</a>
torrent-live: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://github.com/Ayms/torrent-live">https://github.com/Ayms/torrent-live</a>
node-Tor : <a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://www.github.com/Ayms/node-Tor">https://www.github.com/Ayms/node-Tor</a>
GitHub : <a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://www.github.com/Ayms">https://www.github.com/Ayms</a></pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Sophia-Antipolis, France
LinkedIn: <a class="moz-txt-link-freetext" href="https://fr.linkedin.com/in/aymeric-vitte-05855b26">https://fr.linkedin.com/in/aymeric-vitte-05855b26</a>
Move your coins by yourself (browser version): <a class="moz-txt-link-freetext" href="https://peersm.com/wallet">https://peersm.com/wallet</a>
Bitcoin transactions made simple: <a class="moz-txt-link-freetext" href="https://github.com/Ayms/bitcoin-transactions">https://github.com/Ayms/bitcoin-transactions</a>
Zcash wallets made simple: <a class="moz-txt-link-freetext" href="https://github.com/Ayms/zcash-wallets">https://github.com/Ayms/zcash-wallets</a>
Bitcoin wallets made simple: <a class="moz-txt-link-freetext" href="https://github.com/Ayms/bitcoin-wallets">https://github.com/Ayms/bitcoin-wallets</a>
Get the torrent dynamic blocklist: <a class="moz-txt-link-freetext" href="http://peersm.com/getblocklist">http://peersm.com/getblocklist</a>
Check the 10 M passwords list: <a class="moz-txt-link-freetext" href="http://peersm.com/findmyass">http://peersm.com/findmyass</a>
Anti-spies and private torrents, dynamic blocklist: <a class="moz-txt-link-freetext" href="http://torrent-live.org">http://torrent-live.org</a>
Peersm : <a class="moz-txt-link-freetext" href="http://www.peersm.com">http://www.peersm.com</a>
torrent-live: <a class="moz-txt-link-freetext" href="https://github.com/Ayms/torrent-live">https://github.com/Ayms/torrent-live</a>
node-Tor : <a class="moz-txt-link-freetext" href="https://www.github.com/Ayms/node-Tor">https://www.github.com/Ayms/node-Tor</a>
GitHub : <a class="moz-txt-link-freetext" href="https://www.github.com/Ayms">https://www.github.com/Ayms</a></pre>
  </body>
</html>

--------------32FBF9DA570E46019781993A--