opentimestamps-client OpenTimestamps client

我要开发同款
匿名用户2021年12月24日
95阅读

技术信息

系统类型
Web3
授权协议
View license

作品详情

OpeTimestampsCliet

Commad-lietooltocreateadvalidatetimestampproofswiththeOpeTimestampsprotocol,usigtheBitcoiblockchaiasatimestampotary.AdditioallythispackageprovidestimestampigofPGPsigedGitcommits,adverificatiooftimestampsforbothGitcommitsasawhole,adidividualfileswithiaGitrepository.

RequiremetsPytho3

WhileOpeTimestampscacreatetimestampswithoutalocalBitcoiode,toverifytimestampsyoueedalocalBitcoiCoreode(apruedodeisfie).

Istallatio

EitherviaPyPi:

$pip3istallopetimestamps-cliet

orfromsource:

$pytho3setup.pyistall

ODebia(Stretch)youcaistalltheecessarysystemdepedecieswith:

sudoapt-getistallpytho3pytho3-devpytho3-pippytho3-setuptoolspytho3-wheelUsage

Creatigatimestamp:

$otsstampREADME.mdSubmittigtoremotecaledarhttps://a.pool.opetimestamps.orgSubmittigtoremotecaledarhttps://b.pool.opetimestamps.orgSubmittigtoremotecaledarhttps://a.pool.eteritywall.com

You'llseethatREADME.md.otshasbeecreatedwiththeaidofthreeremotecaledars.Weca'tverifyitimmediatelyhowever:

$otsverifyREADME.md.otsAssumigtargetfileameis'README.md'Caledarhttps://alice.btc.caledar.opetimestamps.org:PedigcofirmatioiBitcoiblockchaiCaledarhttps://bob.btc.caledar.opetimestamps.org:PedigcofirmatioiBitcoiblockchaiCaledarhttps://fiey.caledar.eteritywall.com:PedigcofirmatioiBitcoiblockchai

IttakesafewhoursforthetimestamptogetcofirmedbytheBitcoiblockchai;we'reotdoigoetrasactiopertimestamp.

However,theclietdoescomewithaumberofexampletimestampswhichyoucatryverifyigimmediately.Here'sacompletetimestampthatcabeverifiedlocally:

$otsverifyexamples/hello-world.txt.otsAssumigtargetfileameis'examples/hello-world.txt'Success!Bitcoiblock358391attestsexisteceasof2015-05-28CEST

YoucaspecifyJSON-RPCcredetials(USERadPASS)foralocalbitcoiodelikeso:

$ots--bitcoi-odehttps://USER:PASS@127.0.0.1:8332/verifyexamples/hello-world.txt.otsAssumigtargetfileameis'examples/hello-world.txt'Success!Bitcoiblock358391attestsexisteceasof2015-05-28CEST

Icompletetimestampsareoesthatrequiretheassistaceofaremotecaledartoverify;thecaledarprovidesthepathtotheBitcoiblockheader:

$otsverifyexamples/icomplete.txt.otsAssumigtargetfileameis'examples/icomplete.txt'Got1ewattestatio(s)fromhttps://alice.btc.caledar.opetimestamps.orgSuccess!Bitcoiblock428648attestsexisteceasof2016-09-07CEST

Theclietmaitaisacacheoftimestampsitobtaisfromremotecaledars,soifyouverifythesamefileagaiit'llusethecache:

$otsverifyexamples/icomplete.txt.otsAssumigtargetfileameis'examples/icomplete.txt'Got1attestatio(s)fromcacheSuccess!Bitcoiblock428648attestsexisteceasof2016-09-07CEST

Youcaalsoupgradeaicompletetimestamp,whichaddsthepathtotheBitcoiblockchaitothetimestampitself:

$otsupgradeexamples/icomplete.txt.otsGot1attestatio(s)fromcacheSuccess!Timestampiscomplete

Fially,youcagetiformatiooatimestamp,icludigtheactualcommitmetoperatiosadattestatiosiit:

