Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💡 IDEA - BSV Assembly #74

Open
1 task done
geirigurka opened this issue Sep 9, 2024 · 1 comment
Open
1 task done

💡 IDEA - BSV Assembly #74

geirigurka opened this issue Sep 9, 2024 · 1 comment

Comments

@geirigurka
Copy link

Summary

Source: YenPoint's Python SDK User Test Report. All credit to Ken Sato of YenPoint

The ASM (Assembly) format is valuable for programming Bitcoin Script. However, there are ambiguities in the ASM format of Bitcoin opcodes between the different SDKs (TypeScript, Python, GO). A standardized ASM format across all infrastructure, libraries, SDKs, etc. is required

The Go SDK, with its apparently comprehensive list of ASM might serve as the baseline for an ASM standard.

Example

The conversion between bytecodes, ASM, and higher-level languages should be seamless and consistent. This will empower developers to program in ASM, creating complex script templates using higher-level languages like Scrypt, and precisely define script templates for NFTs, FTs, and smart contracts. Historically, the ASM format has been poorly defined due to limited use cases and Bitcoin Core's disabling of most opcodes. BSV has re-enabled most opcodes and plans to restore all opcodes in the near future.Consequently, developers will craft increasingly complex smart contract scripts, heightening the need for a well-defined ASM format. This will elevate ASM from an ambiguous pseudo-language to a genuine programming language and foundational tool. This shift will usher in a renaissance for Bitcoin smart contracts

Other information

Examples of the Different ASM formats for each repositories
SVNode
Py-sdk
Typescript SDK
Go SDK

Relevance to BSV

  • This proposal is relevant to the Bitcoin SV network
@sirdeggen
Copy link
Collaborator

Steps:

  1. Create a super-script which includes all possible OP codes for full coverage, including those which will soon be "reactivated" within "Chronicle" release.

  2. Add new unit tests to each of the ts-sdk go-sdk and py-sdk to check conversion of this test-script back and forth between the formats. SV Node, I wouldn't worry about as it will not change but will be obsolete soon enough as Teranode replaces it. Teranode will use go-sdk so we should be covered.

  3. Write some sort of formal language spec (how you do that I don't know but we can look into it).

  4. Update all the SDKs to ensure there is 1:1 conversion in both directions across all languages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants