[HN Gopher] Exporting image assets from ethereum smart contract ...
___________________________________________________________________
Exporting image assets from ethereum smart contract with solidity
Author : dezmou
Score : 30 points
Date : 2021-03-27 17:00 UTC (6 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| raidicy wrote:
| What about storing a base64 string and decoding it in the client?
| Would an arbitrary base64 string fit in a 256 variable?
| jstanley wrote:
| The amount of image data you can fit in (I assume) 256 bytes is
| pretty small. That's enough for an uncompressed 8-bit 16x16
| pixel bitmap with no header. And you only get 3/4 of that
| amount of information if it's base64'd. With compression you
| can do better, but 256 bytes is not going to get you anywhere
| near the kind of high-resolution artwork that people seem to be
| using NFTs for.
| seoaeu wrote:
| Image compression will get you way further, but even then
| you'd probably need 10x the space for anything remotely
| reasonable
| Animats wrote:
| How much "gas" does it cost to store data in the Etherium
| blockchain? The entire Etherium blockchain is about 180 GB.
| vmception wrote:
| The real answer is that you have to pay attention to the gas
| limit per block, which is pretty high now
|
| On the Ethereum EVM it is 12,000,000 ether gwei. Most blocks
| are full. If you are willing to pay 12,000,000 ether gwei at
| competitive gas prices, it will get mined.
|
| For an image application you can probably use as many blocks as
| you want to create and store a larger image.
|
| As blocks are already full, this wont change anything, some
| people will get priced out for the time being or they pay
| higher gas price, miners get paid 12,000,000 ether gwei * gas
| price either way.
|
| So gas prices right now are like 135 gwei.
|
| 12,000,000 ether gwei is 0.012 ether. 0.012 * 135 = 1.62 ether
| @ $1,704 per ether = $2760 cost if you want to fill up an
| entire block
|
| Binance Smart Chain EVM has 30,000,000 binance gwei gas limit.
| And the binance token is much cheaper to begin with at the
| moment.
|
| and there are other EVMs, you can find the EVM you want to use.
| Ethereum mainnet EVM has the highest number of nodes to store
| it though.
|
| Its economical if you can sell it for a higher price. No
| different from any other art trade, artist can take the risk or
| a studio can front capital.
| vmception wrote:
| Sidenote: you should really learn about the EVM and be able
| to synthesize the same answers as I did
|
| this is unrelated to being a "blockchain skeptic", a "no-
| coiner", a "bitcoin only, Ethereum is too centralized, dont
| mention any other distributed ledger around me" person, or
| anything else
|
| The EVM (Ethereum Virtual Machine) concept is as important to
| be up to speed on as the JVM (Java Virtual Machine) concept
| kfichter wrote:
| 20,000 gas for 32 bytes of data if you want it to be accessible
| by other smart contracts. 16 gas per non-zero byte (4 gas per
| zero byte) of "transaction input data," which is accessible to
| clients off-chain but is not accessible to smart contracts.
| dezmou wrote:
| The image data is not stored, only the seed needed to generate
| the bitmap, the image generation is done by a gasless view
| function when needed
| jstanley wrote:
| That doesn't really help in the general case. If you can
| compress arbitrary images down to a single small seed, then
| you have the best image compression algorithm in the world.
| The applications of good image compression are much broader
| than NFTs.
|
| It looks like this project doesn't actually store arbitrary
| pictures.
| dezmou wrote:
| this is why this approach is reserved to on-chain generated
| NFTs
| babyshake wrote:
| What about the types of sprites that you would find in an
| Atari 2600 or similar system? Would it be even remotely
| practical to store these on the Ethereum blockchain?
| dezmou wrote:
| A 64x64 monochrome bitmap would weight 512 bytes, still
| very expensive to store on blockchain
| ghayes wrote:
| The other common approach here (for non-generative images) is to
| store the Sha3 hash of an image and then simply require that
| someone, somewhere has the actual data. You could also pass the
| image as a LOG message which is significantly cheaper (3 gas per
| byte, versus 20,000 gas per 32-bytes to store data) which means
| if you can read older chain blocks, you can ensure you have the
| underlying data.
| choxi wrote:
| Would this be equivalent to storing the encryption key on the
| blockchain such that only people with an NFT have the key, and
| can decrypt the image (wherever the encrypted image is stored)?
| [deleted]
___________________________________________________________________
(page generated 2021-03-27 23:01 UTC)