Skip to content
by Unity Nodes
NEAR DevHub

[REDACTED] Workshop with Proximity - Build with BTC on NEAR

about 58:26 long

Nothing is loaded from YouTube until you press play, and then without tracking cookies.

About this video

An overview on how to use chain signatures on NEAR to build on top of BTC.

Transcript

8,137 words

Captions as YouTube publishes them, usually machine-generated, so product and people names can be misheard.

  1. 0:00

    n hey we are back live again uh we were just here 20 minutes ago now and we are back here again with another awesome absolutely this has been a whirlwind of content there is so much great stuff uh we've had proximity on ones before we had Matt lock here

  2. 1:04

    talking about chain abstractions in general but we have an awesome workshop for you today uh Owen you want to kind of introduce what we're gonna be doing today we are the topic is Bitcoin and not just Bitcoin by itself but Bitcoin with n and how you can use n and chain signatures to do more on bitcoin but um I I won't spoil anything I I think we could and let the dev speak for themselves they can probably speak better about it than I can so let's

  3. 1:36

    let's get them up here so we today we have Greg and Edson from proximity uh thanks guys thanks for coming on dev Hub live hey guys hey hi thank you for having us our pleasure our pleasure so um let's talk a little bit about um kind of what you guys have in store for us for the workshop today and where you want to get started yes so I'm going to start and I'm going to to share with with you guys how some

  4. 2:07

    of the strategies that we are working on in order to develop in BTC because um let's be honest developing in BTC is super hard um but right now I think we are coming up with some strategies that are going to make super easy for developers to create apps with near and Bitcoin awesome uh yeah and if you want to share your screen just feel free to do that as well okay yeah I was playing with with some Bitcoin a few months ago and I had never

  5. 2:41

    really like touched it before and then I was like wait I have to sign all these utxos and I got confused and then then gave up so I'm excited to learn more here can you guys see my screen yeah we'll bring it up here there we go infinite perfect okay yeah there we literally me so this is a yeah I mean we know developing in Bitcoin is is super hard and yeah that's that's Owen um and right

  6. 3:17

    now uh in order to to explain um yeah just to create a small mental model what we are going to do so basically we have in some of the tooling that exist in the Bitcoin world is this the Bitcoin core Noe that they have a particular modality called the r test mode that basically allows you to run a Bitcoin no locally in developing mode and you can do things like generate new addresses move blocks and and mine some Bitcoin to that particular address

  7. 3:54

    and that's that's very helpful but there are other particularities here because we have the MPC signer in here and this is living basically in two places right now we have a test net where we have this NPC signer and we can request signatures and also the main net so how do we do something with these two pieces in order to to to facilitate the developing of BTC apps in particular because like Owen mentioned one of the main problem with the BTC war is the

  8. 4:32

    faets how do you get bigger amounts how how you can create um more utxo and and test more complex scenarios so yeah um but the cool thing about this is that you literally can sign um in the NPC signer site and you can propagate that transaction to the BTC node in rep test mode in your local computer so because the signatures created by the MPC signer are valid in the BTC node in that way you can uh

  9. 5:10

    basically derive the address of your new smart contract give some utxo to that address you can give any amount of utxo that you want and then basically sign that you want to spend some amount of of money and you propagate in this BTC node so I'm going to show you how I'm currently working with that and the best place to look at that is the the Omni Library if people is aware what is the only Library the only Library what we are trying to do is um a small set of

  10. 5:54

    utilities and like the name says a library where you can create transactions for multiple blockchains right now we support Bitcoin and evbm in this case for ethereum and and for near so what you can do is essentially within a near smart contract you can create a payload of a transaction and immediately sign with the MPC signer and then you simply return the payload that is already signed and you can propagate

  11. 6:27

    that to the different networks so um in order to to ensure that this encoding is working we have this set of integration test in the test folder so we have for evm for near and also for Bitcoin and here I'm going to walk through a bit uh how what I explained before here it's uh is helping us to to ensure that what we are doing is correct so like I like I mentioned we have um um well we are using actually some tooling from Bitcoin there is a Ross Bitcoin

  12. 7:06

    implementation it's a still um yeah is is very useful but is still under development um but still is um what they have is very useful for us and it's been saving our life so we are basically what we do here is we set up the Bitcoin note um and what is doing is literally downloading the Bitcoin cor node and running behind the scenes and I told the other day that there might be something about security because I'm basically downloading a bitco c node and executing

  13. 7:43

    it however you can just run you can install the Bitcoin cor note in your computer and this utility will recognize that it's installed and then it's just going to run it in rep test mode and then we just create an instance of that particular client and we can do things like set up an account for Bob and another for Alice here in this particular example this is for pay to witness publicy hash um and you

  14. 8:16

    basically can set up accounts for different type of address because in the BTC world we had these different types types of addresses uh right now we support this Bach um 32 which is uh the the ones that are used for set with transactions in BTC but we also have support for legacy transactions and then um um we generate blocks to a particular address in this case and giving utxos to Bob and then I basically have some helpers to get okay I already gave

  15. 8:57

    UT exos to Bob and I'm not limited to do this I can do more generate more utxos and as as I as I wish and then so in this in this environment are you able to like control the economy then uh and like how many utxos and whatnot yeah exactly and you can assign to to any particular address so right now I'm just assigning to Bob ER and here this is something because in order to have there

  16. 9:29

    has to be 100 uh blocks um propagation so there has to pass sorry confirmation blocks so that's why we have 101 but after 101 blocks Bob is going to have utxo and this is how then I access and in this case because this is a very simple example I'm testing with a single utxo and then I get the utxo and this is the this fun there are some wrappers and we are actually working also in what we call Omni testing utilities where we are going to encapsulate all this logic that

  17. 10:11

    we are adding here like you're going to be able to and obviously to improve how um the naming and to make easier for developers to test but essentially we are going to have more helare utilities um where you can set up accounts even assign names but also to to immediately get the utxos and and even filter like let's say I want one utxo I want 10 and so on before you go for I want to just kind

  18. 10:40

    of set for for some developers here so if you are a little bit new to developing with Bitcoin you just use the evm what's the equivalent of a utxo like so what does that actually mean and what how is that what's similar to that I guess in evm land so people understand yes so uh I like to give the analogy that actually re that is present here he gave to me and I think that was a very very nice explanation but yeah if you're coming from the EVN world like like I do

  19. 11:14

    you know that you can simply say um let's say get the B to get the balance of a particular person you just call the Json RPC and you can get the balance or even if you are in a smart contract let's say a token you have access to this balance of a particular um token so you can get your a particular address but in the Bitcoin War um the best analogy is to in mind that you have bills and these bills are of different

  20. 11:44

    value so let's say um someone sent me at some point on time a utx a transaction that is saying that I can spend um one BTC so that's a bill of one BTC and that is a utxo so that's why here we are generating so the analogy is that we are generating bills then I want to get those bills to be able to expend them does that does that make sense yeah that's a great analogy I like that yep and and I think when you uh when you

  21. 12:25

    want to spend these say you have like two txos of one Bitcoin and you want say like two Bitcoin or or some like non decimal amount then you have to you have to like merge these utxos right or or or send like multiple of the yes so H in this example if you here we are listing the utxo then I get the first one and then I create the the input so this is I'm going to expand this utxo but also um like you mentioned there could be C

  22. 13:03

    it's like I'm playing one with one one BTC but I I need some change so you need to also program that um utxo and add it to the transaction so in that case I'm saying okay I'm going to yeah I create the input because okay so a small break a BTC transaction contains the following information information you have inputs and outputs the inputs is you need to tell um it's like okay I have my one BTC

  23. 13:40

    bill this is what I can spend and then you need to say okay what what is the output of this build that I'm inserting in um vending machine let's say well it is more complex than a vending machine but yeah let's say you want to spend that and then you need to specify the outputs of this transaction and one of these outputs could be okay I'm getting um five five cents or from that particular Bill does that make

  24. 14:13

    sense yeah I'm with you yep makes sense okay so yeah and then we are using here the so since I'm reading that utxo from the Bitcoin cor node so it's basically you Interactive directly with that I need to extract a bit of information like the transaction ID and other information and then I create the inputs the outputs and with that input with that set of inputs and outputs in this case it's just simple it's just a s a single input but then we generate the

  25. 14:54

    um the transaction using the Omni library now in the BTC War there there are this type of um scripts that are kind of a way to verify um inside the Bitcoin core node and um we also have different types of addresses like um Legacy addresses sewi addresses and so on so depending the version that you are using you need to um encode different inform information that is going to be

  26. 15:31

    added to the transaction that is going to be used to be verified by the note so in this case because this example is um pay to witness public key has we basically need to create a witness and how um do we do that um we use these utilities and then um okay so before going deeper in the BTC War there is something called Sash and if you are coming I mean by the way this is very very low level um but

  27. 16:11

    yeah in the BTC in in the evm war you basically have a transaction hash that is signed by let's say in this case you can sign it with the MPC signer but also if I have my private key I can sign a transaction hash and then I can propagate this to an ethereum Network let's say to an ebm Network and because I sign it then this is going to be verified in the evbm right so in the BTC something like that exists but instead

  28. 16:48

    of a transaction hash I think an analogy could be a s has and this sash um could be generated in different ways depending the version of the of the of Bitcoin of the Bitcoin transaction that you are using and um in this case we generate the sash in this way I use the Omni library and I say okay I want to build for Bild for signing set Weck which is building the sash for set Weck and then it generate

  29. 17:28

    is that Sash and that sash is the one that we need to sign okay and how how difficult is it for someone to swap between like seg and Legacy uh type transactions or do you recommend that someone just stick with like seg yeah so seg is an improvement to the version one of them of um Bitcoin transactions in theory is cheaper for people to do it and to be quite Frank I don't see any reason why I mean there might be some particular reasons for

  30. 18:08

    people to choose Legacy maybe for some wallet restrictions but if you are starting in this BTC war and near the recommendation is just go directly with sewi and and that's it yeah and I think if you're you're running it on like a Bitcoin testet it's a lot easier most of the facets support seg rather than than Legacy wallets yes so that's another yeah definitely that's another uh reason to to better use that we um so yes we

  31. 18:44

    generate the S has and this is um something that we also do because we are um basically doing the full encoding and but we are taking a lot of inspiration from other libraries like Ross Bitcoin and basically we need to compare that what we are doing is analogous to what they are doing so here H this is because remember that this is within the Omni Library so this is an integration test we do I I finish here

  32. 19:19

    doing it with the Omni library but then I continue um doing with the with the russ Bitcoin and I basically the process but the idea is that at the end I'm basically comparing that the encoded um bit that the sash by Omi and the sash by Bitcoin by the official Bitcoin Library are the same so in this way we are more secure and okay we we feel um yeah honestly the other day there was someone telling me uh oh yeah because we have

  33. 19:59

    this for all the libraries so even for evbm we are doing the comparison against aloy for NE we're also comparing against Rush primitive so yeah we we know that encoding can is okay and it's funny because the other day a person told me um I think there is a problem with encoding and I'm like no I'm sure the calling is good uh and the error turns out to be another thing I mean definitely there can be errors but that particular case I saw the payload and I was like I'm sure it's okay but

  34. 20:36

    obviously that's not like arrogance it's simply that we are adding some test here and yeah this gives you just a lot of piece of mind and yeah we we feel very very happy because of that um okay so you can tell that this this Bitcoin file is is quite a bit larger than like the evm and near one oh yes yes is is is very large because we added more test also we are adding here for um for uh pay to public key which is the

  35. 21:09

    Legacy one and pay to witness public key hash uh which is using set we and we added more more test and 19 more tests are coming but yeah also for the buing we are adding a lot of utilities because it's difficult for for people to debug if there is an error um it's super complicated but little by little we are finding strategies to to to do this in a better way so yeah here I I repeated a

  36. 21:41

    bit the process of to calculate the S has but you have the S hash then you sign it and here we simply use um assign EC DSA which is simulating that I mean this this part right now I'm signing locally with the private key that the address that I generated is H giving me so this private key is really inside a note that is currently running in my local environment so I have access to that

  37. 22:16

    private key and then I can verify but um uh here what we are doing in the so the example the example is still not updated but I'm adding an example here where I'm basically signing here I'm signing in the oh here you can see that I'm calculating the sash in the near contract so this is a near contract where I'm I'm generating the S has directly and then I'm signing that in the in the contract but here uh but this

  38. 22:58

    is still uh I mean I need to clean a bit the the code but yeah it's working actually so here this is yes sorry this is so this is the part where you first showed and everyone's aware of like this is where the MPC comes into play right this is that connection between leveraging the MPC and what you're doing here in in this code correct correct yes so I I I I want to emphasize that here I'm signing with a private key that I

  39. 23:30

    have in my local Bitcoin core noes okay remember that I'm running in the beginning I I started this Bitcoin note locally so it's running there and then I'm this Bitcoin core note is also giving me um some accounts but this account also has a private key then here I'm signing but if if I'm signing here with my private key really there is no difference if I'm signing in the NPC signer which is what I'm doing here in

  40. 24:08

    this um example I'm where it is let's find it I calculate the Sash and then I'm calling the near contract here I'm creating the near action and I'm calling s s has and then basically the signer I get the result and and I I send the transaction and I extract the information but I have a signature that is also Ed ecdsa okay but yeah that is very important I can sign in the MPC signer I

  41. 24:47

    can sign locally for the Bitcoin note is the same okay but for us it's a very good first step because imagine you are trying to do a a library and you are trying to interact with this external component that the NPC signer so it's adding more noise to your local development and makes more complicated so you go step by step and the first step okay I'm s i I understand the principle that I can sign remotely I can

  42. 25:18

    sign locally but at the end of the day it's a private key and it's um and I'm signing with the EC DSA and and that's it at the end basically you're you're like proving here that signing with the NPC and and using the library is the same same as just like signing with a standard Bitcoin private key exactly and so are you suggesting that when people are like developing in in a local environment they should be uh they they can like

  43. 25:55

    safely assume and use the the local private key in their testing um and then once it's like ready and they're they're ready to test it on like testet or something they go ahead and use the MPC so that that depend I mean yes I know it depends because um if you are talking about a near contract that is interacting with the NPC signer um once you call let's say here once you call this function that is calling the MPC contract you are

  44. 26:32

    basically signing over there um and then you need to deploy this to a tesn but I I I I'll show the flow that I have here because actually this example is quite good because I'm basically deploying this contract to tesn so this contract uh Bitcoin signing with propagation I'm developing my new contract and I create an integration test where I'm starting my Bitcoin note then I deploy actually where is the

  45. 27:09

    FL where yeah here you can see that if I say deploy I'm compiling this contract deploying to a testet and signing in the testet so um that is also possible now I know that there are some efforts for some I know a particular team that is working in a MPC signer to be able to work locally so you can be working with your near contract locally and you are going to have a testing environment like this one and you

  46. 27:48

    basically can point with your new contract locally to that local instance of the MPC signup so in like the integration tests or yeah in the integration yeah but okay so just to answer your question it depends if you need to sign outside you can always assume that either I control the private key or I um sign remotely but if you if your logic is calling directly the NPC signer here then you can use a pattern like this

  47. 28:30

    where you basically deploy the you're kind of working locally ER with your Bitcoin note but signing remotely and then the result is propagated locally so you test um that everything works perfect does that make sense and actually this example the the one of the ex Bitcoin preparation example is this exactly I create my BTC see locally I I deploy my near uh contract and then I also call the MPC

  48. 29:06

    signer okay actually um this example will be like this sorry because I forgot test and and here you are um in your local environment and you have the BTC node plus the near contract source code that you are developing but in the integration test I deploy to test net the near contract and of course when you deploy to to testnet you have that the near contract is going to be here let's

  49. 29:44

    say um a contract. deset so your contract is going to be there and then this one is going to call the NPC signer and this result comes here and you deploy here so it's kind of um a bit tricky but I I think right now this is the best way that you can develop BTC apps in here because you have control of the UT exost and you are testing the real contract developing developing in testet and using the MPC sign up yes does this

  50. 30:23

    pattern apply to when you then move to production and I think you could do that too there is really nothing stopping you to sign this NPC signer basically could be main but I mean I guess the best answer always is it depends like when you say move to production like why would you like to test in production not not not test but is this if I am developing and this and I'm ready say okay how much of this uh setup needs to also then move to

  51. 31:04

    main net um okay the only problem okay if you do in test net you will be basically spending real near money here in order to get signatures just to deploy in a BTC node in local mode so that wouldn't I mean you could do it if you want to but I guess uh I don't know why would you spend near real near right to deploy in a local test net um I think maybe maybe what you were trying to say

  52. 31:39

    was like how much needs to change to go from like this local node to like uh to like real real Bitcoin is that what you're saying yeah no nothing I I think uh that's what I like this environment because you this is the closest thing to reality right now you are deploying here but we I'm going to show you here when I propagating the transaction so here this is uh the BTC client but in it is right

  53. 32:14

    now in rep test mode but it could be in another client because at the end of the day what we get from Omni is this encoded Omni transaction that is a payload that you can propagate so you can give this to your to your brother to your cousin okay here is the payload I already signed it you propagate that to any network so you just so it's just like the relaying step that that basically changes and and this is like happening off chain anyway like you you're not going to relay it from the

  54. 32:49

    contract right I don't there is one particular thing to mention that when you create addresses um you need to specify for which network in BTC because then they change a prefix but if you let's say change here the code and generate the BTC addresses for main net and you propagate to a BTC client and that's what we are using the closest you know send row transaction this is like the

  55. 33:20

    lowest level you're going to get to send a transaction to the BTC network but we are doing like this because we understand that number one actually I think is the only way to to do it well not the only way but it's the lowest level possible way to do it and you are sending a row you are sending a exod decimal to and and then you just propagate to any BTC client got it um and yeah so I I think something

  56. 33:53

    that I didn't mention is okay we get the signature and then we simply create the witness we use a still Omni to build the transaction with the witness and then that's it we propagate that and that's pretty much um the process that we are current currently following you are going to find the same similarity here in this example but this example is more elaborated because and this is another decision that we took for this example

  57. 34:29

    we are using the near Jon RPC client like what we are trying to do is basically the closest thing like how are you going to communicate and here you get the new Json RPC and we are doing real transaction like here you're going to see I'm calling the smart contract creating the transaction you know calling my near as my contract I sign then send the transaction and then with that

  58. 35:01

    information we do basically okay get the signature then build the witness and then propagate the transaction to the BTC Network so this is the the same approach but here is more elaborated because we are interacting with a real contract in here that's why you see the calls to a Json RPC client but um also I'm we're also signing with the NPC signer I hope that very confusing it's a it's a lot of code but it's it's really cool I think to zoom out like this this is all written in

  59. 35:45

    Rust right and I think the apart from rust being a beautiful language I think the main reason it being in Rost is that near smart contracts are primary primarily written in Russ so you could do like all of this on the front end and and like request a signature from the MPC directly from like your account just in the front end with no sort of proxy contracts in between that's generating

  60. 36:17

    these uh transactions and utxos but I think the the powerful thing of having this logic in the contract is that you can implement smart contract logic like on top of on top of Bitcoin so you can have some sort of logic that decides when like a transaction can be generated which allows you to like lock Bitcoin up or or like sell an order all on a Marketplace all on top of on top of n yes that's that's totally correct um

  61. 36:54

    and I just want to emphasize that when it's still early the tooling is continue is evolving but we are going to add this um Omni testing utilities that are going to reduce a lot the boiler plate and yeah we're trying to make developers lives easier E Yeah and I've actually um i' well I've me messaged ESS quite a bit about this library because I've been playing it with around with it on like the near

  62. 37:26

    side rather than the bit Bitcoin side and uh I've Loved using the library to be honest um after getting to learn it I had a few hiccups but now like it's it's pretty pretty easy to use oh yeah I by the way I I'm already implementing your feedback so yeah nice I'm glad you're listening to my feedback it's it's hopefully valuable then awesome 100% but yeah awesome Library I I love the

  63. 37:59

    work you've been doing um thank you um do you guys have another do you guys have another question no not right now where's the so I want to make sure it's wrong wrong person I want to make sure we the right the uh the right GitHub here so it's a GitHub Omni RS correct yes yeah if you look in the if you're on Twitter and you look on the um in like the comments you'll see I I've pinned the well not pinned but I've commented the library down there so you can take a look if you're on

  64. 38:40

    Twitter great great cool uh Greg uh yeah let me uh present my screen yeah well Greg's goingon to load up there's plenty of bounties here related to chain exraction and building across other chains and so uh great opportunity for the hackathon but also too if you're just interested in building with this stuff uh this is all available here uh so yeah take take it away Greg okay uh

  65. 39:22

    yeah so I'm gonna go over a lot of the same stuff that Edson did except from an application uh developer perspective and so um I have this uh BTC example that is sending Bitcoin transactions uh with a near wallet uh in the browser um and so it's pretty simple um I'm GNA give a uh live demo uh in mainnet um but uh yeah it's pretty simple basically you can choose between segwit or Legacy uh you can choose the uh the path which changes your address um and then I've got a balance

  66. 40:02

    of uh 5400 Satoshi and so I'm going to send uh a small transaction to my S and so this is signing with my near wallet oops that didn't work let me try again uh okay so there's the uh let's try this okay this looks good um so constructed the transaction it uh got the signature back from the MPC using the uh near wallet uh it finalized the Bitcoin transaction and now it is broadcasting it to the um Bitcoin main net well as was going question that I

  67. 40:53

    know I've heard people ask before so oh no again even as always on live demos of course so main net it is main net yeah we try again this worked just a minute ago sorry for cutting you off Joe I was just uh just surprised this was main that um well it was working earlier let me let me show you the uh uh um one that I just sent so this one is uh something that I just sent from this address uh so it does

  68. 41:40

    work yeah um but uh but yeah um I was going to walk through the uh the Bitcoin code uh and the parts that uh confuse people uh so in a lot of ways like we're uh we're building like a Bitcoin wallet because we need to generate the addresses and we need to like manually create these transactions uh and so like over here is the uh the kdf script this is what we use to generate the um the Bitcoin addresses and so my uh like react code

  69. 42:13

    just calls generate BTC address and uh depending on the path uh if it's test net and the address type it'll uh generate um a Bitcoin address so that's the uh the part oops that didn't work um so like oops doesn't like Legacy uh but but yeah this is like changing the path it's calling that method um and um then when you uh send the Bitcoin transaction um the react code calls um um this method uh get and broadcast signature and um so uh something that

  70. 43:09

    kind of confuses people sometimes is um uh there's actually like uh it it constructs the Bitcoin transaction twice and there's a dry run uh and so the get signature is um the dry run and uh this is uh what initiates the near transaction and uh actually like gets uh the signature and so um the way this works is you construct the the uh psbt uh and does all all this stuff um creates a partially signed Bitcoin transaction that's what that means uh which just um it's like an object that

  71. 43:48

    uh has all of the uh Bitcoin inputs or all of the utxo uh inputs and the um outputs uh because um like at uh described earlier um the utxo model is like um it's more like cash than uh an account model uh in ethereum and so you have like all of these um like dollar bills uh except for they can be any denomination and So like um right here um you can see I have a utxo with 32,000

  72. 44:21

    SATs um and so that's what this construct psbt object is just doing it's it's uh inputting that um utxo and then it's adding the output which is the address that you want to send to uh and so once you have that um transaction constructed uh you can well um this is also kind of confusing so we're using um Bitcoin JS lib uh and the way that we get the uh the transaction hash is we pass in this like key pair object uh to

  73. 44:54

    the psbt sign input async so this is just the object that contains the public key and this sign method and so uh we need to do it this way because uh this is um how you get the transaction hash from uh Bitcoin JS lib and so once you have the transaction hash uh you create the payload and that's what you need to send to the MPC to get the signature and so um once we have the signature uh like right here then we can

  74. 45:27

    actually finalize the uh psbt and send the uh transaction and so it goes over to the uh um the broadcast method and so here we're passing in the uh signature manually typically um this like sign method would uh call um um like a local signer but because we're using like a remote signing service um we have to break it up into these like dry run and then like this uh broadcast fast run so once we have the Sig um we essentially uh pass in this like fake signer it's not calling

  75. 46:04

    anything it's just essentially uh returning the um signature that we received in the uh the first first run and then once uh once everything is finalized um we can broadcast the uh transaction and so it sends this to uh blockstream and um then it returns whether or not it failed which is what happened earlier or it returns um a link to the uh like the com the successful transaction um and that's that's pretty much it do you guys have any questions cool I I think the the front

  76. 46:47

    end on once we've talked about it in like a a contract setting I I think the front end becomes a bit more more simple you know um so I I don't particularly have any questions myself about this this any from you Joe no I don't have any questions I I do though um just curious like your thoughts and doesn't have to be overly specific but like where do you start to see people actually implementing this into products

  77. 47:20

    is it just purely different D5 things or can you start to actually build apps that are leveraging Bitcoin in different ways yeah you could absolutely uh build uh an app that interacts with Bitcoin using uh something like this um anything that would involve like uh interacting the the uh the Bitcoin uh network uh and uh and you want to use um like near on top of that uh this sort of approach could be useful

  78. 47:58

    um like um it's it sort of like uh provides a way to like write smart contracts that um uh well write an app that interacts with um smart contracts on the near chain and then can also send um Bitcoin transactions yeah I think one of the most interesting use cases I've seen so far um I can't remember is but one of the devs at at pagod um was creating a like Bitcoin wallet but all

  79. 48:36

    you need is a Google account to sign up and it like generates a proof that you have the the front end generates a proof that you own like this Google account which then you make a call to like a near contract to verify that you own the Google account and then from there you can sign like whatever uh message to the the NPC service um through the contract with like any Bitcoin transaction uh so you have you can like send Bitcoin to anyone

  80. 49:13

    just by having like an email address um and I think yeah that's just like one of the the many interesting use cases yeah yeah exactly yeah it opens up a ton of use cases uh and you notice I actually got a successful transaction here let's go yeah so here it is it actually works saved uh fees on uh segwit was this a main net one yeah yeah nice how much how much gas was it well it's not gas in Bitcoin is it uh 1100

  81. 49:52

    Satoshi it looks like I'm overpaying too I could tweak that another question just to clarify for people who are new to building on this so maybe they've done chamption with just evm or maybe they're just new to this whole thing from a timing standpoint uh everyone usually is aware that um the Bitcoin network is a lot slower because it's doing proof of work uh how does it all fit into what you're doing here and how this works with chain of traction

  82. 50:29

    um sorry could you say again sure so the the the timing of of making calls and using a network um so if people are new to working with Bitcoin and maybe they at least understand that because proof of work it's a little bit slower for confirmation messages and things like that but how does that fit into this are you are they still let developers know they still Bound by you know having to

  83. 50:55

    go through that and there's some things that that are happening here in the back end that are um speeding anything up how does you know for people who who are new to this yeah absolutely um well yeah um coming from uh like a chain like near uh Bitcoin transactions are a lot slower um you saw how long it took it was like 10 something seconds 15 seconds uh for the Bitcoin part uh but the near uh transaction probably only takes about a second or two seconds uh um so I guess

  84. 51:27

    it's just something to be aware of uh you're going to have to um make sure that your code can handle uh like a like a long timeout um and uh yeah at at times it can like various parts of this can timeout too so it's just something to be aware of yeah I I think like a model some people are trying to work towards is instead of sending like Bitcoin transactions themselves you have like an

  85. 51:59

    account with Bitcoin on and you send like access to the account through the MPC to different people so then you're like sort of sending Bitcoin but with near like finality and and and gas so you can sort of avoid some of those problems but then you're restricted by well the accounts somewhat become utxos themselves where you have to like merge Bitcoin from from different accounts and split it up if you want to

  86. 52:31

    send an amount that isn't the amount that's on that account yeah exactly I think it becomes more interesting with things like like nfts and I don't know anything about I keep hearing the word runes I don't know what a rune is but yeah runes and ordinals do you actually know what I I'm familiar what of an ordinal is I think but do you actually know what a rune is either of you it's um it's like tokens uh it's it's a way to build uh tokens on bitcoin

  87. 53:11

    right what like fun tokens yeah yeah exactly oh okay cool so yeah you could use an approach like this to build a uh a runes or an ordinal app uh you'd uh be able to um use a near account um and uh you'd be able to interact like like purchase a uh um a a ordinal or Rune or uh you know make trades um yeah whatever you want awesome well uh great I really appreciate that you taking the time today walking us through all of that and

  88. 53:51

    uh what's the the best place for people to go to ask questions if they they have any um I'm on telegram um and uh on GitHub perfect so we're just right into the different repos jump in ask questions yeah I'll drop a link to the the chain abstraction uh chat Below in the uh the the the Twitter comment so you can join this chat if you have have any more questions about building this sort of

  89. 54:34

    stuff I'll try and help but uh this Bitcoin stuff probably won't be able to yeah perfect uh great this this was uh super helpful uh definitely appreciate Greg you taking the time we'll add this stuff all to the show notes people are watching this on a replay uh and kind of get involved and we encourage people to start start building on this uh thanks for your time today Greg thanks guys thanks thank you thank you so uh again uh if you are not already

  90. 55:07

    signed up you can leverage all of this stuff that you just learned here in the redacted hackathon it is going on for a few more days uh there are tons of great great prizes here uh here I'll bring up the page real quick and go through because there are some chain abstraction related ones think there's a lot of chain abstraction ones isn't there yeah there's a lot of different stuff you can do here so there's best of tanum exraction um you know uh there is some

  91. 55:38

    stuff around defi here so obviously this all fits into that uh proximity has their own separate Bounty as well related related to this uh there's a bunch of stuff that again you can start to mix and match here of leveraging different pieces so you could take maybe the workshop that we saw the end of last we with B using an agent build an agent tied into something that's doing with like the uh Omni

  92. 56:02

    Library here and now you're really mixing matching and you're eligible for all the different categories that your product fits in uh you can you can leverage and so you can actually apply to all of those win multiple prizes which is uh really exciting uh if you if you sign up you have until uh the pretty much the end of the Working Day depending on where you are in the world uh on October 31st uh

  93. 56:28

    there are so many projects especially if you go back and you look at some of the different AI agent ones and things like that that you can get done in a few hours to just get started so you could spend a day or two and uh get something ready to actually submit there $700,000 in prizes uh it's it's a great way to get involved and learn about more about the near community and stuff like that and there will be support all the way up

  94. 56:52

    until the deadline and Beyond uh through our different support channels uh and all of those are all listed here as well uh off of Dev post if you go to resources everything is right there for you uh come say hi in the different telegram groups and uh start building uh oh and you want to end with anything this was another good Workshop here around uh building with Bitcoin yeah I I I learned a lot on this

  95. 57:22

    one um really interesting stuff Bitcoin is quite complex I would say to deal with and not that many people building it so I think there's some cool opportunities there of what you can build um and I'll be really interested to see if many people build with Bitcoin on this um like I said I'm not I'm not too familiar so maybe people are going to come up with stuff that I have I have

  96. 57:53

    no clue about and it would just be awesome yeah yeah yeah know for sure definitely excited to see what what comes out of all of this uh we will be back again our normal time Thursday at 4M UTC uh we have a kind of combo episode Workshop you know building with privacy uh so uh Sandy from calero will be back on again uh if you've been watching the Fridays with frol he'll be back on it should be a really fun one talking about building around privacy and everything else like that that is

  97. 58:26

    Thursday at 4 pm UTC same place uh but until then keep building and we will see you Thursday bye folks