chainlink diagramTechnical Demo: NEAR Protocol & Chainlink Integration

1 Bitcoin BTC to United States Dollars USD today 1 BTC to USD 1 BTC = 28,148.62 USD at the rate on -04-09. The cost of 1 Bitcoin in United States Dollars today is $28,148.62 according to the “Open Exchange Rates”, compared to yesterday, the exchange rate increased by 0.66% by +$186.65. VeChain CFDsPlus500 Plus500 is a trademark of Plus500 Ltd. Plus500 Ltd operates through the following subsidiaries: Plus500AU Pty Ltd, ACN 153 301 681, AFSL Number 417727, is the issuer chainlink diagram Technical Demo: NEAR Protocol & Chainlink Integration
chainlink diagram Cardano ADA and XRP ‘Fight’: Understand What's Going On 9... Technical Demo: NEAR Protocol & Chainlink Integration
thank you guys so much and everybody tuning in to the sessions again were excited to be joined now by the engineering team from your protocol mike josh and ms and you guys are going to tell us about near protocols integration of chain links thanks guys take it away thank you thank you abby awesome uh were really excited to be here at the smart contract summit and to show you the early integration between near protocol and chain link my name is anaes im a developer advocate at near protocol if youve already interacted with veneer in some level if youre part of our community if you are have been around our resources our channels the chances are high that youll be already interacted if not and you would like to learn more about nir were going to show you some resources some links at the end of the presentation but first lets hear from josh and mike what they are about what they are working on at near yeah my name is josh i am a documentation engineer engineer and also a developer hey im mike ive been at near um since january and do a lot of partner engineering getting people onboarded and a bunch of developer experience tooling and reaching out to folks is great awesome yeah we would really love to hear from everybody whos watching right now um just how familiar you are with veneer if you have never heard about near or maybe just seen a new protocol name around please type a one in the chat box so one for if youve never heard about near or just high level and a two if if you are somewhat familiar if youre in some of part of our channels if youve participated in our events and three if youre using near really frequently um that would be really cool just for us to know and to to respond to your level of understanding of near during the demo um so if youre watching please one if youve never heard about neo2 if somewhat and three if youre super user just for those who are new to near protocol at a high level near is a proof of stake layer one blockchain network so you can build decentralized applications on top of near similar to how you use other layer one solutions we have some pretty cool scalability and composability features at near then were also going to dive in more detail later on um but thats like at a high level near we would love to welcome you on our channels uh but lets proceed with our demonstration its its a high-level demo on how the chain-link ecosystem interacts with uh near rpc the near environment um so josh is gonna walk you through that now in the demo i guess thats since youre here at the smart contract summit from chain link you already know about about what oracles are how they are used if youre not if youre new to it if you maybe not a developer at a high level oracles are basically um if you are you can imagine similar to being in a in a garden in a world garden youve never been outside of that garden you dont know whats happening outside um so thats basically your blockchain a blockchain doesnt usually interact with with information outside of the blockchain it doesnt know whats happening outside and for most applications its thats okay but there are some applications that require external information to know whats happening and to respond to it and to provide more complex data processing etc so imagine that to be you asking several of your friends to send you letters uh over the wall garden to access information from outside and thats kind of similar how oracles work their data sources for the blockchain um yeah just you wanna you wanna take it from here and show us the demo yeah totally um so yeah like like addis was saying uh just you know an oracle provides a gateway to off-chain data just allowing smart contracts to gain access to the information that it needs theres quite a few moving parts that allows this communication to take place so to help us kind of explain this and illustrate it better weve partnered up with uh chain link to present this demonstration for you so let me go ahead and share my um screen as everyone see the demonstration in front of us got it cool yes awesome cool so yeah we created um a basic uh simple react app uh illustrating the various components of an oracle request uh when you initially land on this page youll see welcoming instructions um that will tell you kind of how to get started and youre gonna go ahead and choose a selected token price from these four pre-set these four preset tokens so well go ahead and click on chain link and now we have the ability to check it and well go ahead and start the process this application has a special key pair that it uses to connect to near an initial load of the screen and then also allow to send transactions to the client contract on the near network um so it returned a price for link at 16.81 and then it kind of shows us a diagram of exactly whats taking place behind the scenes um so first when the user checks uh the price um they will call the client contract and this contract um for for this demonstration that has 50 uh fungible tokens assigned with it that it uses to pay for these requests and this initial transaction um the link of it is automatically provided to the user and we can go ahead and click on that i dont know oh yeah its not going to show me the next tab because im sharing my my my uh first tab but it takes you to near explorer um that is very similar to etherscan thatll show you more detailed information about um the the transaction that took place you can see what block it was on and all sorts of nitty-gritty information um about it the next step um is the client contract will send 10 fungible tokens to an on-chain oracle contract then it will interface with the off chain oracle node if you can see in the previous step illustrated here the oracle node and over here on the upper right hand side the oracle node is constantly polling for requests so we have your chain link oracle node here that is constantly asking the on-chain oracle contract if there are any quest requests for it to process and when it finds one then itll grab that request and itll begin to process um the transaction uh it will interface with an api get the information that it needs and then it will return that price back to the oracle contract all while this is taking place you can see that the fungible tokens are locked on this contract um the owner cannot access these until a complete request is uh or until a request is completed uh and the contract is fulfilled um so in the next step um the on-chain oracle contract will return the um initial request to the client and it will unlock the tokens and now the owner of the on chain and off chain oracle contractor node which typically is the the same individual can now access these tokens and they can either leave them there and let them store up from all the requests and get them whenever they decide that they want they want to grab those requests and again well have the transaction which we can see in the near explorer and maybe i can do that in the last step here after i show you that yeah basically the requested token is now rendered to the front end from the client um so yeah i can click on this and maybe i can just quickly show you if i can be really quick um how sorry um your explorer transaction um so this is a link to our near explorer that ill show you that the oracle node signed this the the chain link uh oracle on chain uh contract received it um here is more information about it how much gas was used how much we attached uh the transaction fee um and more information you have your receipts down here um and also what what exactly you got um the client received this price which is multiply by 100 and then we just go ahead and and divide it to get you an actual an actual price um so yeah thats thats basically um the demonstration um im gonna go ahead and pass this off to mike thats gonna dive a little bit and more into um what goes on in here and how this is all done in a more technical uh aspect great thanks yeah thats great um yeah so nier it has a bunch of advantages like everyones experiencing some you know problems with gas cost right now and um thats something that were were tackling we also have a different way of writing smart contracts um so we wrote uh the chain link contracts in a programming language called rust rust is like a systems programming language you could think of like c c plus plus just very like kind of low level super secure um and stepping back a little bit like nier is using a web assembly virtual machine um under the hood here as opposed to ethereum for instance which uses the ethereum virtual machine and uh so since we are using webassembly virtual machine programming languages that can compile down to a webassembly like uh binary can actually live on the blockchain right now nier is targeting two uh languages in particular assembly script which looks a lot like typescript if youre familiar in javascript world and rust now rust as mentioned before has a bunch of uh inherent safety from the compilation so were recommending rust for like financial applications and whatnot um so we uh basically took the salinity contracts from um chain link if we go to the next slide and we ported them from solidity to rust so were going to see on the left-hand side here is the solidity contract and on the right-hand side we see the rest contracts rust looks really weird at first by the way in case youre visiting this and youre youre a dev it looks very strange its not that complicated you dont have to be like a master rust rust expert to write smart contracts and rust wed love to chat with you afterwards if youre interested um so what was involved here was porting the main oracle solidity contract to rust and then we had two other contracts essentially we had a fungible token contract which is where the like link token essentially is going to be we have our own fungible token spec on near so we had the fungible token the oracle contract and then the client contract and the client contract is just a very basic on-chain smart contract that wishes to get off-chain data well have a link to both of these repos here at the end and also i should mention as a kind of a teaser we are working hard right now on the near evm so that um hopefully soon you actually dont have to port your smart contracts from solidity to rest you could actually have them straight in in near which is kind of amazing thats a whole other session were not going to get into that but um i thats really exciting and why im mentioning it um the next slide were going to talk about is the keys on nir so josh mentioned uh briefly that that react app used a special key to to talk to the client um contract on chain um nier has a very interesting account system that is really cool theres two types of keys for a given account you would have unlimited number of these so theres the full access key and function call access key so the full access key can do all sorts of very powerful things it can you know add another key delete a key send near tokens it can even delete the entire account itself you can have unlimited of these and then the really interesting part comes in with function call access keys this is what we used in this demo on the right hand side youll see something that is displayed from the the terminal we have a cli tool called near cli that can do a lot of things what were showing here is the actual public keys that are being used for this account on near called client.chainlink.testnet um this youll notice that account names on near are not long hashes like ethereum thats very human readable its really cool so the highlighted key here is what were actually using in this in this react app and all it can do is call one method uh get token price and the allowance is a very large number meaning im allowed to call the method get token price and use a bunch of gas until i run out of the of the allowance so if youre a dev and kind of hearing this maybe the gears are turning in your head theres a lot of different things that you can do with this account system so that is that is a really a neat part of this a demo um if we go to the next slide were just going to talk about kind of covering how this is right now sort of in early stages the uh integration between near and chain link this is kind of an mvp stage but we are showing that like the integration is happening um between like the the chain link nodes talking to our rpc back and forth and chain link has been nice enough to use their infrastructure to continuously pull and so this demo will be live which is which is great uh its not going to be as snappy as it would be if it were on main net but we are very excited to have a chain link node talking to ours and you can make your own chain like node theres an adapter its all open source its amazing um and yeah so so the coming soon this theres a bunch of really fun stuff happening here um in the first bullet point is just kind of how we could make this demo like a lot more kind of interesting um using the what i just mentioned with the function call access keys like it is possible to do great many things that will allow for scalability that would be quite difficult in other chains um for instance in this demo we we could actually see like when a unique user lands on the web page and give them their own function call access key um if we do this basically theres no collision of nonces which is which is a pretty amazing feat to accomplish so thats thats kind of a stretch goal for for this demo um long term between like chain link and near theres this amazing thing called the rainbow bridge which youll see animated on the right its a super awesome uh feature that weve just added recently this is basically going to have a bridge between ethereum and near so you can take tokens that are on ethereum lock them up and mint them on near and move them kind of both ways so this is a this is really important because right now the chain link link token as you know is an erc20 token so that is like fundamentally like on uh ethereum and thats great and that and thats fine uh if gas prices end up being like way better on near which is our expectation then you can essentially just move uh fungible tokens across chains and not have to you know reinvent the wheel and that that is really amazing um were really excited about the rainbow bridge its actually trustless so you can do it yourself you dont have to trust that like you know we swear our infrastructure is verifying this you can actually do it yourself its its really amazing um theres going to be a hackathon pretty soon coming up thats going to be really exciting um ill have a link on the last slide to that so that is definitely one of the next steps is really bridging the link between these two uh pun intended um because right now for this demo the fungible token is kind of funny money it is it is a fungible token that is actually very secure but is not currently attached to the value of like chain link on ethereum etc and then the last two bullet points here uh if youre familiar with uh chain link and kind of like how you build a full-fledged uh integration there is there are price feeds and there is a pre-coordinator system so this is essentially making sure that you are distributing trust and that you are getting a bunch of different uh prices from from various places because like traditional finance thats thats kind of what you want to be doing so those final two bullet points are just the the next steps to really um strengthen and fortify uh the integration between chain link and uh and near so its its a lot of fun stuff happening and this final uh slide is how you can learn more about about nir the last link on here rainbow uh is uh another great a great link uh or that that longer one too um we are really looking forward to seeing people you know bridge this and and try different layer ones and um its its gonna be really exciting i think i think we can actually um go go move towards questions if uh folks have some questions in the uh in the chat as well so there were several questions on the code since the code wasnt too visible uh so maybe we can either go back to the code or if since most of the people who are currently watching i believe joined later on maybe its worth going back and be showing the demo um maybe one for the code in the chat right one for the code and two for the demo what you want to see in the last ten minutes uh that might be helpful two okay two demo one code another one for demo um okay and if you have any questions please also type them into the chat um mohammed we can also we will share the the code and everything on our community chat later on when you go to you can join our community chat and we can share the code and lets go back to the demo maybe and take another look there um yeah awesome yeah yeah so we can do do the the demo one more time uh again on load were using those access keys that mike just kind of went a little bit more depth uh with um so the the access keys are coded in to the site itself you dont have to do anything the the developer actually does that um for us um well go ahead and select a token well click on chain link and click check uh again theres all that stuff thats happening in the background where the oracle node is polling the oracle contract so it takes a little bit um to receive a result but um again were on a test net right now um that gives it a little bit more of a delay than we would expect to see on a main solution so yeah we can kind of go through these steps one more time uh again theres a client contract um that is on chain uh that has 50 50 thunderbolt tokens you can have however many on that contract that you want but just for this demonstration purpose uh we have the the 50 here we have a transaction um that was placed in near explorer this call kind of sets the ball rolling um and will then send 10 tokens to the on chain oracle contract that will let it know that it wants a request from there and as you can see by this blue line going back and forth that the off chain oracle node is um continuously pulling the on chain oracle contract um and once it sees that there is an on-chain request the tokens are locked um as you can see here and the request is forwarded uh to the off chain oracle node um the oracle node then interacts with an api retrieving whatever data that was initially uh requested from the client um that is then passed back from the oracle node thats off chain to the unchain oracle contract which then fulfills the request of the clients and now you can see that those tokens are now unlocked um and the contract or the agreement is complete um and um yeah the request is fulfilled and then the result is returned to the front end uh and you can kind of learn more here by going if you click on learn more itll take you to a blog post that talks about the integration between chain link uh and near and in this uh application that we built um and also yeah this uh demo is live right now you can you can check it out at top um it may there there may be some uh nonce issues so we were um talking about getting uh kind of a next iteration of this would be um to have those individual unique uh function keys um available for everyone so um again this is kind of a work in proc progress but uh our repo is open source and you can take a look at it and if you see any issues or want to contribute to it were more than welcome to uh to to uh any um input and yeah we would love to hear from you awesome thank you uh great are there any other questions in terms of avalanche i i honestly do not know enough about avalanche ive been so kind of heads down having having fun building this later one that i i dont know how to uh answer that one right now our main focus is having a bridge between ethereum uh and near um which is similar to what other other folks are doing so thanks for the great question i do look forward to watching that uh keynote i think the keynote is actually from for avalanches after after us too so thatll be itll be fun to learn more in terms of if were compatible uh we just released our rainbow bridge which is basically a trussless bridge between near protocol and ethereum chain any other questions but the demo about near anything related to near anything youre curious about otherwise you can also join us in our community chat where most of our not all of our developer related discussions and community discussions take place just be sure to link yeah great stuff all right awesome if there are no other questions i think that wraps it up and its for those who came in a bit late this will be recorded so we can just check out youtube later on and um and and watch it again awesome thank you guys so much really appreciate that we got some questions in there and thank you for answering everything appreciate you guys joining today all right thanks happy thanksgiving thank you bye-bye you The engineering team from NEAR Protocol presents a SmartCon technical demo of the NEAR-Chainlink integration. The NEAR Protocol team is represented by Mike Purvis, Josh Ford, and Anais Urlichs.Chainlink’s Smart Contract Summit SmartCon featured 70+ talks, panels, workshops, and AMAs with CEOs, CTOs, founders, and builders. Over 8,000 attendees from 100+ countries and all 7 continents watched 130+ speakers come together to discuss cutting edge research, current market trends, and the issues driving decentralized technology adoption. SmartCon 0 ran August 28-29, 2020. Chainlink is a decentralized oracle network that enables on-chain smart contracts to securely access off-chain data feeds, web APIs, traditional bank payment data, and more. Chainlink provides highly secure and reliable oracles to large enterprises Google, Oracle, and SWIFT and leading smart contract development teams working on Bitcoin, Polkadot/Substrate, Synthetix, Aave, and many others. Learn more about Chainlink: Website Twitter Telegram If you’re a developer, make use of our documentation and join the technical discussion on Discord SmartCon,