@@ -135,9 +135,6 @@ The Solana Verify CLI is the primary tool used to verify builds. Solana Verify
135
135
CLI is currently maintained by [ Ellipsis Labs] ( https://ellipsislabs.xyz/ ) and
136
136
can be installed using Cargo.
137
137
138
- > The verify process will soon move into the [ Anza] ( https://www.anza.xyz/ ) tool
139
- > suite. The general way of verifying builds will stay very similar though.
140
-
141
138
You can install it by running:
142
139
143
140
``` bash
@@ -331,8 +328,31 @@ artifact from your repository.
331
328
The default is the
332
329
[ OtterSec API] ( https://github.com/otter-sec/solana-verified-programs-api ) .
333
330
334
- Once the build is done, which takes a while, and was successful you will be able
335
- to see your program as verified in the
331
+ Make sure to pick yes when you are asked to upload the verification data
332
+ onchain. This is used by the API to verify that you uploaded the verification
333
+ data.
334
+
335
+ You can also trigger a remote job manually by using:
336
+
337
+ ``` bash
338
+ solana-verify remote submit-job --program-id < program-id> --uploader < address>
339
+ ```
340
+
341
+ Where the uploader is the address that has the authority to write to the PDA.
342
+ That should be program authority in most cases. If your program is controlled by
343
+ a multisig please continue in the
344
+ [ multisig verification] ( #how-to-verify-your-program-when-its-controlled-by-a-multisig-like-squads )
345
+ part of this guide below.
346
+
347
+ This will submit a job to the OtterSec API and you can then verify the job
348
+ status with:
349
+
350
+ ``` bash
351
+ solana-verify remote get-job-status --job-id < job-id>
352
+ ```
353
+
354
+ Once the verification has completed successfully, which may take awhile, you
355
+ will be able to see your program as verified in the
336
356
[ OtterSec API for single programs] ( https://verify.osec.io/status/PhoeNiXZ8ByJGLkxNfZRnkUfjvmuYqLR89jjFHGqdXY )
337
357
and in the
338
358
[ Solana Explorer] ( https://explorer.solana.com/address/PhoeNiXZ8ByJGLkxNfZRnkUfjvmuYqLR89jjFHGqdXY/verified-build ) ,
@@ -348,6 +368,153 @@ contributing to a more healthy Solana ecosystem.
348
368
349
369
</Steps >
350
370
371
+ ## How to verify your program when its controlled by a Multisig like Squads
372
+
373
+ For the remote verification to work you need to write the verification data into
374
+ a PDA signed by the program authority. If your program is controlled by a
375
+ multisig you can export this write PDA transaction and submit it through
376
+ [ Squads Protocol] ( https://squads.so/protocol ) or another multisig solution of
377
+ your choice.
378
+
379
+ <Steps >
380
+
381
+ ### 1. Build the verifiable program
382
+
383
+ First build the program:
384
+
385
+ ``` bash
386
+ solana-verify build
387
+ ```
388
+
389
+ This will build a verifiable build using a docker container using the solana
390
+ version specified in the ` Cargo.lock ` file.
391
+
392
+ ### 2. Deploy the program
393
+
394
+ ``` bash
395
+ solana config set --url " PayedMainnetRPCAddress" // the public endpoint will be rate limited too much
396
+ solana program deploy target/deploy/verify_squads.so
397
+ ```
398
+
399
+ For the rest of this multisig guide, we will use an example program ID of
400
+ ` 6XBGfP17P3KQAKoJb2s5M5fR4aFTXzPeuC1af2GYkvhD ` .
401
+
402
+ ### 3. Commit and verify against repository
403
+
404
+ Once that is done we commit the project to to github. Here is an example:
405
+ https://github.com/solana-developers/verify-squads
406
+
407
+ Optional: See if you can verify locally first (this command uses example program
408
+ ID ` 6XBGfP17P3KQAKoJb2s5M5fR4aFTXzPeuC1af2GYkvhD ` ):
409
+
410
+ ``` bash
411
+ solana-verify verify-from-repo https://github.com/solana-developers/verify-squads --program-id 6XBGfP17P3KQAKoJb2s5M5fR4aFTXzPeuC1af2GYkvhD
412
+ ```
413
+
414
+ Just to make sure your parameters are correct.
415
+
416
+ ### 4. Transfer program authority to multisig
417
+
418
+ If you have not yet transfer your programs authority to the multisig and copy
419
+ the multisig authority. You need it in the next step.
420
+
421
+ ### 5. Export PDA transaction
422
+
423
+ When you have you program authority locally you are prompted to upload the build
424
+ data onchain when using the command ` solana-verify verify-from-repo ` .
425
+
426
+ Since you can not do that when you are using a multisig you need to export the
427
+ PDA transaction manually and then trigger the transaction through Squads.
428
+
429
+ ``` bash
430
+ solana-verify export-pda-tx https://github.com/solana-developers/verify-squads --program-id 6XBGfP17P3KQAKoJb2s5M5fR4aFTXzPeuC1af2GYkvhD --uploader < your program authority> --encoding base58 --compute-unit-price 0
431
+ ```
432
+
433
+ This will return you a base58 transcation. If you want a base64 encoded
434
+ transaction for use in a transaction inspector, you can use ` --encoding base64 ` .
435
+
436
+ ``` bash
437
+ P6vBfcPaaXb8fZoT3NBAYEcdtEj7tubA1k2gBxmFKZ3UWF5YyrmDMFTvLKALCJoUuRsPAjMckudYruCu3eeWQtuDrFbEMLxLFutnKXac974fnkMivcwUdY66VLjbxQT6ATmcy7F4hBtz1G4P1h6iBJLhb8WtrtgY3i4qq45MUEb7RjuMEfUFXKrNgPdGxkz5xvMHq3dxKRcpmEK5k2DkeW6SUQYBVe19Ga3B9GyhTX8k3CMt9JCEah13WyRnQd8GjoK6sTEvGJym6xDNvmd8yiJYSNcaYwEJsjHEUf4Yh6kAC7ki2KRvVAr3NVe1gjqK9McrwSQjtUatvydTG8Zovcr7PPUEMf3yPMgKXjZLB2QpkH63yTTYdNAnWFuv9E6b6nYRqye5XcNi436yKw5U14fXh65yK34bgYLi9328UT1huJELsJU9BRGnGUmb6GWp6c2WL5BhnzgNTSnt9TXFfEgUMzhvKzpVBxLP44hwqqBdyUhHFysCF37531PnmiESq8x1xou23xJ6FcQbc199754MkqQd7tX9CUznGzAEqHGkzn3VBoJnojsKtgYmiTYbdRsT1CU18MbYEE7WvGAvXyxxbpNzbAcc94HrnM6cqRGmwhEBroPfFghTdmzg9D
438
+ ```
439
+
440
+ ### 6. Submit transaction through Squads
441
+
442
+ Go to the squads transaction builder and import the base58 encoded transaction.
443
+ Make sure that in the simulation the transaction only has a call to the osec
444
+ verify program and the computer budget program and nothing else!
445
+
446
+ ### 7. Submit remote verification job
447
+
448
+ Once the transaction to squads was successful you can submit the remote job:
449
+
450
+ ``` bash
451
+ solana-verify remote submit-job --program-id 6XBGfP17P3KQAKoJb2s5M5fR4aFTXzPeuC1af2GYkvhD
452
+ --uploader < your program authority>
453
+ ```
454
+
455
+ This is it! You have verified your program against a public repository and
456
+ submitted a remote job to the OtterSec API. You should be able to see it reflect
457
+ in the solana explorer and other places now.
458
+
459
+ ### 8. Updating the program (Optional)
460
+
461
+ When you update your program you need to export a new PDA transaction and submit
462
+ it through Squads again.
463
+
464
+ Doing an update to the program:
465
+
466
+ ``` bash
467
+ solana-verify build
468
+ solana program write-buffer target/deploy/verify_squads.so --with-compute-unit-price 50000 --max-sign-attempts 50
469
+ ```
470
+
471
+ Then transfer that buffer authority to the multisig or directly create the
472
+ buffer with the authority of the multisig.
473
+
474
+ ``` bash
475
+ solana program set-buffer-authority Fu3k79g53ZozAj47uq1tXrFy4QbQYh7y745DDsxjtyLR --new-buffer-authority 3JG6ULvZVCrkKtSSskKNJGe8RNZGFe8Ruev9KUhxzK5K
476
+ ```
477
+
478
+ ### 9. Export and submit new PDA transaction
479
+
480
+ Don't forget to commit your changes to github. Export the PDA upgrade
481
+ transaction again:
482
+
483
+ ``` bash
484
+ solana-verify export-pda-tx https://github.com/solana-developers/verify-squads --program-id 6XBGfP17P3KQAKoJb2s5M5fR4aFTXzPeuC1af2GYkvhD --uploader 3JG6ULvZVCrkKtSSskKNJGe8RNZGFe8Ruev9KUhxzK5K
485
+ ```
486
+
487
+ Submit the transaction through Squads again.
488
+
489
+ You can see an example transaction here:
490
+
491
+ https://solana.fm/tx/4zJ1vK2KToAwxuEYzTMLqPkcebjoi9rdeeyxtEEx9L5Q4vWDA8h6Rr4kPRuRxcV7ZLKMr6qx1LTWb6x3ZpUJaFUW?cluster=mainnet-alpha
492
+
493
+ Then submit for another remote build:
494
+
495
+ ``` bash
496
+ solana-verify remote submit-job --program-id 6XBGfP17P3KQAKoJb2s5M5fR4aFTXzPeuC1af2GYkvhD --uploader 3JG6ULvZVCrkKtSSskKNJGe8RNZGFe8Ruev9KUhxzK5K
497
+ ```
498
+
499
+ Should result in something like this:
500
+
501
+ ``` shell
502
+ Verification request sent with request id: b63339d2-163e-49ac-b55d-3454c1c2b5b3
503
+ Verification in progress... ⏳ [00:18:02] ✅ Process completed. (Done in 18
504
+ minutes) Program 6XBGfP17P3KQAKoJb2s5M5fR4aFTXzPeuC1af2GYkvhD has been verified.
505
+ ✅ The provided GitHub build matches the on-chain hash. On Chain Hash:
506
+ 96f8c3d9400258f7759408d1f6f8435b4a24d9b52f5a0340d97907e567cb8773 Executable
507
+ Hash: 96f8c3d9400258f7759408d1f6f8435b4a24d9b52f5a0340d97907e567cb8773 Repo URL:
508
+ https://github.com/Woody4618/verify-squads/tree/0fb0a2e30c15c51732c0ad5e837975a6f7bbc7ed
509
+ Check the verification status at:
510
+ https://verify.osec.io/status/6XBGfP17P3KQAKoJb2s5M5fR4aFTXzPeuC1af2GYkvhD Job
511
+ url: https://verify.osec.io/job/b63339d2-163e-49ac-b55d-3454c1c2b5b3
512
+ ```
513
+
514
+ Congratulations you have verified your program after a multisig upgrade!
515
+
516
+ </Steps >
517
+
351
518
## Verify from docker image
352
519
353
520
You can also verify your program against a docker image by running the following
@@ -412,6 +579,68 @@ a remote build of your program. Once the build is complete, the system verifies
412
579
that the onchain hash of your program matches the hash of the generated build
413
580
artifact from your repository.
414
581
582
+ ## Popular programs that are already verified
583
+
584
+ ### Phoenix
585
+
586
+ ``` shell
587
+ solana-verify verify-from-repo -um --program-id PhoeNiXZ8ByJGLkxNfZRnkUfjvmuYqLR89jjFHGqdXY https://github.com/Ellipsis-Labs/phoenix-v1
588
+ ```
589
+
590
+ Final Output:
591
+
592
+ ``` shell
593
+ Executable Program Hash from repo: 6877a5b732b3494b828a324ec846d526d962223959534dbaf4209e0da3b2d6a9
594
+ On-chain Program Hash: 6877a5b732b3494b828a324ec846d526d962223959534dbaf4209e0da3b2d6a9
595
+ Program hash matches ✅
596
+ ```
597
+
598
+ ### Squads V3
599
+
600
+ ``` shell
601
+ solana-verify verify-from-repo https://github.com/Squads-Protocol/squads-mpl --commit-hash c95b7673d616c377a349ca424261872dfcf8b19d --program-id SMPLecH534NA9acpos4G6x7uf3LWbCAwZQE9e8ZekMu -um --library-name squads_mpl --bpf
602
+ ```
603
+
604
+ > Notice we needed to specify the ` library-name ` because the Squads repo
605
+ > includes multiple programs. We use the ` --bpf ` flag because ` squads_mpl ` was
606
+ > previously verified with Anchor.
607
+
608
+ Final Output:
609
+
610
+ ``` shell
611
+ Executable Program Hash from repo: 72da599d9ee14b2a03a23ccfa6f06d53eea4a00825ad2191929cbd78fb69205c
612
+ On-chain Program Hash: 72da599d9ee14b2a03a23ccfa6f06d53eea4a00825ad2191929cbd78fb69205c
613
+ Program hash matches ✅
614
+ ```
615
+
616
+ ### Drift V2
617
+
618
+ ``` shell
619
+ solana-verify verify-from-repo -um --program-id dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH https://github.com/drift-labs/protocol-v2 --commit-hash 110d3ff4f8ba07c178d69f9bfc7b30194fac56d6 --library-name drift
620
+ ```
621
+
622
+ Final Output:
623
+
624
+ ``` shell
625
+ Executable Program Hash from repo: e31d58edeabc3c30bf6f2aa60bfaa5e492b41ec203e9006404b463e5adee5828
626
+ On-chain Program Hash: e31d58edeabc3c30bf6f2aa60bfaa5e492b41ec203e9006404b463e5adee5828
627
+ Program hash matches ✅
628
+ ```
629
+
630
+ ### Marginfi V2
631
+
632
+ ``` shell
633
+ solana-verify verify-from-repo -um --program-id MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA https://github.com/mrgnlabs/marginfi-v2 --commit-hash d33e649e415c354cc2a1e3c49131725552d69ba0 --library-name marginfi -- --features mainnet-beta
634
+ ```
635
+
636
+ Final Output:
637
+
638
+ ``` shell
639
+ Executable Program Hash from repo: 890d68f48f96991016222b1fcbc2cc81b8ef2dcbf280c44fe378c523c108fad5
640
+ On-chain Program Hash: 890d68f48f96991016222b1fcbc2cc81b8ef2dcbf280c44fe378c523c108fad5
641
+ Program hash matches ✅
642
+ ```
643
+
415
644
# Conclusion
416
645
417
646
Using [ verified builds on Solana] ( /content/guides/advanced/verified-builds.md )
0 commit comments