$otsifoexamples/two-caledars.txt.otsFilesha256hash:efaa174f68e59705757460f4f7d204bd2b535cfd194d9d945418732129404ddbTimestamp:apped839037eef449dec6dac322ca97347c45sha256->apped6b4023b6edd3a0eeeb09e5d718723b9esha256preped57d46515appedeadd66b1688d5574verifyPedigAttestatio('https://alice.btc.caledar.opetimestamps.org')->appeda3ad701ef9f10535a84968b5a99d8580sha256preped57d46516apped647b90ea1b270a97verifyPedigAttestatio('https://bob.btc.caledar.opetimestamps.org')TimestampigadVerifyigPGPSigedGitCommits

Seedoc/git-itegratio.md

PrivacySecurity

Timestampigiheretlyrecordspotetiallyrevealigmetadata:thecurrettime.Ifyoucreatemultipletimestampsiclosesuccessioit'squitelikelythataadversarywillbeabletolikthosetimestampsasrelatedsimplyothebasisofwhetheywerecreated;ifyoumakeuseofthetimestampmultiplefilesioecommadfuctioality(./otsstamp<file1><file2>...<fileN>)mostofthecommitmetoperatiosithetimestampsthemselveswillbeidetical,providigaadversaryverystrogevidecethatthefilesweretimestampedbythesameperso.Fially,theRESTAPIusedtocommuicatewithremotecaledarsdoes'tcurretlyattempttoprovideayprivacy,althoughitcouldbemodifiedtodosoithefuture(e.g.withprefixfilters).

Filecotetsareprotectedwithoces:aremotecaledarlearsothigaboutthecotetsofaythigyoutimestampasitolyeverreceivesaopaqueadmeaiglessdigest.Equally,ifmultiplefilesaretimestampedatoce,eachfileisprotectedbyaidividualoce;thetimestampforoefilerevealsothigaboutthecotetsofaotherfiletimestampedatthesametime.

CompatibilityExpectatios

OpeTimestampsisalphasoftware,soit'spossiblethattimestampformatsmayhavetochageithefutureio-backward-compatibleways.Howeveritwillalmostcertailybepossibletowritecoversiotoolsforayo-backwards-compatiblechages.

It'sverylikelythattheRESTprotocolusedtocommuicatewithremotecaledarswillchage,icludigibackwardsicompatibleways.Ifthishappesyou'lljusteedtoupgradeyourcliet;existigtimestampswillbeuaffected.

CaledarMirrorig

Asashort-termmeasure,therawcaledardataforthethreecaledarserversioperatioatthistimecabedowloadeddirectly.Seethecotrib/caledar-mirror.shscriptfordetails.

Developmet

Usethesetuptoolsdevelopmetmode:

pytho3setup.pydevelop--userKowIssues

Needuittestsforthecliet.

Gittreere-hashigsupportfailsocertaifileameswithivaliduicodeecodigs;thisappearstobeduetobugsitheuderlyigGitPytholibrary.Asawork-aroud,youmayfidthecovmvtoolusefultofidadreamethesefiles.

GitaexsupportolyworkswiththeSHA256adSHA256Ebackeds.

ErrorsitheBitcoiRPCcommuicatioare'thadlediauser-friedlyway.

NotallPythoplatformscheckSSLcertificatescorrectly.Thismeasthatosomeplatforms,itwouldbepossibleforaMITMattackertoiterceptHTTPScoectiostoremotecaledars.Thatsaid,itshould'tbepossibleforsuchaattackertodoaythigworsethagiveusatimestampthatfailsvalidatio,aeasilyfixedproblem.

ots-git-gpg-wrapperdoes'tyetcheckforyouifthetimestampothegitcommitmakessese.

bitcoipackagecacauseissues,withotscofusigitwiththerequiredpytho-bitcoilibpackage.AsymptomofthisissueisthemessageAttributeError:module'bitcoi'hasoattribute'SelectParams'orJSONDecodeError("Expectigvalue",s,err.value)fromNoe.Toremedythisissue,oemustdothefollowig:

#uistallthepackagesthroughpippip3uistallbitcoipytho-bitcoilib#removethebitcoidirectorymauallyfromyourdist-packagesfolderrm-rf/usr/local/lib/pytho3.5/dist-packages/bitcoi#reistalltherequiredpackagepip3istallpytho-bitcoilib

功能介绍

OpenTimestamps Client Command-line tool to create and validate timestamp proofs with the OpenTime...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论