AssemblyScript Grant Q1 2021
- vladOP 5
The AssemblyScript ecosystem has been very valuable for NEAR Organization, since it allows developers familiar with TypeScript to develop NEAR dApps with minimal onboarding and learning. We would like to help the AssemblyScript ecosystem expand and further maturity of the existing components.
In the previous discussion we have brainstormed the projects that could get financial support from NEAR. Based on it we have agreed to allocate: 40k USD and 35k NEAR to support various projects. The grant consists of four parts:
A. Financial support for the AssemblyScript core team without attachments. We will grant 40,000 USD to AssemblyScript over OpenCollective so that they can focus on improving AssemblyScript language, compiler, and standard library following their own roadmap;
B. Financial support in NEAR tokens for the AssemblyScript projects that are not owned/initiated by NEAR to keep them going. NEAR has benefited from these projects and their community a lot in the past, and this is our way to recognize it and help them keep going;
C. Proposals to add/improve features in AssemblyScript projects not owned/initiated by NEAR. We will propose certain improvements to the projects in exchange for NEAR tokens. Anyone can grab them, but project owners have a priority;
D. Proposal to add/improve features in AssemblyScript projects owned/initiated by NEAR. We will assemble a team and fund them through the grant in NEAR tokens.
In general, NEAR does not want to limit its contribution to 40k USD and 35k NEAR in the near future. We just don’t have enough expertise and time to list every single AssemblyScript component and feature request in post. If you find anything in AssemblyScript ecosystem that you would like to build/improve/fix please reply in this thread.
A. Financial support for the AssemblyScript core team (paid)
Nothing to explain here :), we are just giving a batch of USD to the AssemblyScript core team without attachments, but with the hope that they will further the stability of the language, compiler, and the standard library.B. Financial support for projects not owned/initiated by NEAR
NEAR Organization would like to help the following AssemblyScript projects by donating NEAR tokens. If the project decides not to claim the tokens, they will be instead used by NEAR to compensate AssemblyScript developers in section D.
As-pect (paid)
As-pect is the go-to testing framework for AssemblyScript. NEAR protocol is currently using it for writing tests for AssemblyScript contracts.We would like to recognize the contribution of this project to the NEAR ecosystem and help it keep going, by providing 3000 NEAR tokens.As-bignum
As-bignum provides implementations for 128 and 256 arithmetics which is popular in the blockchain world. NEAR protocol has been using this library in its contracts.
We would like to recognize the contribution of this project to the NEAR ecosystem and help it keep going, by providing 3000 NEAR tokens.
Assemblyscript-regex (paid)
[Assemblyscript-regex](https://github.com/ColinEberhardt/assemblyscript-regex) is simply a regex engine for AssemblyScript. Potentially, NEAR contract developers might find it useful to have regex-based validation (e.g. checking whether input is an email address or a URL).We would like to recognize the contribution of this project to the NEAR ecosystem and help it keep going, by providing 3000 NEAR tokens.As-bind
As-bind allows passing high-level data-structures between AssemblyScript and JavaScript. While NEAR is not using this library at the moment, NEAR is in general highly interested in having a high-level interface with Wasm contracts. If we could run the same AssemblyScript on blockchain, as part of the webpage, and as a standalone node.js CLI without modifying the contract, it could potentially allow various interesting use cases.
We would like to recognize the contribution of this project to the NEAR ecosystem and help it keep going, by providing 1000 NEAR tokens.
Node
Node.js to WASI adapters for AssemblyScript are in their early days. NEAR protocol is not using this project directly, however, it’s implementation will likely further maturity AssemblyScript ecosystem.
We would like to recognize the contribution of this project to the NEAR ecosystem and help it keep going, by providing 1000 NEAR tokens.
Glas (paid)
Glas is a WebGL engine in AssemblyScript. While it cannot be used directly in a NEAR contract, there is great potential for hybrid game dApps that are written mostly in AssemblyScript, including the browser part. Additionally, Glas has to implements various math primitives that can be potentially later extracted into separate libraries that might be potentially useful for some contracts.We would like to recognize the contribution of this project to the NEAR ecosystem and help it keep going, by providing 1000 NEAR tokens.C. Proposals to add/improve projects not owned/initiated by NEAR
NEAR Organization is interested in certain improvements/fixes to the projects in section B. However, the NEAR Organization understands that owners might not be interested in implementing them themselves. Therefore, each improvement has an independent reward in NEAR tokens and anyone can implement it but owners have a priority to claim the reward.
As-pect
Add coverage (paid)
We would like to add functionality to measure coverage of the given tests. Coverage can be measured in the similar way we do gas counting at NEAR. As-pect would need to inject a host-function call into every Wasm block and then while executing tests on the Wasm module it would count the percentage of blocks that were reached by the execution.NEAR offers anyone who does it 3000 NEAR tokens.
As-bignum
Implement safe and unsafe versions of u256, i128, i256
256 and 128 math is important for blockchain applications.
NEAR offers anyone who implements it 1000 NEAR tokens, this includes covering these primitives with tests.
Division
Currently as-bignum is missing muldiv. Additionally there is a potential for implementing a faster division algorithm for u128.
NEAR offers anyone who implements it 1000 NEAR tokens, this includes covering these primitives with tests.
Corner case test coverage
It would be great to cover all corner cases with tests.
NEAR offers anyone who implements it 2000 NEAR tokens.
Introduce semver (paid)
We need to know when backward and non-backward compatible changes are introduced to the library. For that we need to introduce semver and add the changelog.NEAR offers anyone who implements it 200 NEAR tokens.D. Projects owned/initiated by NEAR
Near-sdk-as
MVP Active Record Interface for Contract State
We would like someone to offer a design of Active Record Pattern and implement it for operating with the state from the contracts. The design does not need to be sophisticated, but it needs to support read/write/delete/lookup operations for the state.
NEAR offers anyone who implements it 2000 NEAR tokens.
Finish near-sdk-as simulation test framework
near-sdk-as simulation test framework requires a lot of polish. Additionally, we would like have full documentation and test coverage for it, as well as all examples that cover various use cases in NEAR. This grant requires some high-level knowledge of writing contracts in NEAR.
NEAR offers anyone who implements it 4000 NEAR tokens.
As part of this project you would also need to do the following small work items:
Merge wasm_mock_vm on near-sdk-rs side
This project requires some Rust knowledge. We need to merge a year old PR, publish Wasm module, and switch dependency here to not depend on github branch.
Switch to release build
We need to switch the script here to use release instead of debug build mode here.
Extract mock-vm
near-mock-vm needs to be extracted into a separate AssemblyScript package.
Remove simulator
simulator is no longer needed, and it needs to be removed from the repository.
Assemblyscript-json (paid)
JSON Spec Test Suite
We would like to use [JSONTestSuite](https://github.com/nst/JSONTestSuite) to exercise AssemblyScript JSON implementation.NEAR offers anyone who implements it 500 NEAR tokens.
Asbuild (paid)
Asbuild tries to mimic Rust Cargo functionality, by being an all-in-one tool for building, testing, formatting, etc AssemblyScript projects. Right now however it has only very basic functionality.NEAR offers anyone who implements it 2000 NEAR tokens.
asb fmt
We would like `asb fmt` command to invoke eslint with AssemblyScript-friendly configuration on a given AssemblyScript project.asb test
We would like `asb test` command to find and execute as-pect tests on a given AssemblyScript project.asb init
We would like `asb init` to create scaffolding for an AssemblyScript project, with tiny program that prints Hello World and tiny example of as-pect test. Similar to `cargo init` in Rust.Visitor-as
AssemblyScript rewrite
Visitor-as is an important library necessary for functionality of near-sdk-as since it allows macros-like code injections. Currently it is mostly written in TypeScript, since AssemblyScript compiler front-end is still mostly written in JavaScript. We would like to rewrite visitor-as into AssemblyScript to make it more self-hosted which should contribute to the autonomy of the AssemblyScript ecosystem, and help with the quality of visitor-as.
NEAR offers anyone who implements it 1000 NEAR tokens.
Borsh.io
Borsh.io is a security and performance focused binary serialization format. NEAR protocol is using it both in the core implementation of the protocol and in the contracts. We would like to have a standalone AssemblyScript implementation of borsh.io library.
NEAR offers anyone who implements it 3000 NEAR tokens.
Datetime library (paid)
AssemblyScript ecosystem is currently lacking Date/Time implementation. NEAR contracts would also greatly benefit from this functionality since contracts are frequently time-aware. It would also make sense for AssemblyScript implementation to match the interface and behavior of JavaScript Date Object as close as possible, with UTC timezone support only.NEAR offers anyone who implements it 3000 NEAR tokens.
How to claim rewards?
A. Financial support for the AssemblyScript core team
We will just transfer 40,000 USD to AssemblyScript core team OpenCollective once we have time.
B. Financial support for projects not owned/initiated by NEAR
If you are one of the project owners, please reach out to [email protected].
C. Proposals to add/improve projects not owned/initiated by NEAR
If you want to implement one of the proposed changes reach out to [email protected]. If you are not a project owner, then we will contact the project owner first to get an agreement from them that they are okay with the code change. Also, the project owner might use the right to claim the reward and implement it themselves.
D. Projects owned/initiated by NEAR
@potatodepaulo will be assembling a team to work on these projects. Please reach out to him: [email protected] . He might be even okay with you starting to work on the project before he assembles a team.
Anything that we missed?
Do you have an idea a project or feature/improvement that we haven’t covered in this list and you want it to be funded by NEAR and might be viewed as beneficial to NEAR? Apply through https://grants.near.org/ or leave a comment in this thread.
- nearmax 1
For the record, 3k NEAR was claimed by jtenner through assemblyscript.sputnikdao.near
- vlad
I remembered few things we should add to AssemblyScript grant list:
- UTF-8 strings support (see Support UTF-8 strings out of the box · Issue #43 · AssemblyScript/assemblyscript · GitHub, Switch AssemblyScript to UTF-8 by default? · Issue #1653 · AssemblyScript/assemblyscript · GitHub) – potentially faster JSON parsing
- Template literals (Support template literals · Issue #466 · AssemblyScript/assemblyscript · GitHub) – useful for logging, etc. Also a common mistake people make in the wild, as compiler supports same quotes but doesn’t support substitution yet (it displays a warning).
- trusktr 2
Wow, thank you all for approving a grant for
glas!
- ashutoshvarma 1
Hi @nearmax @potatodepaulo,
Though I’m still new to NEAR but would love to contribute to the NEAR ecosystem.
By going through OP, I can find few tasks in section D that I can help with.
Are “JSON Spec Test Suite” and " Datetime library" from Section D still open? - nearmax
@willemneal Could you please discuss with @ashutoshvarma which project from section D he can start working on?
- nearmax
For the record, @ashutoshvarma claimed 500 NEAR.
- nearmax
- nearmax
3000 NEAR claimed by @ashutoshvarma
- jtenner
I would like to submit a grant proposal for an AssemblyScript data storage format designed to serialize object references with a very small footprint.
I propose ASON - AssemblyScript Object Notation which is a data oriented algorithm designed from the ground up to be fast by default, and avoid cache misses wherever possible to increase algorithm speed.
There is a minimal testing suite using as-pect that tests if the serialize and deserialize methods properly store and restore entire object trees in a very performant way.
So far this project has been 80 hours of work for me, and 15 hours for my friend @RedDwarfian on github.
With this funding, I can do more performance testing, and investigate ways of reducing serialized buffer size to help reduce smart contract storage costs. This library will also support the AssemblyScript ecosystem as a whole, enabling developers to send binary messages across networks, store data on the blockchain, and send messages across processes.
- nearmax
- nearmax
Comparing this project to borsh.io , and since you have already spent 95 hours, I think it qualifies for 2000 NEAR grant for the work that was already done and to support the future development of the project. Please submit an application here: SputnikDAO
- nearmax
2000 NEAR claimed by @jtenner for the development of ASON.
- nearmax
200 NEAR claimed by gitofdeepanshu (Deepanshu Hooda) · GitHub for adding semver to as-bignum.
- nearmax
3000 NEAR claimed by @jtenner for adding code-coverage tool.
- JairusSW
I am submitting a proposal for a JSON serializer and deserializer for AssemblyScript.
I propose JSON-AS – A JSON serializer and deserializer that follows the JSON spec as closely as possible. It will enable things such as API interaction, data communications, and file storage in the near future.
JSON-AS will provide fully-dynamic arrays and objects to conform to the full JSON spec. With the help of @DogWhich, we will work together as a team to create a complete JSON implementation for AssemblyScript that is both small and fast.
This project has taken (and will take) many hours for myself and lots of hard work on the part of @DogWhich for the dynamic Objects and Arrays.
This funding will enable us to provide JSON to the AssemblyScript community as a whole, along with dynamic arrays and objects. It will also go partly to @DogWhich for his amazing work and input into this project.
– Jairus Tanaka
- nearmax 1
Thank you for submitting the request, but NEAR is already using GitHub - near/assemblyscript-json: JSON encoder / decoder for AssemblyScript . Please explain how your JSON serializer is different.
- nearmax
@ashutoshvarma and @willemneal Regarding SputnikDAO Do these 2 PRs chore: switch to release build and bump deps in `near-mock-vm` by ashutoshvarma · Pull Request #556 · near/near-sdk-as · GitHub and feat: add complete `near-sdk-sim` rust ffi bindings by ashutoshvarma · Pull Request #557 · near/near-sdk-as · GitHub implement the following:
- full documentation and test coverage for it
- all examples that cover various use cases in NEAR
?
- JairusSW
Hey, sorry for the late response.
I’m currently optimizing and tweakingjson-asand also getting dynamic objects, union types, and dynamic types working with @DogWhich. At the moment, I’m running into a few problems, but I will let you know asap.
If you would want to chat on discord or something about dynamic objects and arrays, I’m sure you would be impressed. Its a bit hard to explain in here.
I’m also working on creating a chart that will compare both @serial-as/json and json-as side-by-side for a better idea of the differences.
- nearmax
@willemneal , @jim , @mikedotexe PTAL ^
- gagdiez
Hi @nearmax,
I just posted a proposal in the assemblyscript dao for borsh-as [1], made in collaboration with @willemneal. The project is fully functional, thoroughly tested, and is in the process of being added to the near-sdk.
This borsh implementation is actually part of a larger package called serial-as [2], which standardizes serializers in assemblyscript. Thanks to serial-as, developers only need to implement a few methods (
encode_number,decode_string, etc), and do not need to worry about implementing a transform. Furthermore, serial-as readily provides a set of tests that both basic (u*, sting, array, etc) and complex objects (Nullable objects, Nested objects, Inheritance, etc)Besides borsh, we have also implemented JSON in serial-as. While the current implementation is just a wrapper around assemblyscript-json, the idea for the near future is to use a more memory-efficient implementation. We can achieve this by simplifying the internal representations used while decoding an object (known as Values in assemblyscript-json). While the new implementation is still a work-in-progress (we are still deciding on some aspects with @willemneal), it is already fully functional, completely compatible with as-json, and thoroughly tested (see the feat-standalone-json branch).
serial-as has been in development for the past 3 months, and I plan to keep working on it and maintaining it. Because of this, I would like to ask the committee to consider giving a grant for serial-as and its upcoming development/maintenance.
Thank you for your time,
Guillermo[1] serial-as/borsh at main · gagdiez/serial-as · GitHub
[2] GitHub - gagdiez/serial-as: Building a generalized encoder for assembly script - gagdiez 1
Interesting, if you need there is a whole set of tests here which you can easily adapt for your package. They should save you time writing tests and help to make sure that everything is correct.
Looking forward to see the comparison!
- JairusSW
Awesome! Thanks for the tests!
- nearmax
For the record, I have changed ownership of this grant and the post itself to @jim .
- gagdiez
Hi @jim, when you have time please have a look at my message above related to AS grants. Thanks!
- jim
Hey @gagdiez. @willemneal and I will synch on this today. Thanks for all the info. We’ll review shortly.
- jim
- jim
- ashutoshvarma
Hi @jim, Hope you are doing fine!
I have been working onnear-sdk-assimulation bounty.
As the last remaining part of Finish near-sdk-as simulation test framework, I created the PR (feat: Update simulator tests for new `near-runner` API by ashutoshvarma · Pull Request #648 · near/near-sdk-as · GitHub) and it was merged.
But I don’t know why my proposal failed SputnikDAO
Let me know when you are ready, I will make the proposal for the same again.
Thanks - ashutoshvarma
Hi @jim, when you have time please have a look at my message above for AS grants.
Thanks - jberrytech
Hey @ashutoshvarma! Sorry about the delay here. Please resubmit and I’ll get this taken care of soon

- ashutoshvarma
Hi @jim @jberrytech , please find the new proposal
https://www.sputnik.fund/#/dao/assemblyscript.sputnikdao.near/proposals/20 - ashutoshvarma
Hi @jim,@jberrytech, this proposal is also going to expire soon. Kindly make time for this.
- ashutoshvarma 1
- jberrytech
- rom
Hey, I’m interested in applying for the as-bignum muldiv grant. However, I’m confused on the exact requirements involved. I have the following questions:
- as-bignum apparently already has muldiv for u128. Do I just have to implement muldiv for u256?
- I’d like to know more about the faster u128 division algorithm. Is it required for the grant, and may I have some sources (academic papers, wikipedia pages) about the algorithm to implement?
- jim
- rom 1
Thanks for the response. I’ve already shot an email at @nearmax about this, but I’d just like to note here that implementing both an optimized implementation of muldiv (which requires optimized mulmod, multiply, and divide operations for u256) and I’m assuming some fast paths for u128 division would take hundreds upon hundreds of lines of heavily tested code. I’ve already finished an unoptimized implementation here that takes up 500 lines and took entire days to make. In my opinion, relative to the sizes of other grants, the difficulty doesn’t match the reward. I’d be happy to optimize my existing code and merge into the as-bignum repository for a higher grant, if that’s possible.