bob-collective / bob Goto Github PK
View Code? Open in Web Editor NEWBOB is a hybrid L2 that combines the security of Bitcoin with the versatility of Ethereum.
Home Page: https://app.gobob.xyz/
BOB is a hybrid L2 that combines the security of Bitcoin with the versatility of Ethereum.
Home Page: https://app.gobob.xyz/
Is your feature request related to a problem? Please describe.
One major drawback of overlay protocols like ordinals is that the data is not subject to Bitcoin consensus and thus BRC20 and ord NFT require additional verification by some entity. In practice, these are either trusted third parties or some form of committees that act as TTP. There are several issues with this as the TTP or committee can change the way the data is interpreted and in the committee setting, disagreements might occur between the members which would require implementing some form of consensus protocol to resolve the disagreements.
Describe the solution you'd like
zkVM allows executing off-chain code written in Rust with an on-chain component in Solidity. It might be an avenue to enable Rust off-chain contracts together with a counterpart Solidity contract on the EVM side.
Port an ordinals indexer to zkVM. Porting an indexer in zkVM is an alternative to using some form of committee/TTP. zkVM would allow anyone to submit a bitcoin block that includes some ordinals following various standards and then verify that the ordinals inside are correctly processed by the indexer. The STARK proof can be verified by anyone and zkVM also gives you back return values, e.g., BRC20 deposits/withdrawals between a rollup that would support zkVM. If eventually BTC would support a ZK verify op code, you could also verify it there.
The approch is inspired by Zeth (https://www.risczero.com/news/zeth-release) to work with ord indexers/bitcoin instead of ethereum.
My hope is to understand the following:
The Early Renaissance marks the official testnet launch for BOB. The testnet allows for:
The Early Renaissance had a significant overlap with the period of the Late Middle Ages but marked the progression into modernity. Similarly, for BOB, the period of the Early Renaissance is marked by many influencing factors that will shape the BOB stack as the collective members are onboarded. Each member will bring in new influences that will work together to progress the stack to set the standard for building on Bitcoin.
The Early Renaissance for BOB leads to the official testnet launch. The testnet will enable users to test early beta and alpha versions of applications built on BOB. In turn, builders can gain feedback on how to improve their apps and work towards mainnet launch. BOB itself will start to offer an SDK to interact with the BTC relay as well as pay for tx fees with BTC. BOB should improve based on the builder feedback by adding missing features and improving the developer experience. Ideally, it would take a week to create a working demo for a new app built with BOB.
Target completion: Before Christmas 2023
Deliver a hosted testnet, a P2P swap dapp, an SDK, and an zkVM ordinals indexer.
Requirements and specification tracked in #16
The BOB SDK is meant as a set of Solidity contracts, Rust and/or TypeScript functions, and UI components to access the unique functions of BOB and make developing new applications on BOB simple. Where possible, existing libraries (OpenZeppelin, ethers.js, wagmi, viem, ethers-rs, foundry, react, ...) should be preferred before adding new functionality.
Requirements and specification tracked in #17
The P2P swap is meant to expose a set of smart contracts that allow users to swap BTC, BRC20s, and ERC20s. Anyone should be able to deploy a UI and additional tooling (improved order matching, ...) on top of these smart contracts.
Requirements and specification tracked in #7
The zkVM would allow anyone to write complex programs like a full ordinals indexer with an integrated DEX and then verify the correctness of the code without having to run a dedicated consensus over it. This is more of a moonshot project. But if it works, would provide an avenue to extend BOB with a range of Bitcoin programs like: ordinals and BRC20 DEXs, ordinals and BRC20 lending protocols, BTC stablecoins, decentralized LN hubs, autonomous nostr relayers, and many more.
Requirements and specification tracked in #3
Is your feature request related to a problem? Please describe.
We often get asked how to achieve trustless communication between Bitcoin and BOB. For example, swapping ordinals with ERC20 prompts most people that we talked to think that the ordinals need to be bridged. However, in a P2P fashion, bridging isn't required.
Describe the solution you'd like
Add a section to the docs, likely under here https://docs.gobob.xyz/docs/learn/guides/, that explains the principles of how a BTC light client works, what the trust assumptions are, and what applications can be built with this.
Additional context
The description should be SEO-friendly so we start building up a useful wiki for builders.
We can reuse text from the interBTC spec: https://spec.interlay.io/spec/btc-relay/index.html
Is your feature request related to a problem? Please describe.
I propose the addition of paths for both the BOB testnet and mainnet. These paths should be made accessible under the 'gobob' domain. You can find the specific paths by following this link: Paths Reference. Once this implementation is complete, kindly update the documentation accordingly.
Additional context
Originally posted here
Abstract
Add optimistic merged mining to the BOB OP stack rollup to allow Bitcoin miners to validate the rollup.
Goals
Plain OP stack depends only on Ethereum security for the rollup. With optimistic merged mining, we allow Bitcoin miners to verify the rollup sequencer and, in return, receive parts of the sequencer fees. This adds Bitcoin security to the roll-up, such that Bitcoin-centric apps (ordinals, BTC, BRC20, Runes, …) can offset the trust in Ethereum and the centralized sequencer.
Our goal is to make the changes for merged mining as non-invasive as possible to the OP stack with the long-term goal of being Superchain compatible. The pitch is: to add the ability to condition settlement of the OP rollup on another smart contract. This contract can implement a straightforward interface like allowSettlement() and return a boolean. We will use this for Bitcoin PoW security but other use cases (institutional, re-staking for rollup validation, offsetting centralized sequencer trust) could also be helpful.
How does it work?
Long-form of optimistic merged mining here: https://docs.gobob.xyz/docs/learn/bob-stack/merged-mining
Required Changes
We need to look into the fault-proof smart contract adjustments. In the current set of contracts, we’d change the L2OutputOracle contract to add a call to another smart contract in the proposeL2Output function that checks the presence of the PoW for BOB. The function interface would remain untouched.
We are going to write an additional component, e.g., op-merged-mining
, that exposes RPC APIs for the miner. However, these are in parallel to the existing op-node, op-geth, op-proposer, and op-batcher. We don’t modify the existing components.
Use Cases
The primary use case is to add Bitcoin security to an OP stack rollup. We are launching BOB as a rollup with the OP stack, but we imagine that successful apps on BOB will eventually want to have their own block space environment, either as an L3 or an L2. Making the PoW checking compatible with the standard OP stack would thus be great.
We think that there are other possible use cases where an external validator could verify the correctness of the sequencer/L2.
Is your feature request related to a problem? Please describe.
The SDK has little documentation and we hadn't had time yet to bring it to a state where others can easily use it or contribute to it.
Is your feature request related to a problem? Please describe.
Export Ordinals clients in the sdk
Describe the solution you'd like
Just add missing export
Front-end
Back-end
Dev-ops
Problem
getTxOutputValue
panics with EvmError: OutOfGas
error when invalid input is provided.
Testcase to trigger the corner case.
Originally posted by @nakul1010 in #119 (comment)
Safe wallet https://app.safe.global provides a way to set-up smart contract account with options to create advanced multi-signature wallet.
Currently, Safe multisig wallet supports only selected EVM chains (it does not support any chain like metamask). In order to make them support Bob L2, we would have to reach out to their team.
After the support is added, dApps need to use Safe apps SDK in order to integrate the functionality of app into Gnosis Safe wallet: https://docs.safe.global/safe-apps-sdk/safe-apps
Is your feature request related to a problem? Please describe.
The wBTC transfer demo https://demo-account-abstraction.gobob.xyz/ showcases the power of using AA to allow users to pay transaction fees in ERC20s. However:
Describe the solution you'd like
Create a hackathon template/starter project so that engineers can get started straight away.
Include templates for:
Consider also documentation:
This should be tested by distributing to the whole engineering team for feedback.
Is your feature request related to a problem? Please describe.
We are using Docusaurus 2.
Describe the solution you'd like
Update to Docusaurus 3 to have the latest supported features.
Is your feature request related to a problem? Please describe.
Currently we host all demos but we might not continue to do so later on.
Describe the solution you'd like
Allow users to easily host our demos themselves
Is your feature request related to a problem? Please describe.
Protocols built on top of Bitcoin have various APIs available, but they are early stage and often lack documentation. Moreover, they are not well integrated with existing REST APIs like electrs.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Develop a PoC for the BOB stack that allows:
The Late Middle Age was a period in Europe preceding the Renaissance. It was characterized by many crisis but saw great progress in the arts and sciences. We chose this name for BOB to reflect the many decisions that will have to be made for the stack and at the same time, the new achievements we will be able to make.
BOB is a large project, and having a PoC will allow us to understand the difficulties in bringing it to the testnet and mainnet readiness.
Target completion: End of September 2023
Deliver a proof of concept implementation of the BOB stack rollup and builder platform.
Solidity/EVM
Should be the same as https://docs.optimism.io/chain/tokenlist
We already provide a Typescript SDK for inscribing and transferring Ordinals, this uses Esplora (Electrs) as a back-end to fetch blocks and transactions. There is interest in using Rust to develop tooling for BOB since many useful libraries exist so we should provide a Rust SDK that achieves the same functionality.
We aim to use Risc Zero to support Rust smart contracts in the future.
The idea would be to introduce a Rust crate, structured similarly to the TS SDK, that uses the rust-bitcoin
dependencies to abstract inscribing and transferring Ordinals (and more!). We can also use the bdk
library for wallet functionality and re-use code from the Ord project since that is also written in Rust. There is also a lot of relevant code written for interbtc-clients
that interfaces with Bitcoin Core and Electrs that we can use.
Builders can interact with the Bitcoin testnet from BOB via the BTC relay aided by types and examples from a Solidity library including Bitcoin, ordinals, BRC20s
Closely related to #89, we need to finalize the Solidity smart contracts and supporting SDK - adding more tests and documentation. We also need to extend the contract suite to support Ordinal / BRC20 parsing and show developers how to utilize that functionality.
Is your feature request related to a problem? Please describe.
We currently have several deployed demos. We should unify these demos into one that showcase the strengths of BOB into a single application instead of having to send users and builders to multiple websites.
Describe the solution you'd like
Extend the P2P swap demo to be our one single demo:
The isolated demos should still exist as code examples for builders so that anyone can look at how to implement them without having to comb through a lot of (possibly) unrelated code.
Context and Alternatives
I really like demos like https://demo.privy.io/ where you can click around with the different features on one side and then try it out in the other part of the window. Once we have completed the above, we could add a little "customize your demo" sidebar that would allow:
Is your feature request related to a problem? Please describe.
We are currently implementing Bitcoin signing logic in various places like the SDK and in the sats-wagmi package. The problem is that these implementations diverge and lack testing. I like a single isolate tx creation and signing logic here that we can reuse in node.js scripts, testing suits, or in frontend packages.
Describe the solution you'd like
Add the following methods with tests:
Prio 1
Prio 2
Build this on https://github.com/paulmillr/scure-btc-signer and https://github.com/paulmillr/micro-ordinals.
Don't use bitcoinjs-lib
.
Is your feature request related to a problem? Please describe.
The current P2P demo doesn't allow to swap ordinals. BOB can do that, so would be great to show it.
Describe the solution you'd like
P2P Sell Process
Open questions
Context
Create a P2P marketplace to allow anyone to swap BTC, BRC20s, and ERC20s (including WETH) without a third party.
Building out BOB is best done in combination with a use case from which we can draw conclusions which additional features or improvements we need to make to the base layer.
P2P swaps are one of the earliest use cases of cross-chain communication and have the advantage that users can swap directly without giving up custody to anyone. There's currently no P2P swap for BTC and BRC20s that is both cheap and works without a custodian.
Target time: end of September 2023
Hackathon-level implementation of the P2P swap. The goal of this project is to understand the complexities of developing the P2P marketplace by delivering a usable deployment of the P2P on a testnet rollup that allows swapping testnet BTC, BRC20s, and ERC20s. Mocking of complex parts of the application is highly encouraged to deliver a usable app.
These functions MUST be available for the PoC level.
The protocol follows a simple OTC trade logic for the POC stage. In the future, more complex schemes including off-chain order books, Dutch auctions, and other mechanisms will be explored.
The protocol consists of three parts:
It is yet unclear how we ensure unique BTC transactions for proofs.
Create a demo to show inscribing and transferring ordinals using a Metamask snap. Demo can use Metamask flask.
Tracking issue. All requirements TBC.
This proposal outlines a way for Bitcoin users to onboard to BOB rollups without having to explicitly acquire new tokens but rather sending BTC to an address on Bitcoin.
TBD
TBD
TBD
TBD
Is your feature request related to a problem? Please describe.
With BitVM, we can likely build a Bitcoin bridge that only requires 1 of n honest parties. That is much better than the trust assumptions of current bridges and offsets the opportunity cost of locked collateral as in iBTC.
There are many open questions around BitVM and how exactly to implement a bridge. I see the core issue as being able to write a light client for another chain in BitVM - or rather a fraud proof to verify the light client in BitVM.
Describe the solution you'd like
I think an interesting first step would be to implement a toy program in BitVM. This could be something quite simple by verifying that a value is 0 in BitVM. A more complex example would be to implement a SHA256 checker. There are already a couple of these examples here: https://techmix.github.io/tapleaf-circuits/
Outcome of this issue would be to have a a working toy example and a knowledge sharing session how to implement programs in BitVM.
After this, we can break down the requirements for a light client for BOB into its individual parts and try start to implement the relay in BitVM.
Additional context
I found the youtube videos most helpful to get an initial understanding and then the interactive BitVM examples:
The BitVM TG chat is very active: https://t.me/bitVM_chat
TBD
TBD
### ⚠️ No Changeset found
Latest commit: 2434d29
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Originally posted by @changeset-bot[bot] in #204 (comment)
TBD
TBD
There's several ways to achieve this. This issue explores using either account abstraction or meta transactions.
TBD
TBD
Esplora only returns the first 25 UTXOs but for the wallet logic we may need to spend more if the balance is higher.
Originally posted by @sander2 in #267 (comment)
Is your feature request related to a problem? Please describe.
Vercel queues the docusaurus builds but can be a bit slow. Usually, docusaurus fails on broken links and then one needs to either inspect the vercel logs or build manually to see which links caused the build to fail.
Describe the solution you'd like
Add a git pre-commit hook to run yarn build
in the docs
folder but only if there are changes in the documentation. We could use husky
for this.
Describe alternatives you've considered
An alternative is to not fail builds on broken links but that is not desirable since broken links should not be part of the documentation.
Is your feature request related to a problem? Please describe.
Solidity compiler generates multiple warnings for the contracts. Most warnings are related to unused parameters.
Describe the solution you'd like
ToDos
if required.test.yml
build command from forge build --sizes
to forge build --sizes --deny-warnings
.The safe math library is not used in any of our contracts, which can lead to overflow underflow situations.
Use the following safemath library for calculations.
Describe the bug
Based on the hello bitcoin guide. Remix is not flattening smart contract as expected if the smart contract has remappings.
Urgent
Not Urgent
Problem:
In the Ord_Marketplace.sol
-> proofOrdinalSellOrder()
method, there is a lack of verification for the correct transfer of the satoshi to the buyer's address. While the contract checks that the transaction is spending the specified UTXO and has an output to the buyer's address, it does not verify which specific satoshi is being transferred. This loophole allows potential cheating in the demo version.
Solution:
Implement additional verification steps within the proofOrdinalSellOrder()
method to ensure the correct transfer of the specific satoshi to the buyer's address. This includes validating the exact satoshi being transferred and verifying it against the provided UTXO and offset information. By enhancing this method with precise verification checks, the contract can prevent potential cheating and ensure the secure transfer of satoshis in the marketplace.
Originally posted by @sander2 in #114 (comment)
Is your feature request related to a problem? Please describe.
The current hello world example is taken from the Solidity guides. This works but doesn't show the capabilities of BOB.
Describe the solution you'd like
Change the hello world example to showcase the possibilities of BOB:
Additional context
See current example: https://docs.gobob.xyz/docs/build/getting-started/helloworld
Is your feature request related to a problem? Please describe.
Local development/regtest is difficult and often impractical, especially when a local Bitcoin node is required. It requires good knowledge of Bitcoin core (which is good to have) but:
bitcoin-cli
Describe the solution you'd like
We need an easy-to-use tool similar to bitcoind -regtest
with additional functionality. It does not need to provide consensus compatibility, but should make it easier to replicate Bitcoin "quirks" for testing. For example with regtest we cannot emulate chain forks to test light client (SPV) logic, it is also cumbersome to auto-mine blocks and bitcoind
does not allow us to "fork" from some pre-existing state. The tool should be similar to anvil
from the Foundry suite and should provide Bitcoin RPC compatibility so we can re-use existing tools such as Electrs.
Describe alternatives you've considered
We have been using regtest
for quite some time, right now nothing exists which satisfies these requirements.
Additional context
We should use rust-bitcoin
and existing Bitcoin libraries as much as possible. We may need to provide additional tooling to support forking since we need to load state over HTTP(S), it may be possible with Electrs but requires further experimentation.
Is your feature request related to a problem? Please describe.
Sometimes is ideal to allow wallet to broadcast transactions instead of doing it in our end. So it is ideal to add this flag and just make inscribeData
prepare the transaction and return it.
Describe the solution you'd like
Add flag that conditionally skips the execution of broadcast
The BOB SDK is meant as a set of Solidity contracts, Rust and/or TypeScript functions, and UI components to access the unique functions of BOB and make developing new applications on BOB simple.
BOB combines Bitcoin and EVM functionality into a coherent SDK to give anyone access to Bitcoin data, verification functions, account abstraction, and more. The SDK should it make easy for anyone to access to the BOB functionality.
We propose a three milestone roadmap to deliver a Bitcoin-enhanced and OP Stack-compatible rollup for Bitcoin. The rollup allows builders to write Rust and EVM smart contract with native integrations for both Bitcoin and Ethereum data and assets.
Rollups and bridges targeting Bitcoin should align with its core values: decentralization, scarcity, and immutability. While Ethereum is advancing with rollups as a core scaling solution, emphasizing user experience and privacy, Bitcoin lags in adopting experimental features due to its emphasis on security and resilience. Bitcoin's robust and defensive stance makes it harder to integrate innovations rapidly.
The BOB collective provides a solution to this problem. BOB core values are:
The technical product developed by the BOB collective follows from these values. BOB is three things:
BOB will be the catalyst for the “building on Bitcoin” renaissance. The movement combines the Bitcoin core values with new avenues of thought. BOB is a Bitcoin-augmented rollup for free experimentation and innovation with real-world impact.
The goal of this proposal is to launch BOB as a rollup before the Bitcoin halving 2024.
Deliver a proof of concept implementation of the BOB stack rollup and builder platform.
Target completion: End of September 2023
Deliver a testnet deployment of the BOB stack rollup, BTC bridge, and builder platform.
Target completion: Mid December 2023
Deliver a mainnet deployment of the BOB stack rollup, BTC bridge, and builder platform.
Target completion: Mid March 2024
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.